Skip to content

Commit

Permalink
Prepare test results to only use junit/xunit schema (#3441)
Browse files Browse the repository at this point in the history
* Set ctest arg to output junit

To try and help CircleCI to parse the output files
https://stackoverflow.com/a/70774733/2577586

* Replace the original Test.xml

by outputting the junit to the same filename
Context:
https://github.com/colcon/colcon-cmake/blob/8f1b92a190b2ad4289ecf837c3200d540c13fdd9/colcon_cmake/task/cmake/test.py#L133

* Fix default formatting to a list

WARNING:colcon.colcon_defaults.argument_parser.defaults:Default value 'ctest-args' for parser 'test' should be a list, not:  --output-junit Test.xml

* Revert junit file name
https://circleci.com/docs/collect-test-data/#ctest-for-c-cxx-tests

* Fine and rename ctest summary Test.xml

* Fix find path

* Simplify extention renaming

* Copy ctest junit file into test_results
so that they can be stored by CI

* Revert ctest config modifications

* Prepare Test Results by removing Test.xml
generated by ctest
to simplify fix for circleci

* Reorder storage of test result artifacts
before Test.xml files are removed
so that they can still be archived and viewed for later

* Use find command
  • Loading branch information
ruffsl authored Mar 20, 2023
1 parent c2537a8 commit f529e3e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,15 @@ _commands:
when: always
- store_artifacts:
path: << parameters.workspace >>/log/test
- store_test_results:
path: << parameters.workspace >>/test_results
- store_artifacts:
path: << parameters.workspace >>/test_results
- run:
name: Prepare Test Results
working_directory: << parameters.workspace >>
command: find test_results -name "Test.xml" -type f -delete
when: always
- store_test_results:
path: << parameters.workspace >>/test_results

_steps:
pre_checkout: &pre_checkout
Expand Down

0 comments on commit f529e3e

Please sign in to comment.