https://github.com/renatomefi/docker-testinfra
A simple docker image for testinfra
https://github.com/renatomefi/docker-testinfra
docker docker-image infrastructure infrastructure-testing pytest python testinfra
Last synced: about 1 year ago
JSON representation
A simple docker image for testinfra
- Host: GitHub
- URL: https://github.com/renatomefi/docker-testinfra
- Owner: renatomefi
- License: mit
- Created: 2018-08-13T18:23:59.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2020-06-30T09:11:23.000Z (almost 6 years ago)
- Last Synced: 2025-04-02T22:08:16.589Z (about 1 year ago)
- Topics: docker, docker-image, infrastructure, infrastructure-testing, pytest, python, testinfra
- Language: Makefile
- Homepage: https://hub.docker.com/r/renatomefi/docker-testinfra/
- Size: 56.6 KB
- Stars: 9
- Watchers: 2
- Forks: 3
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# A testinfra Docker container
[](https://circleci.com/gh/renatomefi/docker-testinfra)
[](https://hub.docker.com/r/renatomefi/docker-testinfra/)
[](https://hub.docker.com/r/renatomefi/docker-testinfra/)
This image helps you run [testinfra](https://testinfra.readthedocs.io/en/latest/) supporting both docker and ssh plugins
[](https://hub.docker.com/r/renatomefi/docker-testinfra)
## Running the image
Considering your tests are under `./tests`
```sh
docker run --rm -t \
-v "$(pwd)/tests:/tests" \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
renatomefi/docker-testinfra:2 \
--verbose --hosts='docker://CONTAINER_NAME_OR_ID'
```
Everything on the last line are py.test and infratest parameters, see more at https://testinfra.readthedocs.io/en/latest/invocation.html
This images simply provides an entrypoint to `py.test` with a few parameters to supress caching.
## Tags and versions
You use more to less specific versions for instance:
- `renatomefi/docker-testinfra:3`
- `renatomefi/docker-testinfra:3.2`
- `renatomefi/docker-testinfra:3.2.0`
- `renatomefi/docker-testinfra:2`
- `renatomefi/docker-testinfra:2.0`
- `renatomefi/docker-testinfra:2.0.0`
- `renatomefi/docker-testinfra:1`
- `renatomefi/docker-testinfra:1.19`
- `renatomefi/docker-testinfra:1.19.0`
When `2.1` is released for instance, the new major `2` will become `2.1`, this way you can always be up-to-date with the desired major.
### Python version
Testinfra version `2` is only offered with Python 3.
Testinfra version `1` is oferred with Python 2 by default and Python 3 optionally by appending `python3` to its tag. (This is only valid for 1.19+)
- `renatomefi/docker-testinfra:1-python3`
- `renatomefi/docker-testinfra:1.19-python3`
- `renatomefi/docker-testinfra:1.19.0-python3`
## testinfra and Docker
https://testinfra.readthedocs.io/en/latest/backends.html#docker