Skip to content

Commit 1aac2f5

Browse files
committed
test: execute CIT with Bazel
Created bazel targets for component integration tests. Groupped them under one test suite.
1 parent 82ba94e commit 1aac2f5

File tree

3 files changed

+67
-6
lines changed

3 files changed

+67
-6
lines changed

src/rust/rust_kvs/BUILD

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,68 @@ load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_library", "rust_test")
1515

1616
rust_library(
1717
name = "rust_kvs",
18-
srcs = ["src/lib.rs"],
18+
srcs = glob(["src/**/*.rs"]),
1919
visibility = ["//visibility:public"],
2020
deps = all_crate_deps(
2121
normal = True,
2222
),
23+
24+
)
25+
__cit_deps = [
26+
":rust_kvs",
27+
] + all_crate_deps(
28+
normal = True,
29+
normal_dev = True,
30+
)
31+
32+
rust_test(
33+
name = "cit_default_values",
34+
srcs = ["tests/cit_default_values.rs"],
35+
crate_root = "tests/cit_default_values.rs",
36+
deps = __cit_deps,
37+
tags = ["cit", "component_tests"],
38+
)
39+
40+
rust_test(
41+
name = "cit_multiple_kvs",
42+
srcs = ["tests/cit_multiple_kvs.rs"],
43+
crate_root = "tests/cit_multiple_kvs.rs",
44+
deps = __cit_deps,
45+
tags = ["cit", "component_tests"],
46+
)
47+
48+
rust_test(
49+
name = "cit_persistency",
50+
srcs = ["tests/common.rs", "tests/cit_persistency.rs"],
51+
crate_root = "tests/cit_persistency.rs",
52+
deps = __cit_deps,
53+
tags = ["cit", "component_tests"],
54+
)
55+
56+
rust_test(
57+
name = "cit_snapshots",
58+
srcs = ["tests/cit_snapshots.rs"],
59+
crate_root = "tests/cit_snapshots.rs",
60+
deps = __cit_deps,
61+
tags = ["cit", "component_tests"],
2362
)
63+
64+
rust_test(
65+
name = "cit_supported_datatypes",
66+
srcs = ["tests/common.rs", "tests/cit_supported_datatypes.rs"],
67+
crate_root = "tests/cit_supported_datatypes.rs",
68+
deps = __cit_deps,
69+
tags = ["cit", "component_tests"],
70+
)
71+
72+
73+
test_suite(
74+
name = "cit",
75+
tests = [
76+
":cit_default_values",
77+
":cit_multiple_kvs",
78+
":cit_persistency",
79+
":cit_snapshots",
80+
":cit_supported_datatypes",
81+
],
82+
)

src/rust/rust_kvs/tests/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,10 @@ SPDX-License-Identifier: Apache-2.0
2020
All tests are kept in separate files as the working directory is always
2121
changed. If there is more than one test in a file both tests are run in
2222
parallel and use the same working directory which will led to wrong results.
23+
24+
## Bazel instruction
25+
26+
In order to run all Component Integration Tests with Bazel there is a single Test Suite created, which can be executed with:
27+
```bash
28+
bazel test //src/rust/rust_kvs:cit
29+
```

src/rust/rust_kvs/tests/kvs_0_default.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)