1
0
mirror of https://github.com/thib8956/nginx-proxy synced 2025-08-23 16:01:57 +00:00
Commit Graph

53 Commits

Author SHA1 Message Date
Nicolas Duchon
0bb98ef415 test: simplify container readiness check 2025-05-24 14:43:35 +02:00
Nicolas Duchon
0479cb02a2 test: fix docker-gen flaky tests 2025-05-23 21:42:26 +02:00
Nicolas Duchon
4af3be397a test: wait for docker-gen container to be ready too 2025-05-23 21:33:11 +02:00
Niek
005b0bdd62 chore: fix whitespace 2025-03-10 09:53:52 +01:00
Niek
58e21618b4 tests: DockerComposer connect_to_network except
If running from a container host-network-mode test fail because we cannot connect to host network. This prevents the cleanup.
So make sure we always return network for later removal.

Explicitly return None for readability
2025-03-10 09:53:52 +01:00
Niek
545e9cebb6 tests: DockerComposer KeyboardInterrupt
make sure we teardown on KeyboardInterrupt
2025-03-10 09:53:51 +01:00
Niek
a6271639ad tests: DockerComposer contextmanager do not fail
Change pytest.fail to a logging error because pytest.fail makes DockerComposer ContextManager exit and no _down teardown is executed.
2025-03-10 09:53:51 +01:00
Niek
d87ee36909 tests: self._docker_compose_file typo 2025-03-10 09:53:51 +01:00
Niek
557069583d tests: DockerComposer contextmanager improvements
-Improve the DockerComposer contextmanager to make sure teardown happens by using try except block.
-Move the self. declarations up so we are sure they are set even if an exception occurs.
-set self._networks
2025-03-10 09:53:50 +01:00
Gilles Filippini
78307266d4 Revert commit 142a159 to support python docker 5
Debian bookworm (current stable) still has python3-docker 5.0.3. The
reverted commit prevented the test-suite to run natively on this distro.

The version check could be bumped again when the next Debian stable (trixie)
will be released (by fall 2025 hopefully).
2025-02-08 15:27:53 +01:00
Nicolas Duchon
bfdd72fe95 tests: type hints and linting 2024-12-30 14:17:03 +01:00
Nicolas Duchon
40309e2441 tests: enable local testing on macOS / Darwin 2024-12-30 13:41:47 +01:00
Nicolas Duchon
daa9449176 tests: factor out base nginx-proxy config 2024-12-30 12:07:30 +01:00
Nicolas Duchon
ae0c9a8e96 tests: fixture type hints and style standardization 2024-12-27 21:36:07 +01:00
Nicolas Duchon
1e9745f604 tests: complete typing, minor fixes 2024-12-26 16:21:30 +01:00
Nicolas Duchon
7b6baa43cd tests: remove custom system_has_ipv6() method 2024-12-26 01:13:29 +01:00
Nicolas Duchon
fb0fc331c0 tests: minor typos and code style 2024-12-24 16:26:23 +01:00
Nicolas Duchon
35e2d21527 tests: do not remove containers on host 2024-12-24 14:05:42 +01:00
Nicolas Duchon
b5dea1cf50 tests: cleanup test code
- remove unused imports in test cases
- fix code smells and code style in conftest.py
2024-12-24 13:53:09 +01:00
Niek
142a159d56 ci: bump python module docker version check
ci: bump python module docker version check
2024-12-18 11:35:01 +01:00
Niek
92eb45f0ec ci: python 3.12+ compatibility
ci: python 3.12+ compatibility
2024-12-18 11:34:19 +01:00
Povilas Kanapickas
d6c38a0bab tests: Add tests for how Let's Encrypt ACME challenge is handled
At the moment no changes to functionality are done, only the current
behavior is captured.
2024-05-06 13:07:04 +03:00
Gilles Filippini
9e77e81e7d Tests: support custom 'docker compose' command
Enable overriding default 'docker compose' command with environment variable
'DOCKER_COMPOSE'. This way docker compose v1 is still supported with:

  $ DOCKER_COMPOSE=docker-compose pytest

