Fix --var propagation to dependency tests#11
Merged
desplega-bot merged 2 commits intomainfrom Feb 24, 2026
Merged
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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>
tarasyarema
approved these changes
Feb 24, 2026
desplega-bot
commented
Feb 24, 2026
Contributor
Author
desplega-bot
left a comment
There was a problem hiding this comment.
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— sendsundefined(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
applyVariableOverridescovering 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
varsfield onRunCliTestOptionsthat was added in commit 202db9f but never connected to the CLI'sruncommand--varflags are passed, they are now sent asvarsin the API request body alongside the embedded test definitionsContext
When running
qa-use test run <test> --var key=valuewhere the test has dependencies, the--varvalues were only applied locally to test definitions viaapplyVariableOverridesbefore sending to the backend. While this works for locally-loaded dependencies, it doesn't cover:--id(where test definitions aren't loaded locally)Companion PR: desplega-ai/desplega.ai (adds
varsfield toRunCliTestRequestand applies it in both execution paths)Test plan
qa-use test run <test-with-dep> --var key=valueand verify vars appear in dependency executionqa-use test run --id <uuid> --var key=valueand verify vars are sent to backend--varbehavior (without deps) still works🤖 Generated with Claude Code