Skip to content

Commit fd80b91

Browse files
committed
fix tests not running on CI
1 parent 2541d8f commit fd80b91

File tree

4 files changed

+37
-2
lines changed

4 files changed

+37
-2
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ jobs:
2929
key: ${{runner.os}}-bazel-cache
3030
- uses: actions/checkout@v3
3131
- run: bazel test --config=ci //...
32-
- run: cd tests
3332
- run: bazel test --config=ci //...
33+
workspace-directory: tests
3434

3535
test-linux:
3636
runs-on: ubuntu-latest
@@ -43,8 +43,8 @@ jobs:
4343
key: ${{runner.os}}-bazel-cache
4444
- uses: actions/checkout@v3
4545
- run: bazel test --config=ci //...
46-
- run: cd tests
4746
- run: bazel test --config=ci //...
47+
workspace-directory: tests
4848

4949
check-module-headers:
5050
runs-on: ubuntu-latest

reference/async_reference/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ cc_library(
1414
srcs = ["async_reference.cc"],
1515
hdrs = ["async_reference.hh"],
1616
copts = copts,
17+
linkstatic = True,
1718
visibility = ["//visibility:public"],
1819
deps = [
1920
"//:async",

tests/WORKSPACE.bazel

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,27 @@ http_archive(
8686
load("@hedron_compile_commands//:workspace_setup.bzl", "hedron_compile_commands_setup")
8787

8888
hedron_compile_commands_setup()
89+
90+
http_archive(
91+
name = "com_grail_bazel_toolchain",
92+
sha256 = "3cf5ac4bb7dae3776da586fe85685274f5d89cbb59436f50f572928354e72198",
93+
strip_prefix = "bazel-toolchain-70a0fb556662fe3cadb07da32c91e232eb0d883d",
94+
url = "https://github.com/grailbio/bazel-toolchain/archive/70a0fb556662fe3cadb07da32c91e232eb0d883d.zip",
95+
)
96+
97+
load("@com_grail_bazel_toolchain//toolchain:deps.bzl", "bazel_toolchain_dependencies")
98+
99+
bazel_toolchain_dependencies()
100+
101+
load("@com_grail_bazel_toolchain//toolchain:rules.bzl", "llvm_toolchain")
102+
103+
llvm_toolchain(
104+
name = "llvm_toolchain",
105+
cxx_standard = {"linux": "c++20"},
106+
distribution = "clang+llvm-15.0.6-x86_64-linux-gnu-ubuntu-18.04.tar.xz",
107+
llvm_version = "15.0.6",
108+
)
109+
110+
load("@llvm_toolchain//:toolchains.bzl", "llvm_register_toolchains")
111+
112+
llvm_register_toolchains()

tests/async/async_ref_test.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@ void assert_time_past(
3838
ASSERT_LT(time, time_to_assert);
3939
}
4040

41+
void assert_never_error(
42+
ecsact_async_error async_err,
43+
int request_ids_length,
44+
ecsact_async_request_id* request_ids,
45+
void* callback_user_data
46+
) {
47+
ASSERT_TRUE(false) << "Unexpected Ecsact Async Error";
48+
}
49+
4150
TEST(AsyncRef, ConnectBad) {
4251
auto connect_req_id = ecsact_async_connect("bad");
4352

@@ -486,6 +495,7 @@ TEST(AsyncRef, TryAction) {
486495
ecsact_async_events_collector entity_async_evc{};
487496
entity_async_evc.async_entity_callback = entity_cb;
488497
entity_async_evc.async_entity_callback_user_data = &cb_info;
498+
entity_async_evc.async_error_callback = &assert_never_error;
489499

490500
auto start_tick = ecsact_async_get_current_tick();
491501
while(cb_info.wait != true) {

0 commit comments

Comments
 (0)