vectordotdev/vector · error
test name is required
Error message
test name is required
What it means
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.
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.
Example fix
// before
exec_environments_only(
&self.integration.expect("test name is required"),
INTEGRATION_TESTS_DIR,
)
// after
exec_environments_only(
self.integration.as_ref().ok_or_else(|| anyhow!("integration name is required with --environments-only"))?,
INTEGRATION_TESTS_DIR,
) Defensive patterns
Strategy: validation
Validate before calling
# shell wrapper before invoking vdev if [ "$1" = "--environments-only" ] && [ -z "$2" ]; then echo "integration name is required with --environments-only" >&2; exit 2 fi
Type guard
fn require_integration_name(name: &Option<String>) -> Result<&String> {
name.as_ref().ok_or_else(|| anyhow!("integration name is required with --environments-only"))
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: "no subcommand specified" and "... is required": CLI errors when a required argument is missing — this error's family across 13 libraries.
Related errors
- test name is required
- Integration has no environments
- Invalid config file name
- Failed to get metadata for
- Invalid value in $DOCKER_HOST
AI-assisted analysis of vectordotdev/vector@bdb87aeaa4 (2026-09-16).
Data as JSON: /api/errors/d8c69040a8788516.
Report an issue: GitHub.
Appendix: source
Thrown at vdev/src/commands/integration/show.rs:24
use clap::Args;
/// Show information about integrations
#[derive(Args, Debug)]
#[command()]
pub struct Cli {
/// The desired integration
integration: Option<String>,
/// Show only the available environments (newline separated)
#[arg(short = 'e', long)]
environments_only: bool,
}
impl Cli {
pub fn exec(self) -> Result<()> {
if self.environments_only {
exec_environments_only(
&self.integration.expect("test name is required"),
INTEGRATION_TESTS_DIR,
)
} else {
exec(self.integration.as_ref(), INTEGRATION_TESTS_DIR)
}
}
}
View on GitHub (pinned to bdb87aeaa4)