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

1.0 release #495

Closed
michaelboulton opened this issue Dec 9, 2019 · 3 comments · Fixed by #332
Closed

1.0 release #495

michaelboulton opened this issue Dec 9, 2019 · 3 comments · Fixed by #332

Comments

@michaelboulton
Copy link
Member

michaelboulton commented Dec 9, 2019

Overdue by about 18 months, the version 1.0 of Tavern is coming out. This will
be a large collection of improvements (mainly internal) as well as some breaking changes.

All development as of the beginning of December 2019 will be done against the
feature/one-point-o branch and the master branch will only receive bug fixes.
The expected release date is January 2020 (possibly February as this is quite a
short amount of time to switch), but there is a 'alpha' version on
Pypi for people who want to switch now.

Minor new features

  • Add key to allow uploading the raw content of a file as a request body

  • Add new token which can match regex values in parts of responses

  • Strict key checking should now work with MQTT json payloads

Breaking changes

These changes have a chance of breaking some of your existing tests - they are
ordered roughly from most urgent to least urgent.

'body' key changes to 'json' in HTTP response

This is to maintain parity with the MQTT 'json' block as well as to signify that
it is only meant for checking JSON.

If your test was like this:

    response:
      status_code: 200
      body:
        abc: 123

It should now be:

    response:
      status_code: 200
      json:
        abc: 123

There should be no other effects from this change.

Python 2 dropped

Tavern will no longer support Python 2. There have been warnings from Tavern as
well as from Pip and other tools saying to upgrade to Python 3 for months now,
and with the dropping of official support of Python 2 Tavern will no longer
support it.

Changes to the way strictness works

'legacy' strict key checking (ie, strict key checking behaves differently for
the top level of a response) has been removed and it is now either on or off for
the whole response body.

Turning strictness 'off' will now also allow users to check that one item is
present in a list while ignoring the other items, a popular request.

More details in the
1.0 documentation

'null' checking on body

Before 1.0, any response body would be matched if null was specified in the
test response block. This has changed and null will now only match a JSON
null. To match anything in the response use !anything, or use one of the
other type tokens to match any list (!anylist), any string (!anystr), etc.

'run' entry point slightly reworked

The arguments to the run() function have changed so that any extra keyword
arguments will now raise an error rather than just warning. This is to bring it
more in line with the fact that it is just a thin layer over Pytest.

New error traceback is the default

The new 'fancy' error reporting is now the default when a Tavern error occurs (a
normal Python traceback is still shown for unexpected errors or bad schema
errors). This can be disabled by using the tavern-use-default-traceback flag
in your pytest config file or on the command line.

External function blocks changes

Rather than putting a magic $ext key into the block to add an extra function
to verify part of a response, the function should now go into the
verify_response_with block in the response block. $ext functions can still
be used in request blocks to insert extra data into the request however.

Save value path changes

When saving a value with the save block, the path to the thing to save should
now be given as a JMESpath rather than the 'old' style - ie, instead of a.b.0,
use a.b[0]

@michaelboulton
Copy link
Member Author

Pytest 5 will also be supported

@michaelboulton michaelboulton mentioned this issue Feb 1, 2020
Merged
@ghost
Copy link

ghost commented Mar 5, 2020

Do you already have an idea when v1.0 will be available? :)

michaelboulton added a commit that referenced this issue Apr 5, 2020
See #495 for details
@michaelboulton
Copy link
Member Author

Finally have access to a computer to get this done and in.

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.

1 participant