This is important because people using the Debian packaged docker compose
are stuck to v1.
2023-12-20 09:30:06 +01:00
Nicolas Duchon
b5cac06305 ci: remove python docker-compose 2023-12-12 21:56:24 +01:00
Nicolas Duchon
c1a2b31f35 Merge pull request #2222 from rot169/support-hostnet-containers
Support containers running --net=host (#1537)
2023-06-07 07:55:28 +02:00
13eb61a639 fix: Replace mDNS .local domain with .example domain
See RFC 6762 for details on mDNS .local domain: https://datatracker.ietf.org/doc/html/rfc6762
And RFC 6761 for details on .example domain: https://datatracker.ietf.org/doc/html/rfc6761
2023-05-23 09:43:30 +02:00
Nicolas Duchon
35b1493e16 feat: support proxy + container in host network mode 2023-05-09 19:31:42 +02:00
Richard Hansen
b5a54ac219 tests: Reduce scope of docker_compose fixture (and friends)
This makes it possible to bring up different compose files for
different tests in the same test module.

This change does not negatively affect performance because the fixture
is a no-op if the docker compose filename is unchanged between tests.
2023-02-17 02:34:08 -05:00
Richard Hansen
4d8f878ba7 tests: Fixture that simplifies Docker compose file changes 2023-02-17 02:34:08 -05:00
Richard Hansen
f5a3492926 tests: Factor out DNS monkey patching to its own fixture 2023-02-17 02:34:08 -05:00
Richard Hansen
09a2f40633 tests: Turn helper function into docker_compose_file fixture
This makes it easier for tests to override the filename.
2023-02-17 02:34:08 -05:00
Richard Hansen
01745a836f tests: Fix path to ca-root.crt
`os.getcwd()` is not guaranteed to always return the `test/`
directory.
2023-02-17 02:34:08 -05:00
Robin Windey
18027fa71b Add container logs in case testcontainer exited unexpectedly 2022-02-20 15:10:05 +01:00
polarathene
6b3ee66783 chore: white-space housekeeping
Noticed some trailing white-space. Removed for consistency with the rest of the file.
2022-01-01 01:39:51 +13:00
polarathene
115461744b fix: Skip IPv6 when forced but not available + avoid none network
A test on raw IP addresses doesn't reach the existing IPv6 skip logic, added that to avoid a test failing when only IPv4 is available (eg: standard docker container networks).

Additionally some other tests set the `none` network and connecting to this fails as it's not allowed? Preventing that from happening resolves the final failing tests within containerized pytest.
2022-01-01 01:38:13 +13:00
polarathene
04b0181980 fix: Ensure networks are actually connected to pytest container
The `network` object would never be in a list of network names (strings), and without `greedy=True` arg as the `docker-py` API docs note, the containers will not be part of the results, thus always returning an empty list which was not intended..

Now the network will properly match the current networks for pytest container, avoiding duplicate connect attempts, and the network list result will actually have containers to count when filtering by length.
2021-12-31 22:30:49 +13:00
polarathene
0e5d97a268 fix: Don't connect pytest container to networks when using host network
This is not compatible or required, since host networking is no longer isolated to container networks only.
2021-12-31 22:14:26 +13:00
polarathene
b2b4c71997 fix: Don't remove pytest container when running with host network mode
When the container runs with host networking instead of the default bridge, the `$HOSTNAME` / `/etc/hostname` reflects that of the host instead of the container ID , which causes the pytest container to get removed accidentally.

Using a container name instead we can more reliably target the container to avoid removing it, should we need to run with host networking instead.
2021-12-31 22:12:25 +13:00
polarathene
e748d53a1f chore: Extract hostname access to a var
DRY and clearer that we're referring to the pytest container.
2021-12-31 21:51:40 +13:00
polarathene
93c04dce8d fix: Properly detect pytest running via container
The original `/.dockerenv` approach is no longer valid, and context wise we're only using this for the test suite, so using an ENV in that container is a better solution.
2021-12-31 21:42:38 +13:00
Nicolas Duchon
a1ff28cec8 CI: ease version check on python docker module 2021-09-01 09:31:02 +02:00
Nicolas Duchon
df638c3fe6 ci: cleanup left over volumes after tests 2021-08-02 19:31:36 +02:00
Nicolas Duchon
90a7218622 ci: update contest.py 2021-08-02 14:48:40 +02:00
Laurynas Alekna
fb7a11212f Make server_tokens configurable per virtual-host 2021-05-13 21:52:06 +01:00
Kevin Marilleau
37e85e6e8d chore(ci): ♻️ convert Python old % string to f-strings 2021-04-27 00:35:20 +02:00
Kevin Marilleau
eba9ac4261 chore(ci): ⬆️ update python dependencies to latests release 2021-04-27 00:35:19 +02:00
Kevin Marilleau
950a28f5ea chore(ci): ⬆️ porting python 2.7 code to python 3.9 2021-04-27 00:35:19 +02:00
Nicolas Duchon
ad7c02570b chore: use nginxproxy's DockerHub registry
Transitioning away from jwilder/nginx-proxy
Please see #1304 for more details
2021-04-01 16:06:09 +02:00
Steve Kamerman
9be2624d09 Increased dependency versions to get around pip internal problem 2018-04-22 16:11:32 -04:00
Steve Kamerman
c417813df9 Fixed out-of-scope variable 2018-04-22 16:03:43 -04:00