Skip to content

Implement update mode for integration tests #3536

@AlexanderSavelyev

Description

@AlexanderSavelyev

Background
It is hard to update tests references for python tests

Solution

  • Create new mode "-u" for api/tests/integration/test.py
    • This mode will update the tests in "ref" folder for the executed tests
    • If ref/$folder/$platform/$test exists, then update the test
  • Create new function compare_diff (filename, data, stdout=True, diff_fn=find_diff): str where
    • filename - full file name
    • data - text to read (update) from
    • stdout - boolean to print into stdout (filename + ':SUCCEED' if no diff else filename + ":FAILED", then diff )
    • diff_fn - lambda to compare two strings (find_diff(ref_txt, txt) by default)
    • function should return None if no diff, or the diff string
    • New function compare_diff should also use "-u"
    • Find all places where "find_diff" is used and replace by compare_diff
  • Move moleculeLayoutDiff and reactionLayoutDiff to util.py and use the -u parameter

Metadata

Metadata

Labels

No labels
No labels
No fields configured for Feature.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions