Code Monkey home page Code Monkey logo

docker-tavern's Introduction

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.