An open API service indexing awesome lists of open source software.

https://github.com/buttahtoast/docker-tavern

Tavern Docker Image
https://github.com/buttahtoast/docker-tavern

container docker docker-tavern tavern

Last synced: 3 months ago
JSON representation

Tavern Docker Image

Awesome Lists containing this project

README

        

# Docker Tavern

[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Build Status](https://drone.buttahtoast.ch/api/badges/buttahtoast/docker-tavern/status.svg)](https://drone.buttahtoast.ch/buttahtoast/docker-tavern)

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:

* [https://tavern.readthedocs.io/en/latest/](https://tavern.readthedocs.io/en/latest/)

## 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](CONTRIBUTING.md) for details.

**By making a contribution to this project, you agree to and comply with the
[Developer's Certificate of Origin](https://developercertificate.org/).**