Jelajahi Sumber

tests: display container version

Nicolas Duchon 3 tahun lalu
induk
melakukan
e22ae4a6fd
2 mengubah file dengan 7 tambahan dan 2 penghapusan
  1. 2 2
      Makefile
  2. 5 0
      test/test_nominal.py

+ 2 - 2
Makefile

@@ -6,10 +6,10 @@ build-webserver:
 	docker build -t web test/requirements/web
 
 build-nginx-proxy-test-debian:
-	docker build -t nginxproxy/nginx-proxy:test .
+	docker build --build-arg NGINX_PROXY_VERSION="test" -t nginxproxy/nginx-proxy:test .
 
 build-nginx-proxy-test-alpine:
-	docker build -f Dockerfile.alpine -t nginxproxy/nginx-proxy:test .
+	docker build --build-arg NGINX_PROXY_VERSION="test" -f Dockerfile.alpine -t nginxproxy/nginx-proxy:test .
 
 test-debian: build-webserver build-nginx-proxy-test-debian
 	test/pytest.sh

+ 5 - 0
test/test_nominal.py

@@ -22,3 +22,8 @@ def test_forwards_to_web2(docker_compose, nginxproxy):
 def test_ipv6_is_disabled_by_default(docker_compose, nginxproxy):
     with pytest.raises(ConnectionError):
         nginxproxy.get("http://nginx-proxy/port", ipv6=True)
+
+
+def test_container_version_is_displayed(docker_compose, nginxproxy):
+    conf = nginxproxy.get_conf().decode('ASCII')
+    assert "# nginx-proxy version : test" in conf