Page MenuHomePhabricator

Error in code coverage reports for extensions in codehealth-pipeline
Closed, ResolvedPublicBUG REPORT

Description

The https://doc.wikimedia.org/cover-extensions/ resource is empty for extensions in the codehealth-pipeline. Those extensions were deliberately removed from extension-coverage to avoid duplicating resources and efforts (see T224990 and specifically 55043fb).

But it seems like the publisher is not working as intended. @thcipriani and I tested this and it was working when this was first deployed.

- mwext-codehealth-{name}:
         # Used for analyzing the master branch on postmerge.
         name: 'master-non-voting'
         concurrent: false
         branch: '$ZUUL_BRANCH'
         sonar_args: |
             -Dsonar.projectKey=${{ZUUL_PROJECT//\//-}} \
             -Dsonar.projectName=${{ZUUL_PROJECT//\//-}} \
             -Dsonar.organization=wmftest \
             -Dsonar.host.url=https://sonarcloud.io \
             -X
         publishers:
             - archive-log-allow-empty
             - castor-save-workspace-cache
             - postbuildscript:
                   script-only-if-succeeded: false
                   script-only-if-failed: false
                   builders:
                       -   cover-extensions-publish:
                               src: 'cover'
                               # Should be equivalent to $EXT_NAME
                               dest: '$DOC_BASENAME'
                       -   docker-wipe-dir:
                               dir: 'cover'
             - docker-cleanup

Event Timeline

kostajh changed the subtype of this task from "Task" to "Bug Report".Sep 6 2019, 10:23 AM

Ah, it's only failing for extensions which have no unit tests, and which have 0% coverage in the junit.xml. These then show up as having 100% coverage in doc.wikimedia.org/cover-extensions.

We didn't intend to change the doc.wikimedia.org/cover-extensions report, but by switching to using unit tests and not integration tests for coverage calculation, we have.

Some options:

  • We could add back extension-coverage to extensions in the pipeline at the expense of more CI resources
  • Do nothing
  • Add a step for mwext-codehealth-master-non-voting which re-runs the PHPUnit tests to generate coverage, including integration tests this time, and rsync those results to doc.wikimedia.org/cover-extensions

Ah, it's only failing for extensions which have no unit tests, and which have 0% coverage in the junit.xml. These then show up as having 100% coverage in doc.wikimedia.org/cover-extensions.

We didn't intend to change the doc.wikimedia.org/cover-extensions report, but by switching to using unit tests and not integration tests for coverage calculation, we have.

Depends on what folks think is useful, I suppose. Unit test coverage vs coverage anywhere. Unintentionally breaking the old behavior seems bad though.

Showing 100% on the dashboard when that actually means 0% seems like a separate bug (correct to say that that was not introduced by moving pipelines?).

I propose:

  • we reintroduce the extension-coverage template which will be in charge of publishing to doc.wikimedia.org
  • stop publishing the report from the codehealth job since it is broken / empty in some case. Essentially revert 55043fbd4b96

We will wait for @kostajh who is in vacations (the issue has been around for a while so we can wait a few more days).

I propose:

  • we reintroduce the extension-coverage template which will be in charge of publishing to doc.wikimedia.org
  • stop publishing the report from the codehealth job since it is broken / empty in some case. Essentially revert 55043fbd4b96

We will wait for @kostajh who is in vacations (the issue has been around for a while so we can wait a few more days).

That seems OK to me. Maybe eventually we could try again, but for now the race condition errors, conflicts with Wikibase, and differing coverage sources (unit tests only vs unit + integration) seem less than ideal.

thcipriani assigned this task to hashar.

We (@hashar) *think* this is fixed. Reopen if this is still a problem.

I think that got fixed via T259109 unless I miss understand the purpose of this task.