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

NEW: add code coverage to CI jobs running Editor and Playmode tests on editor platforms #2086

Merged
merged 16 commits into from
Dec 18, 2024

Conversation

stefanunity
Copy link
Collaborator

Description

  • Win, Mac & Linux editor jobs now run code coverage for the package integration tests & project tests (Assets/Tests).
  • coverage reports are part of the artifacts being generated & zipped

Testing status & QA

  • CI is green
  • reports are generated and appear in artifacts

Overall Product Risks

No product risk, test jobs take slightly more time.

  • Complexity: Low
  • Halo Effect: Low

Checklist

Before review:

  • Changelog entry added.
    • Explains the change in Changed, Fixed, Added sections.
    • For API change contains an example snippet and/or migration example.
    • JIRA ticket linked, example (case %%). If it is a private issue, just add the case ID without a link.
    • Jira port for the next release set as "Resolved".
  • Tests added/changed, if applicable.
    • Functional tests Area_CanDoX, Area_CanDoX_EvenIfYIsTheCase, Area_WhenIDoX_AndYHappens_ThisIsTheResult.
    • Performance tests.
    • Integration tests.
  • Docs for new/changed API's.
    • Xmldoc cross references are set correctly.
    • Added explanation how the API works.
    • Usage code examples added.
    • The manual is updated, if needed.

During merge:

  • Commit message for squash-merge is prefixed with one of the list:
    • NEW: ___.
    • FIX: ___.
    • DOCS: ___.
    • CHANGE: ___.
    • RELEASE: 1.1.0-preview.3.

After merge:

  • Create forward/backward port if needed. If you are blocked from creating a forward port now please add a task to ISX-1444.

@unity-cla-assistant
Copy link

unity-cla-assistant commented Dec 10, 2024

CLA assistant check
All committers have signed the CLA.

@ekcoh
Copy link
Collaborator

ekcoh commented Dec 11, 2024

@stefanunity I unzipped "artefacts" in Yamato on this PR but could find any coverage report there, where may I find it?

@ekcoh
Copy link
Collaborator

ekcoh commented Dec 11, 2024

@stefanunity Maybe its only on specific jobs? You mention integration tests (not many tests) and project tests?

@stefanunity
Copy link
Collaborator Author

@stefanunity Maybe its only on specific jobs? You mention integration tests (not many tests) and project tests?

See DM with artifact links.

Copy link
Collaborator

@lyndon-unity lyndon-unity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great to get this added. Thank you.

@ekcoh
Copy link
Collaborator

ekcoh commented Dec 16, 2024

Thanks for helping find the coverage report jobs @stefanunity. Fist of all, great to get this added. However, when reviewing the generated report, e.g. looking at HTML report https://yamato-artifactviewer.prd.cds.internal.unity3d.com/a62e0ec1-0e59-4934-b3f4-b15136f269d1%2FUTR_Output.zip%2Fupm-ci~%2Ftest-results%2FCodeCoverage%2FPackage%2FReport/index.html (Win job), I notice code coverage is extremely low. Picking a certain random class, e.g. GamepadState, we can see that code coverage is 0% in the report, another example I checked was PressedInteraction which also report 0% coverage. Putting a breakpoint inside these classes and running the test suite in editor locally hits those method from the test suite so something is wrong. (Play mode tests)

I suspect, maybe a merge operation of cobertura reports isn't done to get a merged report before calling report tool? And the current result we see is likely only editor tests? Since there are multiple test runs their results should be merged. It might be that coverage is only indicating a partial runs results?

@ekcoh
Copy link
Collaborator

ekcoh commented Dec 16, 2024

Looking at the artefacts there seem to be 4 xml reports that need to be merged before generating report with ReportTool unless it support multiple sources on CLI interface.

@stefanunity
Copy link
Collaborator Author

Looking at the artefacts there seem to be 4 xml reports that need to be merged before generating report with ReportTool unless it support multiple sources on CLI interface.

Resolved as per convo in sync meeting.

@stefanunity stefanunity merged commit 7924b18 into develop Dec 18, 2024
77 checks passed
@stefanunity stefanunity deleted the ci/add-coverage branch December 18, 2024 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants