Skip to content
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

chore: Try out nextest in CI #11692

Merged
merged 9 commits into from
Mar 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .config/nextest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[profile.default]
retries = 3
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ jobs:
- run: make test-cli
- run: make test-behavior
- run: make check-examples
- run: make test-docs
- name: Stop sccache
run: sccache --stop-server

Expand Down
8 changes: 0 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -816,44 +816,37 @@ enrichment-tables-benches = ["enrichment-tables-file"]
[[bench]]
name = "default"
harness = false
test = true
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dropped these because criterion doesn't play well with nextest yet: bheisler/criterion.rs#562

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am okay with this, considering that we'll pick these up with clippy.

required-features = ["benches"]

[[bench]]
name = "dnstap"
path = "benches/dnstap/mod.rs"
harness = false
test = true
required-features = ["dnstap-benches"]

[[bench]]
name = "remap"
harness = false
test = true
required-features = ["remap-benches"]

[[bench]]
name = "enrichment_tables_file"
harness = false
test = true
required-features = ["enrichment-tables-benches"]

[[bench]]
name = "languages"
harness = false
test = true
required-features = ["language-benches"]

[[bench]]
name = "loki"
harness = false
test = true
required-features = ["loki-benches"]

[[bench]]
name = "distribution_statistic"
harness = false
test = true
required-features = ["statistic-benches"]

[[bench]]
Expand All @@ -867,5 +860,4 @@ required-features = ["transform-benches"]
name = "codecs"
path = "benches/codecs/main.rs"
harness = false
test = false
required-features = ["codecs-benches"]
23 changes: 19 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -283,12 +283,27 @@ target/%/vector.tar.gz: target/%/vector CARGO_HANDLES_FRESHNESS

##@ Testing (Supports `ENVIRONMENT=true`)

# nextest doesn't support running doc tests yet so this is split out as
# `test-docs`
# https://github.com/nextest-rs/nextest/issues/16
#
# criterion doesn't support the flags needed by nextest to run so these are left
# out for now
# https://github.com/bheisler/criterion.rs/issues/562
#
# `cargo test` lacks support for testing _just_ benches otherwise we'd have
# a target for that
# https://github.com/rust-lang/cargo/issues/6454
.PHONY: test
test: ## Run the unit test suite
${MAYBE_ENVIRONMENT_EXEC} cargo test --workspace --no-fail-fast --no-default-features --features "${DEFAULT_FEATURES} metrics-benches codecs-benches language-benches remap-benches statistic-benches ${DNSTAP_BENCHES} benches" ${SCOPE}
${MAYBE_ENVIRONMENT_EXEC} cargo nextest run --workspace --no-fail-fast --no-default-features --features "${DEFAULT_FEATURES}" ${SCOPE}

.PHONY: test-docs
test-docs: ## Run the docs test suite
${MAYBE_ENVIRONMENT_EXEC} cargo test --doc --workspace --no-fail-fast --no-default-features --features "${DEFAULT_FEATURES}" ${SCOPE}

.PHONY: test-all
test-all: test test-behavior test-integration ## Runs all tests, unit, behaviorial, and integration.
test-all: test test-docs test-behavior test-integration ## Runs all tests: unit, docs, behaviorial, and integration.

.PHONY: test-x86_64-unknown-linux-gnu
test-x86_64-unknown-linux-gnu: cross-test-x86_64-unknown-linux-gnu ## Runs unit tests on the x86_64-unknown-linux-gnu triple
Expand Down Expand Up @@ -330,7 +345,7 @@ ifeq ($(AUTOSPAWN), true)
@scripts/setup_integration_env.sh nats start
sleep 10 # Many services are very slow... Give them a sec..
endif
${MAYBE_ENVIRONMENT_EXEC} cargo test --no-fail-fast --no-default-features --features nats-integration-tests --lib ::nats::
${MAYBE_ENVIRONMENT_EXEC} cargo nextest run --no-fail-fast --no-default-features --features nats-integration-tests --lib ::nats::
ifeq ($(AUTODESPAWN), true)
@scripts/setup_integration_env.sh nats stop
endif
Expand Down Expand Up @@ -369,7 +384,7 @@ test-shutdown-cleanup:

.PHONY: test-cli
test-cli: ## Runs cli tests
${MAYBE_ENVIRONMENT_EXEC} cargo test --no-fail-fast --no-default-features --features cli-tests --test cli -- --test-threads 4
${MAYBE_ENVIRONMENT_EXEC} cargo nextest run --no-fail-fast --no-default-features --features cli-tests --test cli --test-threads 4

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

Expand Down
1 change: 0 additions & 1 deletion lib/file-source/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,3 @@ pretty_assertions = "1.1.0"
[[bench]]
name = "buffer"
harness = false
test = true
1 change: 0 additions & 1 deletion lib/tracing-limit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,3 @@ tracing-subscriber = { version = "0.3.9", default-features = false, features = [
[[bench]]
name = "limit"
harness = false
test = true
1 change: 0 additions & 1 deletion lib/vrl/compiler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ vector_common = { path = "../../vector-common", default-features = false, featur
[[bench]]
name = "kind"
harness = false
test = true

[features]
test = []
1 change: 0 additions & 1 deletion lib/vrl/stdlib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -303,5 +303,4 @@ bench = false
[[bench]]
name = "benches"
harness = false
test = true
required-features = ["default"]
1 change: 0 additions & 1 deletion lib/vrl/vrl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,3 @@ vrl-stdlib = { path = "../stdlib" }
[[bench]]
name = "vm"
harness = false
test = true
2 changes: 2 additions & 0 deletions scripts/environment/bootstrap-windows-2019.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ if ($env:CI -ne $null) {
} else {
$env:Path += ";$HOME\.cargo\bin"
}

rustup run stable cargo install cargo-nextest --version 0.9.8
1 change: 1 addition & 0 deletions scripts/environment/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ rustup show # causes installation of version from rust-toolchain.toml
rustup default "$(rustup show active-toolchain | awk '{print $1;}')"
rustup run stable cargo install cargo-deb --version 1.29.2
rustup run stable cargo install cross --version 0.2.1
rustup run stable cargo install cargo-nextest --version 0.9.8

cd scripts
bundle install
Expand Down