Page MenuHomeSoftware Heritage

test_cli.py: fix passing custom config to CLI
ClosedPublic

Authored by haltode on Sep 15 2020, 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

Event Timeline

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.Sep 18 2020, 11:40 AM
seirl added inline comments.
swh/graph/tests/test_cli.py
8

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

38

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

This revision now requires changes to proceed.Sep 18 2020, 11:40 AM

Fix import yaml and use Pathlib write_text method.

seirl requested changes to this revision.Sep 18 2020, 11:50 AM
seirl added inline comments.
swh/graph/tests/test_cli.py
37

You're calling Path() twice :-P

This revision now requires changes to proceed.Sep 18 2020, 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.

Remove unnecessary Path call

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.

This revision is now accepted and ready to land.Sep 18 2020, 11:54 AM

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.