Repository navigation
Migrate RPM version comparison tests to vers test schema #166 - #218
Open
AradhyaTiwari10 wants to merge 1 commit into
Open
AradhyaTiwari10 wants to merge 1 commit into
AradhyaTiwari10 wants to merge 1 commit into
Conversation
…g#166 Convert the RPMVERCMP cases from tests/data/rpmvercmp.at into tests/data/schema/rpm_version_cmp.json and run them through SchemaDrivenVersTest with univers.versions.RpmVersion, like the other ecosystem tests. The cases commented out upstream with "dnl" are kept, as before, and labelled as upstream oddities in their description. Reference: aboutcode-org#166 Signed-off-by: Aradhya Tiwari <82563152+AradhyaTiwari10@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #166
Migrates the RPM version comparison tests to the vers test schema, following the same pattern as the Gentoo, Alpine, Arch Linux and NuGet tests.
Changes
tests/data/schema/rpm_version_cmp.jsonwith the 103RPMVERCMP(...)cases fromtests/data/rpmvercmp.at(rpm's upstreamtests/rpmvercmp.at):0results becomeequalitycases,-1/1results becomecomparisoncases whose expected output is the sorted pair, all withinput_scheme: "rpm".dnl(the RhBug:811992 and non-ASCII "oddities") are kept, since the current suite also runs them, and theirdescriptionmarks them as upstream oddities.tests/test_rpm_vercmp.pynow parametrizes over the JSON with aSchemaDrivenVersTestsubclass usingunivers.versions.RpmVersion, replacing the m4 parser and the dynamically generated test methods.Not changed
tests/test_rpm.pystays as is: it tests the structured(epoch, version, release)API ofunivers.rpm, and one of its cases (1::2>-3vs1:-2--3) cannot be written as a version string.tests/data/rpmvercmp.atand its.ABOUT/.NOTICEare kept for provenance. Happy to remove them if you prefer the JSON to be the only copy.Verification
univers.versions.RpmVersionreturns the same result as the old string-levelunivers.rpm.vercmp()on all 103 cases.pytest tests/test_rpm_vercmp.py: 103 passed. Swapping inGenericVersionmakes 34 of them fail, so the cases do exercise RPM ordering.pytest testson Python 3.11: 7268 passed. The only failures,test_versions.py::test_semver_versionandtest_enhanced_semantic_version, fail the same way on unmodifiedmain.black -l 100andisortchecks pass.