Page MenuHomeSoftware Heritage

pytest_plugin: Instantiate only lister with no particular setup
ClosedPublic

Authored by ardumont on Sep 1 2020, 5:55 PM.

Details

Summary

This should fix the remaining blocking problems in the jenkins build failure report [1]

[1] https://jenkins.softwareheritage.org/view/Debian%20packages/job/debian/job/packages/job/DLS/job/gbp-buildpackage/78/consoleFull

Depends on D3858

Test Plan

tox

Diff Detail

Repository
rDLS Listers
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 14866
Build 22903: Phabricator diff pipeline on jenkinsJenkins console · Jenkins
Build 22902: arc lint + arc unit

Event Timeline

Build has FAILED

Patch application report for D3859 (id=13632)

Could not rebase; Attempt merge onto e99d3464e4...

Updating e99d346..78ab418
Fast-forward
 MANIFEST.in                                        |  1 +
 conftest.py                                        | 20 +-------------
 swh/lister/bitbucket/tests/conftest.py             |  1 -
 swh/lister/cgit/tests/conftest.py                  |  1 -
 swh/lister/cran/tests/conftest.py                  |  2 --
 swh/lister/debian/tests/conftest.py                |  3 +-
 swh/lister/gitea/tests/conftest.py                 |  6 ----
 swh/lister/github/tests/conftest.py                |  1 -
 swh/lister/gitlab/tests/conftest.py                |  6 ----
 swh/lister/gnu/tests/conftest.py                   |  6 ----
 swh/lister/launchpad/tests/conftest.py             |  1 -
 swh/lister/npm/tests/conftest.py                   |  4 +--
 swh/lister/packagist/tests/conftest.py             |  4 +--
 swh/lister/phabricator/tests/conftest.py           |  4 +--
 swh/lister/pypi/tests/conftest.py                  |  4 +--
 .../{core/tests/conftest.py => pytest_plugin.py}   | 32 ++++++++++++++++++++--
 swh/lister/tests/test_cli.py                       |  6 ++--
 17 files changed, 39 insertions(+), 63 deletions(-)
 delete mode 100644 swh/lister/bitbucket/tests/conftest.py
 delete mode 100644 swh/lister/cgit/tests/conftest.py
 delete mode 100644 swh/lister/gitea/tests/conftest.py
 delete mode 100644 swh/lister/github/tests/conftest.py
 delete mode 100644 swh/lister/gitlab/tests/conftest.py
 delete mode 100644 swh/lister/gnu/tests/conftest.py
 rename swh/lister/{core/tests/conftest.py => pytest_plugin.py} (63%)
Changes applied before test
commit 78ab418960f1d2cb2a3962025e2fbe971322827d
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Tue Sep 1 17:55:23 2020 +0200

    pytest_plugin: Instantiate only lister with no particular setup

commit 52898aa4bec08500f16707d17e2c45eb4ef3a2e9
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Tue Sep 1 17:43:01 2020 +0200

    pytest: Define plugin and declare it in the root conftest
    
    Then drop all unneeded and indirect imports

Link to build: https://jenkins.softwareheritage.org/job/DLS/job/tests-on-diff/30/
See console output for more information: https://jenkins.softwareheritage.org/job/DLS/job/tests-on-diff/30/console

Build is green

Patch application report for D3859 (id=13633)

Could not rebase; Attempt merge onto e99d3464e4...

Updating e99d346..cdbccd5
Fast-forward
 MANIFEST.in                                        |  1 +
 conftest.py                                        | 20 +-------------
 swh/lister/bitbucket/tests/conftest.py             |  1 -
 swh/lister/cgit/tests/conftest.py                  |  1 -
 swh/lister/cran/tests/conftest.py                  |  2 --
 swh/lister/debian/tests/conftest.py                |  3 +-
 swh/lister/gitea/tests/conftest.py                 |  6 ----
 swh/lister/github/tests/conftest.py                |  1 -
 swh/lister/gitlab/tests/conftest.py                |  6 ----
 swh/lister/gnu/tests/conftest.py                   |  6 ----
 swh/lister/launchpad/tests/conftest.py             |  1 -
 swh/lister/npm/tests/conftest.py                   |  4 +--
 swh/lister/packagist/tests/conftest.py             |  4 +--
 swh/lister/phabricator/tests/conftest.py           |  4 +--
 swh/lister/pypi/tests/conftest.py                  |  4 +--
 .../{core/tests/conftest.py => pytest_plugin.py}   | 32 ++++++++++++++++++++--
 swh/lister/tests/test_cli.py                       |  8 ++----
 17 files changed, 40 insertions(+), 64 deletions(-)
 delete mode 100644 swh/lister/bitbucket/tests/conftest.py
 delete mode 100644 swh/lister/cgit/tests/conftest.py
 delete mode 100644 swh/lister/gitea/tests/conftest.py
 delete mode 100644 swh/lister/github/tests/conftest.py
 delete mode 100644 swh/lister/gitlab/tests/conftest.py
 delete mode 100644 swh/lister/gnu/tests/conftest.py
 rename swh/lister/{core/tests/conftest.py => pytest_plugin.py} (63%)
Changes applied before test
commit cdbccd56fce040ac11357e3e974d44e041d97373
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Tue Sep 1 17:55:23 2020 +0200

    pytest_plugin: Instantiate only lister with no particular setup
    
    This should fix the remaining blocking problems in the jenkins build failure
    report [1]
    
    [1] https://jenkins.softwareheritage.org/view/Debian%20packages/job/debian/job/packages/job/DLS/job/gbp-buildpackage/78/consoleFull

commit 52898aa4bec08500f16707d17e2c45eb4ef3a2e9
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Tue Sep 1 17:43:01 2020 +0200

    pytest: Define plugin and declare it in the root conftest
    
    Then drop all unneeded and indirect imports

See https://jenkins.softwareheritage.org/job/DLS/job/tests-on-diff/31/ for more details.

ardumont added inline comments.
swh/lister/pytest_plugin.py
52

note the | transformed into - to exclude launchpad...
(Thanks @olasd which notified me on irc :)

It's either that or reworking completely the test lister instantiation btw.
(i'm trying something locally for another diff to compare it with, that should not block this one though [1]).

[1] I'm just trying to unstuck the debian build failure so we can put those running into at least staging...

It's either that or reworking completely the test lister instantiation btw.
(i'm trying something locally for another diff to compare it with, that should not block this one though [1]).

[1] I'm just trying to unstuck the debian build failure so we can put those running into at least staging...

I have a diff to do that in my pile of unpushed commits, so, yeah, I feel you.

This revision is now accepted and ready to land.Sep 2 2020, 10:05 AM

Build is green

Patch application report for D3859 (id=13638)

Rebasing onto 9437a643ad...

Current branch diff-target is up to date.
Changes applied before test
commit 92422dcf754d3c8827ef636d093da3d5542e9aa1
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Tue Sep 1 17:55:23 2020 +0200

    pytest_plugin: Instantiate only lister with no particular setup
    
    This should fix the remaining blocking problems in the jenkins build failure
    report [1]
    
    [1] https://jenkins.softwareheritage.org/view/Debian%20packages/job/debian/job/packages/job/DLS/job/gbp-buildpackage/78/consoleFull

See https://jenkins.softwareheritage.org/job/DLS/job/tests-on-diff/34/ for more details.