Don't test forward compatibility in qpy compat tests (backport #11101)#11150
Merged
Conversation
* Don't test forward compatibility in qpy compat tests The qpy compatibility tests are designed to test backwards compatibility. They generate QPY files using all historical releases of Qiskit with QPY support and test that all proposed changes are able to load the qpy files. There was an underlying assumption to how the tests were written that the version under test is always newer than all the historical releases. This has been true in the past because the release model for qiskit mean that we were maintaining at most one stable release at a time, and when we released a new minor version of qiskit we retired the previous minor version release series's branch. However, moving forward this assumption will no longer be true as we're moving to a model where we support > 1 branch at a time. When we start supporting > 1 release series at a time, PRs proposed to the older stable branches will no longer be able to test all releases because QPY only support backwards compatibility and will not be able to load QPY files generated from newer releases. The example of this was in the 0.25.x series, there is overlap in the support of the stable/0.25 branch and the stable/0.45 branch, and after the release of 0.45.0rc1 the tests started to fail because you can't load QPY files generated with 0.45.0rc1 with 0.25.x. This commit address this by adding a condition to the QPY compat scripts to ensure that the version under test is >= the QPY file source version. If we encounter that scenario we just skip the tests. This should prevent this situation from occurring for future releases as we expand our support windows. * Fix syntax errors * Use a Python script to compare versions This commit adds a small python script to compare two version strings and determine whether the version under test is newer (or the same) as the source version. The logic for making this determination was a bit more involved in bash, so using a python script lets us reuse the regex built into qpy's interface to support this comparison already. * Fix lint * Fix return code with invalid version This commit fixes the return code generation if an invalid comparison is requested. We want to handle this with a 0 return code to treat it as a skip, but the previous logic would error before we evaluated the if statement. Co-authored-by: Jake Lishman <jake.lishman@ibm.com> --------- Co-authored-by: Jake Lishman <jake.lishman@ibm.com> (cherry picked from commit 2b5503c)
Collaborator
|
Thank you for opening a new pull request. Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient. While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone. One or more of the the following people are requested to review this:
|
jakelishman
approved these changes
Oct 30, 2023
Pull Request Test Coverage Report for Build 6698303203
💛 - Coveralls |
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.
This is an automatic backport of pull request #11101 done by Mergify.
Mergify commands and options
More conditions and actions can be found in the documentation.
You can also trigger Mergify actions by commenting on this pull request:
@Mergifyio refreshwill re-evaluate the rules@Mergifyio rebasewill rebase this PR on its base branch@Mergifyio updatewill merge the base branch into this PR@Mergifyio backport <destination>will backport this PR on<destination>branchAdditionally, on Mergify dashboard you can:
Finally, you can contact us on https://mergify.com