diff --git a/.github/workflows/ci_full.yml b/.github/workflows/ci_full.yml index 9128b19b2d..8d8ff0d49e 100644 --- a/.github/workflows/ci_full.yml +++ b/.github/workflows/ci_full.yml @@ -98,7 +98,8 @@ jobs: run: cd dev/playbooks; ANSIBLE_STDOUT_CALLBACK=yaml ansible-playbook -i 'localhost,' --forks=1 -v start_container.yaml - name: run the unit test playbook - run: cd dev/playbooks; ANSIBLE_STDOUT_CALLBACK=yaml ansible-playbook -i 'localhost,' --forks=1 -v run_unit_tests.yaml + run: cd dev/playbooks; ANSIBLE_STDOUT_CALLBACK=yaml ansible-playbook -i 'localhost,' --forks=1 -v run_unit_tests.yaml \ + --extra-vars "vars=$vars secrets=$secrets github=$github" # FIXME: do we really care about these anymore ... ? #- name: run the functional test playbook diff --git a/.gitignore b/.gitignore index 0b61fbfb74..f5f9c87090 100644 --- a/.gitignore +++ b/.gitignore @@ -47,6 +47,7 @@ coverage.xml *.cover .hypothesis/ .pytest_cache/ +galaxy_ng-test-results.xml # Translations *.mo diff --git a/dev/playbooks/files/run_units.sh b/dev/playbooks/files/run_units.sh index 26a517f766..ac650b3dad 100755 --- a/dev/playbooks/files/run_units.sh +++ b/dev/playbooks/files/run_units.sh @@ -21,6 +21,7 @@ PYTEST_FLAGS="" PYTEST_FLAGS="$PYTEST_FLAGS --cov-report term-missing:skip-covered --cov=galaxy_ng" PYTEST_FLAGS="$PYTEST_FLAGS -v -r sx --color=yes" PYTEST_FLAGS="$PYTEST_FLAGS -p no:pulpcore" +PYTEST_FLAGS="$PYTEST_FLAGS --junit-xml=galaxy_ng-test-results.xml" # This command will run all unit tests in galaxy_ng/tests/unit. # If you need to run a single test, include '-k ' in the PYTEST_FLAGS variable diff --git a/dev/playbooks/run_unit_tests.yaml b/dev/playbooks/run_unit_tests.yaml old mode 100644 new mode 100755 index bc33b32c65..934b66dade --- a/dev/playbooks/run_unit_tests.yaml +++ b/dev/playbooks/run_unit_tests.yaml @@ -50,3 +50,12 @@ galaxy_ng.tools.local_run: command: docker exec pulp /bin/bash -c '/tmp/run_units.sh' + - name: "Upload jUnit XML test results" + ignore_errors: true + shell: + curl -v --user "${{ vars.PDE_ORG_RESULTS_AGGREGATOR_UPLOAD_USER }}:${{ secrets.PDE_ORG_RESULTS_UPLOAD_PASSWORD }}" + --form "xunit_xml=@galaxy_ng-test-results.xml" + --form "component_name=hub" + --form "git_commit_sha=${{ github.sha }}" + --form "git_repository_url=https://github.com/${{ github.repository }}" + "${{ vars.PDE_ORG_RESULTS_AGGREGATOR_UPLOAD_URL }}/api/results/upload/"