venom
venom copied to clipboard
Setting vars value with result of a step does not seem to evaluate
Hello, I'm using Version v1.1.0 and needed to use the feature documented in vars.yml test. It wasn't working for me in my test so I coped the test testcase and it also fails with the following
$ venom run vars.yml -vvvv
[trac] writing venom.12.log
• Variables testsuite (vars.yml)
• CreateService
• exec PASS
[trac] writing vars.CreateService.step.0.0.dump.json
• WriteServiceIdForNextTestSuites
• exec PASS
[trac] writing vars.WriteServiceIdForNextTestSuites.step.0.0.dump.json
• echo_myvar
• exec FAIL
Testcase "echo_myvar", step #0-0: Assertion "result.systemout ShouldContainSubstring foo" failed. expected '{{.myvar}}' to contain 'foo' but it wasn't (vars.yml:34)
[info] {{.myvar}} (vars.yml:30)
[trac] writing vars.echo_myvar.step.0.0.dump.json
final status: FAIL
What am I doing wrong and is there a way to work around this? I need to pass an ID from one step into bodyfile of a subsequent step which posts a JSON file which includes ID. I hoped to use the vars.yml test mechanism for this.
The feature works but the example seems broken. Can you share your test to see what you are doing wrong ?
My example was somewhat more specific version of vars.yml but even if it would work it would help. In the end what I was aiming at (out of scope of this issue I guess) was similar to tests/http_post_bodyfile.yaml in which my template file placeholders would be populated with values set after first step of the test.
@1am Have you tried version https://github.com/ovh/venom/releases/tag/v1.2.0-beta.4
New changes to vars
Just tried updating to 1.2.0-beta.4 and the result is the same: Testcase "echo_myvar", step #0-0: Assertion "result.systemout ShouldContainSubstring foo" failed. expected '{{.myvar}}' to contain 'foo' but it wasn't (vars.yml:34)
when running vars.yml
Hi @1am , can you provide a full reproducer please?
Hello @yesnault The full reproducer was an exact copy of vars.yml without any changes.