Skip to content

buttahtoast/docker-tavern

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker Tavern

License Build Status

Tavern is an advanced pytest based API testing framework for HTTP, MQTT or other protocols. This Repository implements a Docker Image containg tavern.

Vist Tavern's website to learn more:

Running tavern

Simply map your tavern suites into the tavern container:

$ docker run -v ./tavern-tests:/tavern -it buttahtoast/docker-tavern:latest

Supported Tags: https://hub.docker.com/repository/docker/buttahtoast/docker-tavern/tags

Configuration

The configuration for this tavern Docker image is made via Environment variables and is kept as simple as possible.

Environment Variable Description Default
TEST_DIRECTORY Directory which holds all the tavern test suites. which should executed. Make sure the tavern user has access to the directory and all it's files. /tavern/
DEBUG Enables logging on DEBUG level false
LOG_TO_FILE Log to a specific file instead of logging to stdout. Value holds the file which will be logged to. -

Permissions

When you are getting the following errors, you might have a problem with the permissions on your mounted directories.

../home/tavern/.local/lib/python3.9/site-packages/_pytest/stepwise.py:122
  /home/tavern/.local/lib/python3.9/site-packages/_pytest/stepwise.py:122: PytestCacheWarning: cache could not write path /tavern/.pytest_cache/v/cache/stepwise
    self.config.cache.set("cache/stepwise", [])

../home/tavern/.local/lib/python3.9/site-packages/_pytest/cacheprovider.py:403
  /home/tavern/.local/lib/python3.9/site-packages/_pytest/cacheprovider.py:403: PytestCacheWarning: cache could not write path /tavern/.pytest_cache/v/cache/nodeids
    config.cache.set("cache/nodeids", sorted(self.cached_nodeids))

../home/tavern/.local/lib/python3.9/site-packages/_pytest/cacheprovider.py:357
  /home/tavern/.local/lib/python3.9/site-packages/_pytest/cacheprovider.py:357: PytestCacheWarning: cache could not write path /tavern/.pytest_cache/v/cache/lastfailed
    config.cache.set("cache/lastfailed", self.lastfailed)

Make Sure to User ID owns both mounted directories:

sudo chown -R 1500:1500 ~/scripts
sudo chown -R 1500:1500 ~/tests

And then try to rerun it:

sudo docker run -v ~/scripts/:/scripts -v ~/tests/:/tavern tavern:latest

Contributing

We'd love to have you contribute! Please refer to our contribution guidelines for details.

By making a contribution to this project, you agree to and comply with the Developer's Certificate of Origin.