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

Linecoverage: No such file or directory #63

Open
FrancoisGo opened this issue Nov 20, 2023 · 4 comments
Open

Linecoverage: No such file or directory #63

FrancoisGo opened this issue Nov 20, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@FrancoisGo
Copy link

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 be grep "string" path

How to reproduce

Run test on circle ci in editmode.
Here is my circle ci job :

  test:
    executor:
      name: 'unity/ubuntu'
      target_platform: 'android'
      editor_version: '2022.3.11f1'
      resource_class: 'large'
    steps:
      - custom_checkout
      - unity/prepare-env:
          project-path: '******'
      - unity/test:
          project-path: '******'
          test-platform: 'editmode'
          custom-parameters: '-buildTarget "Android" -disable-assembly-updater -coverageOptions "useProjectSettings"'
@FrancoisGo FrancoisGo added the bug Something isn't working label Nov 20, 2023
@FrancoisGo
Copy link
Author

FrancoisGo commented Nov 21, 2023

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.

@FrancoisGo
Copy link
Author

FrancoisGo commented Nov 22, 2023

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.

@FrancoisGo
Copy link
Author

FrancoisGo commented Nov 22, 2023

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.

@AndrewKahr AndrewKahr transferred this issue from game-ci/unity-actions Dec 12, 2023
@FrancoisGo
Copy link
Author

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 ?

@AndrewKahr AndrewKahr reopened this Dec 12, 2023
@AndrewKahr AndrewKahr transferred this issue from game-ci/unity-test-runner Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants