Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variable in skip when on test #881

Closed
lvijnck opened this issue Sep 1, 2023 · 2 comments · Fixed by #884
Closed

Variable in skip when on test #881

lvijnck opened this issue Sep 1, 2023 · 2 comments · Fixed by #884

Comments

@lvijnck
Copy link
Contributor

lvijnck commented Sep 1, 2023

I was trying to do something along the lines of the following code snippet, i.e., conditionally disable a step of my test. This seems to not interpolate the vars.

test_name: Dummy

stages:
  - name: Model call without authentication header
    skip: !bool "{tavern.env_vars.SKIP}
    request:
       ...
@michaelboulton
Copy link
Member

Currently isn't very clear from the docs but just having skip in a stage will cause it to be skipped no matter what the value is. Adding interpolation would be something extra that would need to be added.

@michaelboulton
Copy link
Member

This is fixed with the caveat that any files that are included need to be in .yaml format (not json) and any possible format variables have the !raw tag before them, eg https://github.com/taverntesting/tavern/blob/9bdb1060017dae8a61048cbebf63c3fa6baf53e4/tests/integration/881_2.yaml . This is because it is an intended feature of Tavern that included files are normally formatted

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

Successfully merging a pull request may close this issue.

2 participants