Skip to content

Commit

Permalink
erge branch 'main' into make-headers-builder-case-insensitive
Browse files Browse the repository at this point in the history
Signed-off-by: Rafal Augustyniak <[email protected]>
  • Loading branch information
Augustyniak committed Jun 23, 2022
2 parents 516a1fc + ee6e8dd commit 2ff4fb6
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 7 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/android_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
//:android_dist
javahelloworld:
name: java_helloworld
needs: androidbuild
runs-on: macos-12
timeout-minutes: 25
steps:
Expand Down Expand Up @@ -66,6 +67,7 @@ jobs:
run: adb logcat -e "received headers with status 200" -m 1
kotlinhelloworld:
name: kotlin_helloworld
needs: androidbuild
runs-on: macos-12
timeout-minutes: 25
steps:
Expand Down Expand Up @@ -99,6 +101,7 @@ jobs:
run: adb logcat -e "received headers with status 200" -m 1
kotlinbaselineapp:
name: kotlin_baseline_app
needs: androidbuild
runs-on: macos-12
timeout-minutes: 25
steps:
Expand Down Expand Up @@ -132,6 +135,7 @@ jobs:
run: adb logcat -e "received headers with status 200" -m 1
kotlinexperimentalapp:
name: kotlin_experimental_app
needs: androidbuild
runs-on: macos-12
timeout-minutes: 25
steps:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/ios_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
name: 'Build Envoy.framework distributable'
swifthelloworld:
name: swift_helloworld
needs: iosbuild
runs-on: macos-12
timeout-minutes: 25
steps:
Expand All @@ -49,6 +50,7 @@ jobs:
name: 'Log app run'
swiftbaselineapp:
name: swift_baseline_app
needs: iosbuild
runs-on: macos-12
timeout-minutes: 25
steps:
Expand All @@ -73,6 +75,7 @@ jobs:
name: 'Log app run'
swiftexperimentalapp:
name: swift_experimental_app
needs: iosbuild
runs-on: macos-12
timeout-minutes: 25
steps:
Expand All @@ -97,6 +100,7 @@ jobs:
name: 'Log app run'
swiftasyncawait:
name: swift_async_await
needs: iosbuild
runs-on: macos-12
timeout-minutes: 25
steps:
Expand All @@ -121,6 +125,7 @@ jobs:
name: 'Log app run'
objchelloworld:
name: objc_helloworld
needs: iosbuild
runs-on: macos-12
timeout-minutes: 25
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ios_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./bazelw test --experimental_ui_max_stdouterr_bytes=10485760 --test_output=all --config=ios --build_tests_only --config=remote-ci-macos --remote_header="Authorization=Bearer $GITHUB_TOKEN" //test/swift/...
objctests:
name: objc_tests
name: c_and_objc_tests
runs-on: macos-12
timeout-minutes: 120
steps:
Expand All @@ -56,4 +56,4 @@ jobs:
if: steps.check_context.outputs.run_tests == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./bazelw test --test_output=all --config=ios --build_tests_only --config=remote-ci-macos --remote_header="Authorization=Bearer $GITHUB_TOKEN" //test/objective-c/...
run: ./bazelw test --test_output=all --config=ios --build_tests_only --config=remote-ci-macos --remote_header="Authorization=Bearer $GITHUB_TOKEN" //test/objective-c/... //test/cc/unit:envoy_config_test
1 change: 1 addition & 0 deletions docs/root/intro/version_history.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Bugfixes:
- fix bug where finalStreamIntel was not consistently set on cancel (:issue:`#2285 <2285>`)
- iOS: fix termination crash in ProvisionalDispatcher (:issue:`#2059 <2059>`)
- iOS: make headers lookup in HeadersBuilder case insensitive (:issue:`#2383 <2383>`)
- iOS: use correct DNS resolver when using C++ config builder (:issue: `#2378 <2378 >`)

Features:

