-
Notifications
You must be signed in to change notification settings - Fork 73
Configuration canary for the second or further plugins. #289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
1ddd4a4
Canary for the second plugins
ingwonsong 44e4019
Fix lint errors
ingwonsong 6a8becc
Add tests for secondary canary test
ingwonsong 0527d4b
Add log checks for checking the root_id is working properly
ingwonsong c2f3676
Iterate all the combinations of the plugin parameters in tests
ingwonsong b361a81
Change the canary function to be the member function of WasmHandleBase
ingwonsong f131a26
Bump up the version of proxy-wasm-cpp-sdk, and fix the CI script
ingwonsong 7089760
Reduce the constructors and fix lint errors
ingwonsong 928635a
Add clean up step to remove unnecessary directories before upload the…
ingwonsong 6660829
Introduce "Global Log" to get the logs happen when canarying
ingwonsong 7b64da7
Remove unnecessary test factors to avoid timeout in s390x.
ingwonsong d1cb6b0
Kill the VMs in the test case
ingwonsong ba72bbc
kill wasm_handle if it is not using the same wasm vm
ingwonsong f89b1df
skip the test in s390x arch
ingwonsong d3f7de2
Use the same TestContext
ingwonsong edbe96f
Add the test case for the canary failure
ingwonsong 7bcf22e
Reflect the comments
ingwonsong ff3d16a
Reflect the comments
ingwonsong f011993
Defend the case that WasmHandleBase::wasm() is null for `canary` func…
ingwonsong 7e3af54
Add the comments for the reason why we deletes the directories in tes…
ingwonsong 9006f57
Add timeout to Bazel, not github script
ingwonsong d10641e
Keep the wasm handler reference to reuse the wasm vm
ingwonsong 25f6f58
Change the prefix "Test" to CanaryCheck
ingwonsong 35a0685
Reflect the comments
ingwonsong d7abc4f
Add the omitted empty line between external and local includes
ingwonsong 0bd8418
Remove trailing white spaces
ingwonsong File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// Copyright 2021 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#include <string> | ||
#include <string_view> | ||
#include <unordered_map> | ||
|
||
#include "proxy_wasm_intrinsics.h" | ||
|
||
class CanaryCheckRootContext1 : public RootContext { | ||
public: | ||
explicit CanaryCheckRootContext1(uint32_t id, std::string_view root_id) | ||
: RootContext(id, root_id) {} | ||
bool onConfigure(size_t s) override { | ||
LOG_TRACE("onConfigure: root_id_1"); | ||
return s != 0; | ||
} | ||
}; | ||
|
||
class CanaryCheckContext : public Context { | ||
public: | ||
explicit CanaryCheckContext(uint32_t id, RootContext *root) : Context(id, root) {} | ||
}; | ||
|
||
class CanaryCheckRootContext2 : public RootContext { | ||
public: | ||
explicit CanaryCheckRootContext2(uint32_t id, std::string_view root_id) | ||
: RootContext(id, root_id) {} | ||
bool onConfigure(size_t s) override { | ||
LOG_TRACE("onConfigure: root_id_2"); | ||
return s != 0; | ||
} | ||
}; | ||
|
||
static RegisterContextFactory register_CanaryCheckContext1(CONTEXT_FACTORY(CanaryCheckContext), | ||
ROOT_FACTORY(CanaryCheckRootContext1), | ||
"root_id_1"); | ||
|
||
static RegisterContextFactory register_CanaryCheckContext2(CONTEXT_FACTORY(CanaryCheckContext), | ||
ROOT_FACTORY(CanaryCheckRootContext2), | ||
"root_id_2"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.