Skip to content

Commit 70506c9

Browse files
committed
Reflect the comments
1 parent 7bcf22e commit 70506c9

File tree

4 files changed

+15
-19
lines changed

4 files changed

+15
-19
lines changed

.github/workflows/test.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,13 @@ jobs:
5757
-c opt
5858
$(bazel query 'kind(was.*_rust_binary, //test/test_data/...)')
5959
$(bazel query 'kind(_optimized_wasm_cc_binary, //test/test_data/...)')
60-
60+
# Note `proxy_wasm_cc_binary` generates `_optimized_wasm_cc_binary` rule building the final artifact of `proxy_wasm_cc_binary`.
6161
- name: Clean up test data
6262
shell: bash
6363
run: |
6464
# Remove temporal directories
65-
for i in $(cd bazel-bin/test/test_data && ls -1); do \
66-
if [ -d "bazel-bin/test/test_data/$i" ]; then \
67-
rm -rf bazel-bin/test/test_data/$i; \
68-
fi; \
65+
for i in $(find bazel-bin/test/test_data/ -mindepth 1 -maxdepth 1 -type d); do \
66+
rm -rf $i; \
6967
done
7068
7169
- name: Upload test data
@@ -279,6 +277,7 @@ jobs:
279277
done
280278
281279
- name: Bazel build/test
280+
timeout-minutes: 30
282281
run: >
283282
${{ matrix.run_under }}
284283
bazel ${{ matrix.action }}

test/test_data/configure_check.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ static RegisterContextFactory register_TestContext1(CONTEXT_FACTORY(TestContext)
4545
ROOT_FACTORY(TestRootContext1), "root_id_1");
4646

4747
static RegisterContextFactory register_TestContext2(CONTEXT_FACTORY(TestContext),
48-
ROOT_FACTORY(TestRootContext2), "root_id_2");
48+
ROOT_FACTORY(TestRootContext2), "root_id_2");

test/utility.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,10 @@ class TestContext : public ContextBase {
137137

138138
class TestWasm : public WasmBase {
139139
public:
140-
TestWasm(std::unique_ptr<WasmVm> wasm_vm, std::unordered_map<std::string, std::string> envs = {})
141-
: WasmBase(std::move(wasm_vm), "", "", "", std::move(envs), {}) {}
142-
143-
TestWasm(std::unique_ptr<WasmVm> wasm_vm, std::string_view vm_id,
144-
std::string_view vm_configuration, std::string_view vm_key)
145-
: WasmBase(std::move(wasm_vm), vm_id, vm_configuration, vm_key, {}, {}) {}
140+
TestWasm(std::unique_ptr<WasmVm> wasm_vm, std::unordered_map<std::string, std::string> envs = {},
141+
std::string_view vm_id = "", std::string_view vm_configuration = "",
142+
std::string_view vm_key = "")
143+
: WasmBase(std::move(wasm_vm), vm_id, vm_configuration, vm_key, std::move(envs), {}) {}
146144

147145
TestWasm(const std::shared_ptr<WasmHandleBase> &base_wasm_handle, const WasmVmFactory &factory)
148146
: WasmBase(base_wasm_handle, factory) {}

test/wasm_test.cc

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,6 @@ TEST_P(TestVm, GetOrCreateThreadLocalWasmFailCallbacks) {
115115

116116
// Tests the canary is always applied when making a call `createWasm`
117117
TEST_P(TestVm, AlwaysApplyCanary) {
118-
// Skip this test for s309x arch because it tooks too much time in CI.
119-
#if defined(__s390x__) || defined(__zarch__)
120-
GTEST_SKIP();
121-
#endif
122118
// Use different root_id, but the others are the same
123119
const auto *const plugin_name = "plugin_name";
124120

@@ -160,7 +156,8 @@ TEST_P(TestVm, AlwaysApplyCanary) {
160156

161157
WasmHandleFactory wasm_handle_factory_baseline =
162158
[this, vm_ids, vm_configs](std::string_view vm_key) -> std::shared_ptr<WasmHandleBase> {
163-
auto base_wasm = std::make_shared<TestWasm>(newVm(), vm_ids[0], vm_configs[0], vm_key);
159+
auto base_wasm = std::make_shared<TestWasm>(
160+
newVm(), std::unordered_map<std::string, std::string>(), vm_ids[0], vm_configs[0], vm_key);
164161
return std::make_shared<WasmHandleBase>(base_wasm);
165162
};
166163

@@ -190,7 +187,9 @@ TEST_P(TestVm, AlwaysApplyCanary) {
190187
WasmHandleFactory wasm_handle_factory_comp =
191188
[this, vm_id,
192189
vm_config](std::string_view vm_key) -> std::shared_ptr<WasmHandleBase> {
193-
auto base_wasm = std::make_shared<TestWasm>(newVm(), vm_id, vm_config, vm_key);
190+
auto base_wasm = std::make_shared<TestWasm>(
191+
newVm(), std::unordered_map<std::string, std::string>(), vm_id, vm_config,
192+
vm_key);
194193
return std::make_shared<WasmHandleBase>(base_wasm);
195194
};
196195
const auto plugin_comp = std::make_shared<PluginBase>(
@@ -240,4 +239,4 @@ TEST_P(TestVm, AlwaysApplyCanary) {
240239
}
241240
}
242241

243-
} // namespace proxy_wasm
242+
} // namespace proxy_wasm

0 commit comments

Comments
 (0)