Expand Down
18 changes: 13 additions & 5 deletions library/cc/engine_builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,17 @@ namespace Platform {

EngineBuilder::EngineBuilder(std::string config_template)
: callbacks_(std::make_shared<EngineCallbacks>()), config_template_(config_template) {}
EngineBuilder::EngineBuilder() : EngineBuilder(std::string(config_template)) {}
EngineBuilder::EngineBuilder() : EngineBuilder(std::string(config_template)) {
#if defined(__APPLE__)
dns_resolver_name_ = "envoy.network.dns_resolver.apple";
dns_resolver_config_ = "{\"@type\":\"type.googleapis.com/"
"envoy.extensions.network.dns_resolver.apple.v3.AppleDnsResolverConfig\"}";
#else
dns_resolver_name_ = "envoy.network.dns_resolver.cares";
dns_resolver_config_ = "{\"@type\":\"type.googleapis.com/"
"envoy.extensions.network.dns_resolver.cares.v3.CaresDnsResolverConfig\"}";
#endif
}

EngineBuilder& EngineBuilder::addLogLevel(LogLevel log_level) {
this->log_level_ = log_level;
Expand Down Expand Up @@ -116,10 +126,8 @@ std::string EngineBuilder::generateConfigStr() {
{"dns_preresolve_hostnames", this->dns_preresolve_hostnames_},
{"dns_refresh_rate", fmt::format("{}s", this->dns_refresh_seconds_)},
{"dns_query_timeout", fmt::format("{}s", this->dns_query_timeout_seconds_)},
{"dns_resolver_name", "envoy.network.dns_resolver.cares"},
{"dns_resolver_config",
"{\"@type\":\"type.googleapis.com/"
"envoy.extensions.network.dns_resolver.cares.v3.CaresDnsResolverConfig\"}"},
{"dns_resolver_name", dns_resolver_name_},
{"dns_resolver_config", dns_resolver_config_},
{"h2_connection_keepalive_idle_interval",
fmt::format("{}s", this->h2_connection_keepalive_idle_interval_milliseconds_ / 1000.0)},
{"h2_connection_keepalive_timeout",
Expand Down
2 changes: 2 additions & 0 deletions library/cc/engine_builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ class EngineBuilder {
std::string virtual_clusters_ = "[]";
std::string config_override_for_tests_ = "";
std::string admin_address_path_for_tests_ = "";
std::string dns_resolver_name_ = "";
std::string dns_resolver_config_ = "";
int stream_idle_timeout_seconds_ = 15;
int per_try_idle_timeout_seconds_ = 15;
bool gzip_filter_ = true;
Expand Down
1 change: 1 addition & 0 deletions test/cc/unit/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ envoy_cc_test(
deps = [
"//library/cc:engine_builder_lib",
"//library/cc:envoy_engine_cc_lib_no_stamp",
"@envoy//source/extensions/network/dns_resolver/apple:config",
],
)
13 changes: 13 additions & 0 deletions test/cc/unit/envoy_config_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
#include "library/cc/log_level.h"
#include "library/common/config/internal.h"

#if defined(__APPLE__)
#include "source/extensions/network/dns_resolver/apple/apple_dns_impl.h"
#endif

using testing::HasSubstr;
using testing::Not;
extern const char* alternate_protocols_cache_filter_insert;
Expand Down Expand Up @@ -61,6 +65,15 @@ TEST(TestConfig, ConfigIsValid) {
auto config_str = engine_builder.generateConfigStr();
envoy::config::bootstrap::v3::Bootstrap bootstrap;
TestUtility::loadFromYaml(absl::StrCat(config_header, config_str), bootstrap);

// Test per-platform DNS fixes.
#if defined(__APPLE__)
ASSERT_THAT(bootstrap.DebugString(), Not(HasSubstr("envoy.network.dns_resolver.cares")));
ASSERT_THAT(bootstrap.DebugString(), HasSubstr("envoy.network.dns_resolver.apple"));
#else
ASSERT_THAT(bootstrap.DebugString(), HasSubstr("envoy.network.dns_resolver.cares"));
ASSERT_THAT(bootstrap.DebugString(), Not(HasSubstr("envoy.network.dns_resolver.apple")));
#endif
}

TEST(TestConfig, SetGzip) {
Expand Down

0 comments on commit 2ff4fb6

Please sign in to comment.