tests: standardize file structure & naming

This commit is contained in:
Nicolas Duchon committed 2024-12-24 16:22:20 +01:00
1 parent 35e2d21527
commit eb09876f97
124 files changed
+16 -8

No files matched your search

-1
View File
@@ -1 +0,0 @@
This directory contains tests that showcase scenarios known to break the expected behavior of nginx-proxy.
@@ -1,8 +1,8 @@
""" """
Test that nginx-proxy-tester can build successfully Test that nginx-proxy-tester can build successfully
""" """
import pathlib
import re import re
import os
import docker import docker
import pytest import pytest
@@ -13,12 +13,13 @@ client = docker.from_env()
@pytest.fixture(scope = "session") @pytest.fixture(scope = "session")
def docker_build(request): def docker_build(request):
# Define Dockerfile path # Define Dockerfile path
dockerfile_path = os.path.join(os.path.dirname(__file__), "requirements/") current_file_path = pathlib.Path(__file__)
dockerfile_path = current_file_path.parent.parent.joinpath("requirements")
dockerfile_name = "Dockerfile-nginx-proxy-tester" dockerfile_name = "Dockerfile-nginx-proxy-tester"
# Build the Docker image # Build the Docker image
image, logs = client.images.build( image, logs = client.images.build(
path = dockerfile_path, path = dockerfile_path.as_posix(),
dockerfile = dockerfile_name, dockerfile = dockerfile_name,
rm = True, # Remove intermediate containers rm = True, # Remove intermediate containers
tag = "nginx-proxy-tester-ci", # Tag for the built image tag = "nginx-proxy-tester-ci", # Tag for the built image
File renamed without changes.
File renamed without changes.
@@ -22,7 +22,7 @@ def web1(docker_compose):
}, },
ports={"81/tcp": None} ports={"81/tcp": None}
) )
docker_compose.networks.get("test_default").connect(container) docker_compose.networks.get("test_events-net").connect(container)
sleep(2) # give it some time to initialize and for docker-gen to detect it sleep(2) # give it some time to initialize and for docker-gen to detect it
yield container yield container
try: try:
@@ -47,7 +47,7 @@ def web2(docker_compose):
}, },
ports={"82/tcp": None} ports={"82/tcp": None}
) )
docker_compose.networks.get("test_default").connect(container) docker_compose.networks.get("test_events-net").connect(container)
sleep(2) # give it some time to initialize and for docker-gen to detect it sleep(2) # give it some time to initialize and for docker-gen to detect it
yield container yield container
try: try:
@@ -1,3 +1,7 @@
networks:
default:
name: test_events-net
services: services:
nginxproxy: nginxproxy:
image: nginxproxy/nginx-proxy:test image: nginxproxy/nginx-proxy:test
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -3,7 +3,7 @@ services:
image: nginxproxy/nginx-proxy:test image: nginxproxy/nginx-proxy:test
volumes: volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro - /var/run/docker.sock:/tmp/docker.sock:ro
- ./test_location-override.vhost.d:/etc/nginx/vhost.d:ro - ./vhost.d:/etc/nginx/vhost.d:ro
explicit-root: explicit-root:
image: web image: web
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loaded 100 of 124 files, more files were not shown because too many files have changed in this diff. Show more