Page MenuHomeSoftware Heritage

test_identifiers: Make sure that {directory,revision,release,snapshot}_identifier() doesn't just return a value from the dict.
ClosedPublic

Authored by vlorentz on Jan 12 2021, 12:18 PM.

Details

Summary

For example, before this commit, you could replace the code of
revision_identifier() with this:

def release_identifier(release):
    return release.get("id", b"")

and all tests would still pass.

Diff Detail

Repository
rDMOD Data model
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 18280
Build 28221: Phabricator diff pipeline on jenkinsJenkins console · Jenkins
Build 28220: arc lint + arc unit

Event Timeline

Build is green

Patch application report for D4839 (id=17136)

Rebasing onto 18fde50472...

Current branch diff-target is up to date.
Changes applied before test
commit 731d10d30695921685886364666f8b7f5b2a6c75
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Tue Jan 12 12:17:24 2021 +0100

    test_identifiers: Make sure that {directory,revision,release,snapshot}_identifier() doesn't just return a value from the dict.
    
    For example, before this commit, you could replace the code of
    revision_identifier() with this:
    
    def release_identifier(release):
        return release.get("id", b"")
    
    and all tests would still pass.

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

This revision is now accepted and ready to land.Jan 12 2021, 6:06 PM