Open FrancoisGo opened 12 months ago
When trying to fix it I got an error with the line after in the orb : mv "$unity_project_full_path"/"$PARAM_TEST_PLATFORM"-coverage/"$CIRCLE_PROJECT_REPONAME"-opencov/*Mode/TestCoverageResults_*.xml "$unity_project_full_path"/"$PARAM_TEST_PLATFORM"-coverage/coverage.xml
Because in our case we have two TestCoverageResults files. And it tries to move two files in the coverage.xml.
To remove the errors I decided to remove the code coverage package from my project to avoid issues in the editmode tests.
But after fixing the editmode tests I got an issue with the playmode tests saying there is no graphic device.
The cause was the -nographic
argument passed to the unity editor batch command line 695 in the circle ci orb.
After adding back the code coverage package and fixing the previous issues I got another one with the move command because our Unity project doesn't have the same name as the repository.
So the variable $CIRCLE_PROJECT_REPONAME
in the path causes us an error.
Here is a fix I use :
if grep -q "$code_coverage_package" "$package_manifest_path"; then
apt-get install -y xml-twig-tools
grep Linecoverage "$unity_project_full_path"/"$PARAM_TEST_PLATFORM"-coverage/Report/Summary.xml
xml_grep --pretty_print indented --wrap Modules --descr '' --cond "Module" "$unity_project_full_path"/"$PARAM_TEST_PLATFORM"-coverage/*-opencov/*Mode/TestCoverageResults_*.xml > "$unity_project_full_path"/"$PARAM_TEST_PLATFORM"-coverage/coverage.xml
rm -r "$unity_project_full_path"/"$PARAM_TEST_PLATFORM"-coverage/*-opencov/
Also at the end of the command I added this to store the coverage result in the artifactory :
- store_artifacts:
path: << parameters.project-path >>/<< parameters.test-platform >>-coverage
destination: coverage
I also removed the -nographic
of the unity params. Now I pass it with the custom param for the edit mode tests and the play mode tests are working fine.
I don't know why my private repository merge is in this ticket but it's a not a fix to this issue. Because here I'm still waiting the update of the unity circle ci orb with all the fix up there. So please can you reopen this issue and update this orb ?
Bug description
When running editmode tests on circle ci I got this error :
grep: Linecoverage: No such file or directory
When looking in the circle ci orb I saw this line 718 :grep "$unity_project_full_path"/"$PARAM_TEST_PLATFORM"-coverage/Report/Summary.xml Linecoverage
But if I'm right the grep command doesn't work like this it should begrep "string" path
How to reproduce
Run test on circle ci in editmode. Here is my circle ci job :