1
0
Fork 0
mirror of https://github.com/nginx-proxy/nginx-proxy synced 2024-06-02 12:56:24 +02:00
nginx-proxy/test/requirements
dependabot[bot] 1cc3bbf5ce
chore(deps): bump pytest from 7.0.1 to 7.1.1 in /test/requirements
Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.0.1 to 7.1.1.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/7.0.1...7.1.1)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-18 04:16:58 +00:00
..
web chore(ci): ♻️ convert Python old `%` string to f-strings 2021-04-27 00:35:20 +02:00
Dockerfile-nginx-proxy-tester fix: Properly detect pytest running via container 2021-12-31 21:42:38 +13:00
README.md docs: update "how to install/test" parts 2021-04-27 00:35:21 +02:00
python-requirements.txt chore(deps): bump pytest from 7.0.1 to 7.1.1 in /test/requirements 2022-03-18 04:16:58 +00:00

This directory contains resources to build Docker images tests depend on

Build images

make build-webserver

python-requirements.txt

If you want to run the test suite from your computer, you need python and a few python modules. The python-requirements.txt file describes the python modules required. To install them, use pip:

pip install -r python-requirements.txt

If you don't want to run the test from your computer, you can run the tests from a docker container, see the pytest.sh script.

Images

web

This container will run one or many webservers, each of them listening on a single port.

Ports are specified using the WEB_PORTS environment variable:

docker run -d -e WEB_PORTS=80 web  # will create a container running one webserver listening on port 80
docker run -d -e WEB_PORTS="80 81" web  # will create a container running two webservers, one listening on port 80 and a second one listening on port 81

The webserver answers on two paths:

  • /headers
  • /port
$ docker run -d -e WEB_PORTS=80 -p 80:80 web
$ curl http://127.0.0.1:80/headers
Host: 127.0.0.1
User-Agent: curl/7.47.0
Accept: */*

$ curl http://127.0.0.1:80/port
answer from port 80

nginx-proxy-tester

This is an optional requirement which is usefull if you cannot (or don't want to) install pytest and its requirements on your computer. In this case, you can use the nginx-proxy-tester docker image to run the test suite from a Docker container.

To use this image, it is mandatory to run the container using the pytest.sh shell script. The script will build the image and run a container from it with the appropriate volumes and settings.