diff --git a/test/Dockerfile b/test/Dockerfile index 4cf0707f8b8563a09892d9612293156d24a5a1bb..c4b64355915dcd1deaebd92f510348f7a4d8454f 100644 --- a/test/Dockerfile +++ b/test/Dockerfile @@ -1,7 +1,7 @@ FROM debian:stable RUN apt-get -q update && env DEBIAN_FRONTEND=noninteractive \ - apt-get install --no-install-recommends -y python3 python3-pip python3-setuptools python3-yaml python3-jinja2 python3-nose python3-dnspython + apt-get install --no-install-recommends -y python3 python3-pip python3-setuptools python3-yaml python3-jinja2 python3-pytest python3-dnspython ADD . /src WORKDIR /src @@ -9,4 +9,4 @@ RUN python3 setup.py install ENV TEST_CONFIG=/test-config.yml ENV TEST_PARAMS=/src/float_integration_test/test-params.yml -CMD ["nosetests3", "-v", "float_integration_test"] +CMD ["pytest", "-v", "-junit_xml=/artifacts/pytest.xml", "float_integration_test"] diff --git a/test/integration-test.yml b/test/integration-test.yml index e43a784e9e45d3cc36ce72bade708f98e8ef9f94..bff929ae0f60c2d160a9932eb25c083e346e7b21 100644 --- a/test/integration-test.yml +++ b/test/integration-test.yml @@ -8,13 +8,30 @@ dest: /tmp/test-config.yml content: "{{ vars | to_nice_yaml }}" + - name: Create test artifact directory + file: + path: "/artifacts" + state: directory + mode: "01777" + - name: Pull the test suite container image command: "float-pull-image {{ test_image }}" register: test_container_image failed_when: "test_container_image.rc not in [0, 42]" - name: Run tests - command: "podman run --rm --network host --mount type=bind,source=/tmp/test-config.yml,destination=/test-config.yml {{ test_image }}" + command: "podman run --rm --network host --mount type=bind,source=/tmp/test-config.yml,destination=/test-config.yml --mount type=bind,source=/artifacts,destination=/artifacts {{ test_image }}" + + - name: Retrieve test result + slurp: + src: "/artifacts/pytest.xml" + register: pytest_xml + + - name: Store test results locally + local_action: + module: copy + dest: "pytest.xml" + content: "{{ pytest_xml['content'] | b64decode }}" vars: test_image: "registry.git.autistici.org/ai3/float:integration-test"