Skip to content

Commit 359b646

Browse files
authored
chore(dev): fix top tests features and run them on CI (#24677)
* chore(dev): fix top tests features and run them on CI * add PR comment CI trigger * fix features * upload_test_results: true * fix bad rebase
1 parent 9465cec commit 359b646

File tree

9 files changed

+35
-5
lines changed

9 files changed

+35
-5
lines changed

.github/workflows/ci-review-trigger.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#
1212
# /ci-run-all : runs all of the below
1313
# /ci-run-cli : runs CLI - Linux
14+
# /ci-run-test-top : runs make test-top
1415
# /ci-run-test-behavior : runs make test-behavior
1516
# /ci-run-check-examples : runs make check-examples
1617
# /ci-run-test-docs : runs make test-docs
@@ -55,6 +56,7 @@ jobs:
5556
if: |
5657
startsWith(github.event.review.body, '/ci-run-all')
5758
|| startsWith(github.event.review.body, '/ci-run-cli')
59+
|| startsWith(github.event.review.body, '/ci-run-test-top')
5860
|| startsWith(github.event.review.body, '/ci-run-test-behavior')
5961
|| startsWith(github.event.review.body, '/ci-run-check-examples')
6062
|| startsWith(github.event.review.body, '/ci-run-test-docs')
@@ -93,6 +95,16 @@ jobs:
9395
job_name: CLI tests
9496
secrets: inherit
9597

98+
make-test-top:
99+
needs: validate
100+
if: startsWith(github.event.review.body, '/ci-run-all') || contains(github.event.review.body, '/ci-run-test-top')
101+
uses: ./.github/workflows/test-make-command.yml
102+
with:
103+
ref: ${{ github.event.review.commit_id }}
104+
command: test-top
105+
job_name: make test-top
106+
secrets: inherit
107+
96108
make-test-behavior:
97109
needs: validate
98110
if: startsWith(github.event.review.body, '/ci-run-all') || contains(github.event.review.body, '/ci-run-test-behavior')

.github/workflows/master_merge_queue.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,16 @@ jobs:
5656
needs: changes
5757
secrets: inherit
5858

59+
test-top:
60+
if: ${{ needs.changes.outputs.source == 'true' || needs.changes.outputs.test-make-command-yml == 'true' }}
61+
uses: ./.github/workflows/test-make-command.yml
62+
with:
63+
command: test-top
64+
job_name: make test-top
65+
upload_test_results: true
66+
needs: changes
67+
secrets: inherit
68+
5969
make-test-behavior:
6070
if: ${{ needs.changes.outputs.source == 'true' || needs.changes.outputs.test-make-command-yml == 'true' }}
6171
uses: ./.github/workflows/test-make-command.yml
@@ -126,6 +136,7 @@ jobs:
126136
needs:
127137
- changes
128138
- test-cli
139+
- test-top
129140
- make-test-behavior
130141
- make-check-examples
131142
- make-test-docs

Cargo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ path = "tests/integration/lib.rs"
4141
name = "e2e"
4242
path = "tests/e2e/mod.rs"
4343

44+
[[test]]
45+
name = "top"
46+
path = "tests/top/lib.rs"
47+
required-features = ["top-tests"]
48+
4449
# CI-based builds use full release optimization. See scripts/environment/release-flags.sh.
4550
# This results in roughly a 5% reduction in performance when compiling locally vs when
4651
# compiled via the CI pipeline.
@@ -943,6 +948,7 @@ all-integration-tests = [
943948
"pulsar-integration-tests",
944949
"redis-integration-tests",
945950
"splunk-integration-tests",
951+
"top-tests",
946952
"webhdfs-integration-tests",
947953
]
948954

@@ -1010,6 +1016,7 @@ pulsar-integration-tests = ["sinks-pulsar", "sources-pulsar"]
10101016
redis-integration-tests = ["sinks-redis", "sources-redis"]
10111017
splunk-integration-tests = ["sinks-splunk_hec"]
10121018
dnstap-integration-tests = ["sources-dnstap", "dep:bollard"]
1019+
top-tests = ["top", "api", "sources-demo_logs", "sinks-blackhole"]
10131020
webhdfs-integration-tests = ["sinks-webhdfs"]
10141021
disable-resolv-conf = []
10151022
shutdown-tests = ["api", "sinks-blackhole", "sinks-console", "sinks-prometheus", "sources", "transforms-lua", "transforms-remap", "unix"]

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,9 +406,13 @@ test-e2e-kubernetes: ## Runs Kubernetes E2E tests (Sorry, no `ENVIRONMENT=true`
406406
test-cli: ## Runs cli tests
407407
${MAYBE_ENVIRONMENT_EXEC} cargo nextest run --no-fail-fast --no-default-features --features cli-tests --test integration --test-threads 4
408408

409+
.PHONY: test-top
410+
test-top: ## Runs top tests
411+
${MAYBE_ENVIRONMENT_EXEC} cargo nextest run --no-fail-fast --no-default-features --features top-tests --test top --test-threads 4
412+
409413
.PHONY: test-component-validation
410414
test-component-validation: ## Runs component validation tests
411-
${MAYBE_ENVIRONMENT_EXEC} cargo nextest run --no-fail-fast --no-default-features --features component-validation-tests --status-level pass --test-threads 4 components::validation::tests
415+
${MAYBE_ENVIRONMENT_EXEC} cargo nextest run --no-fail-fast --no-default-features --features component-validation-tests --status-level pass --test-threads 4 --lib components::validation::tests
412416

413417
##@ Benching (Supports `ENVIRONMENT=true`)
414418

tests/integration/lib.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ mod cli;
1212
#[cfg(feature = "shutdown-tests")]
1313
mod shutdown;
1414

15-
// Top tests use Unix signals (SIGTERM, SIGHUP) via the nix crate
16-
#[cfg(all(feature = "top", target_family = "unix"))]
17-
mod top;
18-
1915
/// Creates a file with given content
2016
pub fn create_file(config: &str) -> PathBuf {
2117
let path = temp_file();

0 commit comments

Comments
 (0)