Skip to content
Snippets Groups Projects
Commit b7dcfd05 authored by ale's avatar ale
Browse files

Use pytest, generate JUnit output

The artifacts are saved outside of the test container and retrieved
to the CI runner.
parent 03ca1437
No related branches found
No related tags found
No related merge requests found
Pipeline #84012 failed
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"]
......@@ -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"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment