diff --git a/nextest-runner/src/errors.rs b/nextest-runner/src/errors.rs index c7e30427616..0c555ffb5b0 100644 --- a/nextest-runner/src/errors.rs +++ b/nextest-runner/src/errors.rs @@ -454,11 +454,11 @@ impl fmt::Display for PartitionerBuilderParseError { } } -/// An error that occures while operating on a +/// An error that occurs while operating on a /// [`TestFilterBuilder`](crate::test_filter::TestFilterBuilder). #[derive(Clone, Debug, Error)] pub enum TestFilterBuilderError { - /// An error that occured while constructing test filters. + /// An error that occurred while constructing test filters. #[error("error constructing test filters")] Construct { /// The underlying error. diff --git a/nextest-runner/tests/integration/basic.rs b/nextest-runner/tests/integration/basic.rs index d5ccac0ad6c..45d74be4946 100644 --- a/nextest-runner/tests/integration/basic.rs +++ b/nextest-runner/tests/integration/basic.rs @@ -51,7 +51,7 @@ fn test_list_tests() -> Result<()> { set_env_vars(); let test_filter = TestFilterBuilder::any(RunIgnored::Default); - let test_list = FIXTURE_TARGETS.make_test_list(&test_filter, &TargetRunner::empty()); + let test_list = FIXTURE_TARGETS.make_test_list(&test_filter, &TargetRunner::empty())?; let mut summary = test_list.to_summary(); for (name, expected) in &*EXPECTED_TESTS { @@ -90,7 +90,7 @@ fn test_run() -> Result<()> { set_env_vars(); let test_filter = TestFilterBuilder::any(RunIgnored::Default); - let test_list = FIXTURE_TARGETS.make_test_list(&test_filter, &TargetRunner::empty()); + let test_list = FIXTURE_TARGETS.make_test_list(&test_filter, &TargetRunner::empty())?; let config = load_config(); let profile = config .profile(NextestConfig::DEFAULT_PROFILE) @@ -198,7 +198,7 @@ fn test_run_ignored() -> Result<()> { vec![expr], ) .unwrap(); - let test_list = FIXTURE_TARGETS.make_test_list(&test_filter, &TargetRunner::empty()); + let test_list = FIXTURE_TARGETS.make_test_list(&test_filter, &TargetRunner::empty())?; let config = load_config(); let profile = config .profile(NextestConfig::DEFAULT_PROFILE) @@ -275,7 +275,7 @@ fn test_filter_expr_with_string_filters() -> Result<()> { vec![expr], ) .unwrap(); - let test_list = FIXTURE_TARGETS.make_test_list(&test_filter, &TargetRunner::empty()); + let test_list = FIXTURE_TARGETS.make_test_list(&test_filter, &TargetRunner::empty())?; for test in test_list.iter_tests() { if test.name == "tests::call_dylib_add_two" { assert!( @@ -334,7 +334,7 @@ fn test_filter_expr_without_string_filters() -> Result<()> { let test_filter = TestFilterBuilder::new(RunIgnored::Default, None, Vec::::new(), vec![expr]) .unwrap(); - let test_list = FIXTURE_TARGETS.make_test_list(&test_filter, &TargetRunner::empty()); + let test_list = FIXTURE_TARGETS.make_test_list(&test_filter, &TargetRunner::empty())?; for test in test_list.iter_tests() { if test.name.contains("test_multiply_two") || test.name == "tests::call_dylib_add_two" { assert!( @@ -363,7 +363,7 @@ fn test_string_filters_without_filter_expr() -> Result<()> { vec![], ) .unwrap(); - let test_list = FIXTURE_TARGETS.make_test_list(&test_filter, &TargetRunner::empty()); + let test_list = FIXTURE_TARGETS.make_test_list(&test_filter, &TargetRunner::empty())?; for test in test_list.iter_tests() { if test.name.contains("test_multiply_two") || test.name.contains("tests::call_dylib_add_two") @@ -395,7 +395,7 @@ fn test_retries(retries: Option) -> Result<()> { set_env_vars(); let test_filter = TestFilterBuilder::any(RunIgnored::Default); - let test_list = FIXTURE_TARGETS.make_test_list(&test_filter, &TargetRunner::empty()); + let test_list = FIXTURE_TARGETS.make_test_list(&test_filter, &TargetRunner::empty())?; let config = load_config(); let profile = config .profile("with-retries") @@ -544,7 +544,7 @@ fn test_termination() -> Result<()> { ) .unwrap(); - let test_list = FIXTURE_TARGETS.make_test_list(&test_filter, &TargetRunner::empty()); + let test_list = FIXTURE_TARGETS.make_test_list(&test_filter, &TargetRunner::empty())?; let config = load_config(); let profile = config .profile("with-termination") diff --git a/nextest-runner/tests/integration/fixtures.rs b/nextest-runner/tests/integration/fixtures.rs index 84e6c2e40c2..76ec4032b77 100644 --- a/nextest-runner/tests/integration/fixtures.rs +++ b/nextest-runner/tests/integration/fixtures.rs @@ -2,6 +2,7 @@ // SPDX-License-Identifier: MIT OR Apache-2.0 use camino::{Utf8Path, Utf8PathBuf}; +use color_eyre::eyre::{Context, Result}; use duct::cmd; use guppy::{graph::PackageGraph, MetadataCommand}; use maplit::{btreemap, btreeset}; @@ -363,7 +364,7 @@ impl FixtureTargets { &self, test_filter: &TestFilterBuilder, target_runner: &TargetRunner, - ) -> TestList<'_> { + ) -> Result> { let test_bins: Vec<_> = self.test_artifacts.values().cloned().collect(); let double_spawn = DoubleSpawnInfo::disabled(); let ctx = TestExecuteContext { @@ -380,7 +381,7 @@ impl FixtureTargets { self.env.to_owned(), get_num_cpus(), ) - .expect("test list successfully created") + .context("Failed to make test list") } } diff --git a/nextest-runner/tests/integration/target_runner.rs b/nextest-runner/tests/integration/target_runner.rs index 3eba81200c8..9cd0c01eff2 100644 --- a/nextest-runner/tests/integration/target_runner.rs +++ b/nextest-runner/tests/integration/target_runner.rs @@ -162,7 +162,7 @@ fn test_listing_with_target_runner() -> Result<()> { set_env_vars(); let test_filter = TestFilterBuilder::any(RunIgnored::Default); - let test_list = FIXTURE_TARGETS.make_test_list(&test_filter, &TargetRunner::empty()); + let test_list = FIXTURE_TARGETS.make_test_list(&test_filter, &TargetRunner::empty())?; let bin_count = test_list.binary_count(); let test_count = test_list.test_count(); @@ -174,7 +174,7 @@ fn test_listing_with_target_runner() -> Result<()> { ); let (_, target_runner) = runner_for_target(None).unwrap(); - let test_list = FIXTURE_TARGETS.make_test_list(&test_filter, &target_runner); + let test_list = FIXTURE_TARGETS.make_test_list(&test_filter, &target_runner)?; assert_eq!(bin_count, test_list.binary_count()); assert_eq!(test_count, test_list.test_count()); @@ -207,7 +207,7 @@ fn test_run_with_target_runner() -> Result<()> { assert_eq!(passthrough_path(), runner.binary()); } - let test_list = FIXTURE_TARGETS.make_test_list(&test_filter, &target_runner); + let test_list = FIXTURE_TARGETS.make_test_list(&test_filter, &target_runner)?; let config = load_config(); let profile = config