Skip to content

Fix --var propagation to dependency tests#11

Merged
desplega-bot merged 2 commits intomainfrom
fix/var-propagation-to-deps
Feb 24, 2026
Merged

Fix --var propagation to dependency tests#11
desplega-bot merged 2 commits intomainfrom
fix/var-propagation-to-deps

Conversation

@desplega-bot
Copy link
Contributor

Summary

  • Wire up the vars field on RunCliTestOptions that was added in commit 202db9f but never connected to the CLI's run command
  • When --var flags are passed, they are now sent as vars in the API request body alongside the embedded test definitions
  • This ensures the backend receives variable overrides at the request level, applying them as highest-priority overrides to ALL tests including dependencies

Context

When running qa-use test run <test> --var key=value where the test has dependencies, the --var values were only applied locally to test definitions via applyVariableOverrides before sending to the backend. While this works for locally-loaded dependencies, it doesn't cover:

  • Cloud tests run via --id (where test definitions aren't loaded locally)
  • Any scenario where the backend needs request-level variable overrides

Companion PR: desplega-ai/desplega.ai (adds vars field to RunCliTestRequest and applies it in both execution paths)

Test plan

  • Run qa-use test run <test-with-dep> --var key=value and verify vars appear in dependency execution
  • Run qa-use test run --id <uuid> --var key=value and verify vars are sent to backend
  • Verify existing --var behavior (without deps) still works

🤖 Generated with Claude Code

The vars field on RunCliTestOptions was added (commit 202db9f) but never
wired up in the test run command. This meant --var values were only applied
locally to test definitions via applyVariableOverrides but never sent to
the backend as request-level overrides.

Now --var values are sent as `vars` in the API request body, allowing the
backend to apply them as highest-priority overrides to all tests including
dependencies — even for cloud tests run via --id.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Feb 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
qa-use-mcp Ready Ready Preview, Comment Feb 24, 2026 4:22pm

Request Review

Add unit tests for the applyVariableOverrides function covering:
- Single test definition override
- Multi-definition override (dependencies included)
- Creating variables object when not present
- Adding new variables alongside existing ones
- Multiple overrides at once
- Empty overrides (no-op)
- Empty definitions array
- Chain of three dependencies

Also bump version 2.8.2 → 2.8.3.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@desplega-bot desplega-bot merged commit a3a429e into main Feb 24, 2026
4 checks passed
Copy link
Contributor Author

@desplega-bot desplega-bot left a comment

Choose a reason for hiding this comment

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

Review: ✅ LGTM

Clean, well-structured PR. The CLI-side changes correctly wire up --var propagation to the backend.

Positive notes

  • Defensive check: Object.keys(options.var).length > 0 ? options.var : undefined — sends undefined (omitted from JSON) when no vars, maintaining backward compatibility.
  • Version bump: 2.8.2 → 2.8.3 patch bump is appropriate for a bug fix.
  • Tests: Comprehensive tests for applyVariableOverrides covering single test, multiple with deps, missing variables object, adding new vars, multiple overrides, empty overrides, empty definitions, and a chain of 3 dependencies.

Note

The tests cover the local applyVariableOverrides function, not the new vars request body field directly. This is fine since the request-level behavior is tested on the backend side (PR #284).

No issues found on the CLI side.


🤖 Reviewed by Reviewer agent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants