Implement update mode for integration tests (#3536)#3551
Merged
AlexanderSavelyev merged 1 commit intomasterfrom Apr 6, 2026
Merged
Implement update mode for integration tests (#3536)#3551AlexanderSavelyev merged 1 commit intomasterfrom
AlexanderSavelyev merged 1 commit intomasterfrom
Conversation
8f8a99e to
03f6ab9
Compare
AlexanderSavelyev
requested changes
Mar 18, 2026
api/tests/integration/common/util.py
Outdated
| raise e | ||
|
|
||
|
|
||
| def compare_dif(file_path, out_data, find_diff=None, is_update_required=None): |
Collaborator
There was a problem hiding this comment.
rename to compare_diff
api/tests/integration/common/util.py
Outdated
|
|
||
| def compare_dif(file_path, out_data, find_diff=None, is_update_required=None): | ||
| try: | ||
| is_update_required |
Collaborator
There was a problem hiding this comment.
why do we need this check?
Collaborator
There was a problem hiding this comment.
just make default is_update_required=False
api/tests/integration/common/util.py
Outdated
| with open(file_path, "w", encoding="utf-8") as file: | ||
| file.write(out_data) | ||
|
|
||
| if find_diff is None: |
Collaborator
There was a problem hiding this comment.
remove this parameter
Collaborator
There was a problem hiding this comment.
use just default find_diff
|
|
||
| path_to_ref = os.path.join(ref_path, filename + ".ket") | ||
| diff = compare_dif(path_to_ref, ket, find_diff, update_required) | ||
| if not diff: |
Collaborator
There was a problem hiding this comment.
move print to compare_diff
| diff = compare_dif( | ||
| path_to_ref_cdxml, cdxml_text, find_diff, update_required | ||
| ) | ||
| if not diff: |
Collaborator
There was a problem hiding this comment.
move print to compare_diff
| ket_ref = file.read() | ||
| ket = mol.json() | ||
| diff = find_diff(ket_ref, ket) | ||
| path_to_ref_ket = os.path.join(ref_path, filename + ".ket") |
Collaborator
There was a problem hiding this comment.
where update_required is taken
609f2e0 to
825c3d7
Compare
825c3d7 to
541f131
Compare
AlexanderSavelyev
approved these changes
Apr 6, 2026
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.
Implemented an update mode for integration tests. The functionality is triggered when the CLI command includes the
-uflag, enabling update mode.Update mode updates global reference files. In addition, compare_dif function has been added to control reference update before calculating a "diff".