Add test for passing --var twice for the same arg (#2176)

This shows that passing two --var for the same arg is rejected
currently.
This commit is contained in:
Denis Bilenko 2025-01-17 14:40:19 +01:00 committed by GitHub
parent 89eb556318
commit 560c3d352e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,6 @@
bundle:
name: arg-repeat
variables:
a:
default: hello

View File

@ -0,0 +1,20 @@
>>> errcode $CLI bundle validate --var a=one -o json
Exit code: 0
{
"a": {
"default": "hello",
"value": "one"
}
}
>>> errcode $CLI bundle validate --var a=one --var a=two
Error: failed to assign two to a: variable has already been assigned value: one
Name: arg-repeat
Target: default
Found 1 error
Exit code: 1

View File

@ -0,0 +1,2 @@
trace errcode $CLI bundle validate --var a=one -o json | jq .variables
trace errcode $CLI bundle validate --var a=one --var a=two