Page MenuHomeSoftware Heritage

test_cli.py: fix passing custom config to CLI
ClosedPublic

Authored by haltode on Tue, Sep 15, 10:01 AM.

Details

Reviewers
seirl
Summary

The custom low RAM configuration to test out the graph compression was
not actually passed to the CLI (the CI was green because the machine
running it had enough RAM anyway) and was overwritten by the default
empty configuration. Now pass the configuration using the --config-file
option.

Diff Detail

Repository
rDGRPH Graph service
Branch
fix-test_cli
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 15321
Build 23598: Phabricator diff pipeline on jenkinsJenkins console · Jenkins
Build 23597: arc lint + arc unit

Event Timeline

haltode created this revision.Tue, Sep 15, 10:01 AM

Build is green

Patch application report for D3944 (id=13886)

Rebasing onto eaf0323a1c...

Current branch diff-target is up to date.
Changes applied before test
commit 23f2f4cacfd88e754895fc2c11a2af3826d07683
Author: Thibault Allançon <haltode@gmail.com>
Date:   Tue Sep 15 09:54:55 2020 +0200

    test_cli.py: fix passing custom config to CLI
    
    The custom low RAM configuration to test out the graph compression was
    not actually passed to the CLI (the CI was green because the machine
    running it had enough RAM anyway) and was overwritten by the default
    empty configuration. Now pass the configuration using the --config-file
    option.

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

seirl requested changes to this revision.Fri, Sep 18, 11:40 AM
seirl added inline comments.
swh/graph/tests/test_cli.py
9

use import yaml, you don't want a "dump" function in the global namespace.

39

one liner protip: Path(tmpdir, 'config.yml').write_text(yaml.dumps(config))

This revision now requires changes to proceed.Fri, Sep 18, 11:40 AM
haltode updated this revision to Diff 14048.Fri, Sep 18, 11:49 AM

Fix import yaml and use Pathlib write_text method.

haltode marked 2 inline comments as done.Fri, Sep 18, 11:49 AM
seirl requested changes to this revision.Fri, Sep 18, 11:50 AM
seirl added inline comments.
swh/graph/tests/test_cli.py
38

You're calling Path() twice :-P

This revision now requires changes to proceed.Fri, Sep 18, 11:50 AM

Build is green

Patch application report for D3944 (id=14048)

Rebasing onto 685a232ad8...

First, rewinding head to replay your work on top of it...
Applying: test_cli.py: fix passing custom config to CLI
Changes applied before test
commit c0879312722756d7bd1a7d869ebf1237b70fd4ee
Author: Thibault Allançon <haltode@gmail.com>
Date:   Tue Sep 15 09:54:55 2020 +0200

    test_cli.py: fix passing custom config to CLI
    
    The custom low RAM configuration to test out the graph compression was
    not actually passed to the CLI (the CI was green because the machine
    running it had enough RAM anyway) and was overwritten by the default
    empty configuration. Now pass the configuration using the --config-file
    option.

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

haltode updated this revision to Diff 14049.Fri, Sep 18, 11:53 AM

Remove unnecessary Path call

haltode marked an inline comment as done.Fri, Sep 18, 11:53 AM

Build is green

Patch application report for D3944 (id=14049)

Rebasing onto 685a232ad8...

First, rewinding head to replay your work on top of it...
Applying: test_cli.py: fix passing custom config to CLI
Changes applied before test
commit 44e85f5fa1ad9878058da15ed71a5c6b887785fa
Author: Thibault Allançon <haltode@gmail.com>
Date:   Tue Sep 15 09:54:55 2020 +0200

    test_cli.py: fix passing custom config to CLI
    
    The custom low RAM configuration to test out the graph compression was
    not actually passed to the CLI (the CI was green because the machine
    running it had enough RAM anyway) and was overwritten by the default
    empty configuration. Now pass the configuration using the --config-file
    option.

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

seirl accepted this revision.Fri, Sep 18, 11:54 AM
This revision is now accepted and ready to land.Fri, Sep 18, 11:54 AM
haltode updated this revision to Diff 14050.Fri, Sep 18, 11:57 AM

Rebase on master.

Build is green

Patch application report for D3944 (id=14050)

Rebasing onto 685a232ad8...

Current branch diff-target is up to date.
Changes applied before test
commit a0f17b471ced049ebd1722115173d65a4c02b06c
Author: Thibault Allançon <haltode@gmail.com>
Date:   Tue Sep 15 09:54:55 2020 +0200

    test_cli.py: fix passing custom config to CLI
    
    The custom low RAM configuration to test out the graph compression was
    not actually passed to the CLI (the CI was green because the machine
    running it had enough RAM anyway) and was overwritten by the default
    empty configuration. Now pass the configuration using the --config-file
    option.

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