{"record":{"id":"65996e6ccf075a06","repo":"vectordotdev/vector","slug":"no-environments-found-for-test-test-name","errorCode":null,"errorMessage":"No environments found for test '{test_name}'","messagePattern":"No environments found for test '(.+?)'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"vdev/src/commands/compose_tests/run.rs","lineNumber":37,"sourceCode":"/// 4. Upload results to Datadog (in CI)\n/// 5. Stop the environment (always, as cleanup)\npub fn exec(\n    local_config: ComposeTestLocalConfig,\n    test_name: &str,\n    environments: &[String],\n    retries: u8,\n    coverage: bool,\n    always_show_logs: bool,\n) -> Result<()> {\n    let resolved_envs: Vec<String> = if environments.is_empty() {\n        let (_test_dir, config) = ComposeTestConfig::load(local_config.directory, test_name)?;\n        config.environments().keys().cloned().collect()\n    } else {\n        environments.to_vec()\n    };\n\n    if resolved_envs.is_empty() {\n        anyhow::bail!(\"No environments found for test '{test_name}'\");\n    }\n\n    if coverage {\n        super::test::clear_coverage();\n    }\n\n    let mut covered_environments = Vec::new();\n    for environment in &resolved_envs {\n        info!(\"Running test '{test_name}' in environment '{environment}'\");\n\n        cleanup_test_output(test_name)?;\n\n        let start_result = super::start::exec(local_config, test_name, Some(environment));\n\n        if let Err(ref e) = start_result {\n            error!(\"Failed to start environment: {e}\");\n            print_compose_logs(local_config, test_name, environment);\n        }","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/vectordotdev/vector/blob/bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013/vdev/src/commands/compose_tests/run.rs#L19-L55","documentation":"This error is thrown by `cargo vdev compose_tests run` (exec) when, after resolving which integration-test environments to use, the resulting set is empty. Vector's integration tests run per-environment (e.g. docker compose profiles per cloud), so running with zero environments is meaningless and is rejected up front with anyhow::bail!.","triggerScenarios":"Running `cargo vdev compose_tests run --test <name>` with an explicit `--environment` list that is empty, or with no environments passed and `config.environments()` returning no keys for the resolved configuration.","commonSituations":"Developers hit this when the vdev local config defines no integration environments, when a typo'd or new test has no environments registered, or when running in a fresh clone where the integration environment config has not been set up.","solutions":["Add the environments to run via the command's environment flag (e.g. pass environment names explicitly).","Check the vdev local config (config.environments()) and populate it with the environments you want.","Verify the test name is correct; a test with no registered environments cannot run.","Run `cargo vdev int show` to list available integrations/environments first."],"exampleFix":"// before\ncargo vdev compose_tests run --test aws_cloudwatch\n// after (explicit environments)\ncargo vdev compose_tests run --test aws_cloudwatch --environment aws-integration-tests","handlingStrategy":"validation","validationCode":"let resolved: Vec<_> = if environments.is_empty() { config.environments().keys().cloned().collect() } else { environments.to_vec() };\nif resolved.is_empty() { eprintln!(\"No environments to run for test '{test_name}'\"); return; }","typeGuard":"fn has_environments(envs: &[String], config: &Config) -> bool { !envs.is_empty() || !config.environments().is_empty() }","tryCatchPattern":"match result { Err(e) if e.to_string().contains(\"No environments found\") => { eprintln!(\"Configure environments first: see `cargo vdev int show`\"); } Err(e) => return Err(e), Ok(v) => v }","preventionTips":["Run `cargo vdev int show` before composing tests to confirm environments exist","Keep config.environments() populated in your local vdev config","Always pass explicit environment names when scripting compose_tests run"],"tags":["cli","testing","configuration"],"backgroundTag":"empty-required-field","analyzedSha":"bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013","analyzedAt":"2026-09-16T02:53:35.741Z","contentChangedAt":"2026-09-16T02:53:35.741Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}