Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CI upload junit xml test results #2257

Merged
merged 4 commits into from
Sep 11, 2024

Conversation

jerabekjiri
Copy link
Contributor

@jerabekjiri jerabekjiri commented Sep 9, 2024

This PR adds storing Hub unit test results in jUnit XML file when the test are running and then uploading them to the platform readiness dashboard.

Issue: https://issues.redhat.com/browse/AAP-29782

Documentation: handbook.eng.ansible.com/docs/Testing/xunit-junit

copy-pasted from https://github.com/ansible/aap-gateway/pull/527

@jctanner
Copy link
Collaborator

Why disable linting?

@jerabekjiri
Copy link
Contributor Author

jerabekjiri commented Sep 10, 2024

Why disable linting?

@jctanner that was just for testing

@jerabekjiri
Copy link
Contributor Author

jerabekjiri commented Sep 10, 2024

EDIT: failure is related to missing vars and secrets in my fork, this should work correctly in ansible repo


upload fails with

Run curl -v --user ":" --form "xunit_xml=@/tmp/galaxy_ng-test-results.xml" --form "component_name=hub" --form "git_commit_sha=c19e6ea4d34773d9a5e21f3cb95b6656f4b0891f" --form "git_repository_url=https://github.com/ansible/galaxy_ng" "/api/results/upload/"
curl: (26) Failed to open/read local data from file/application

(https://github.com/ansible/galaxy_ng/actions/runs/10788270380/job/29918687050?pr=2257#step:9:13)

looks like we're missing org variables: `PDE_ORG_RESULTS_AGGREGATOR_UPLOAD_USER, PDE_ORG_RESULTS_UPLOAD_PASSWORD, PDE_ORG_RESULTS_AGGREGATOR_UPLOAD_URL``

@jctanner
Copy link
Collaborator

jctanner commented Sep 10, 2024

Given the run_units.sh script executes inside the "pulp" container, how does the action-runner machine access /tmp/galaxy_ng-test-results.xml? Is there a volume mount to /tmp that I wasn't aware of?

@jerabekjiri
Copy link
Contributor Author

Given the run_units.sh script executes inside the "pulp" container, how does the action-runner machine access /tmp/galaxy_ng-test-results.xml? Is there a volume mount to /tmp that I wasn't aware of?

@jctanner good catch, I forgot this is executed inside the container

Updated to curl in the pulp container, does this work for you?

@jctanner
Copy link
Collaborator

Seems fine as long as it does what it is supposed to.

@jerabekjiri jerabekjiri merged commit 4981a65 into ansible:master Sep 11, 2024
19 of 22 checks passed
@jerabekjiri jerabekjiri deleted the add-xunit-upload branch September 11, 2024 14:36
@jerabekjiri
Copy link
Contributor Author

jerabekjiri commented Sep 11, 2024

Merged, the only way to test this is in production

Andersson007 added a commit to Andersson007/galaxy_ng that referenced this pull request Sep 16, 2024
No-Issue

ALLOW_LOCAL_RESOURCE_MANAGEMENT truthiness (ansible#2255)

Add fuzzy logic to ui/v2/users for ALLOW_LOCAL_RESOURCE_MANAGEMENT.

No-Issue

Signed-off-by: James Tanner <[email protected]>

Add CI upload junit xml test results (ansible#2257)

* upload junit xml test results
* run only in ansible repo
* upload inside the docker
No-Issue

Fix SonarCloud readability issues (ansible#2221)

No-Issue

Exclude vendored code from SonarCloud analysis (ansible#2264)

No-Issue

Mark more 2.5 tests (ansible#2262)

mark more 2.5 tests

No-Issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants