{"record":{"id":"d8c69040a8788516","repo":"vectordotdev/vector","slug":"test-name-is-required-show","errorCode":null,"errorMessage":"test name is required","messagePattern":"test name is required","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"vdev/src/commands/integration/show.rs","lineNumber":24,"sourceCode":"use clap::Args;\n\n/// Show information about integrations\n#[derive(Args, Debug)]\n#[command()]\npub struct Cli {\n    /// The desired integration\n    integration: Option<String>,\n\n    /// Show only the available environments (newline separated)\n    #[arg(short = 'e', long)]\n    environments_only: bool,\n}\n\nimpl Cli {\n    pub fn exec(self) -> Result<()> {\n        if self.environments_only {\n            exec_environments_only(\n                &self.integration.expect(\"test name is required\"),\n                INTEGRATION_TESTS_DIR,\n            )\n        } else {\n            exec(self.integration.as_ref(), INTEGRATION_TESTS_DIR)\n        }\n    }\n}\n","sourceCodeStart":6,"sourceCodeEnd":32,"githubUrl":"https://github.com/vectordotdev/vector/blob/bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013/vdev/src/commands/integration/show.rs#L6-L32","documentation":"Same guard as the e2e variant, for `vdev integration show`: with --environments-only, the integration name is dereferenced via self.integration.expect(\"test name is required\"). Omitting the integration argument while passing the flag panics instead of emitting a proper CLI usage error.","triggerScenarios":"Running `cargo vdev integration show --environments-only` (or `cargo vdev int show --environments-only`) with no integration name, leaving self.integration as None at the expect site.","commonSituations":"Omitting the positional argument in scripts or aliases; typo where the flag is given but the name is on the wrong side; assuming the flag lists all integrations' environments.","solutions":["Supply the integration name: `cargo vdev integration show <integration> --environments-only`.","Drop --environments-only and use the plain listing path (exec(self.integration.as_ref(), ...)) which handles a missing name.","Consult `cargo vdev int show --help` for correct usage.","In code, enforce via clap (required_unless_present / requires) or bail! with a clear message instead of expect."],"exampleFix":"// before\nexec_environments_only(\n    &self.integration.expect(\"test name is required\"),\n    INTEGRATION_TESTS_DIR,\n)\n// after\nexec_environments_only(\n    self.integration.as_ref().ok_or_else(|| anyhow!(\"integration name is required with --environments-only\"))?,\n    INTEGRATION_TESTS_DIR,\n)","handlingStrategy":"validation","validationCode":"# shell wrapper before invoking vdev\nif [ \"$1\" = \"--environments-only\" ] && [ -z \"$2\" ]; then\n  echo \"integration name is required with --environments-only\" >&2; exit 2\nfi","typeGuard":"fn require_integration_name(name: &Option<String>) -> Result<&String> {\n    name.as_ref().ok_or_else(|| anyhow!(\"integration name is required with --environments-only\"))\n}","tryCatchPattern":null,"preventionTips":["Supply the integration name whenever --environments-only is used.","Add clap metadata (requires/required_unless_present) so arg parsing rejects the combination before exec.","Check `cargo vdev int show --help` in CI scripts.","Prefer the plain show command when a listing is all that is needed."],"tags":["rust","vdev","cli","missing-argument","integration-tests","panic"],"backgroundTag":"missing-cli-argument","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"}