Skip to content

Fix further test issues when run in container#3189

Merged
ptoscano merged 2 commits intomainfrom
mhorky/ENT-5536_tests
Jan 6, 2023
Merged

Fix further test issues when run in container#3189
ptoscano merged 2 commits intomainfrom
mhorky/ENT-5536_tests

Conversation

@m-horky
Copy link
Contributor

@m-horky m-horky commented Jan 4, 2023

  • Card ID: ENT-5536

These tree commits address issues that were found when the test suite was run in a container.

UPDATE: The hwprobe commit was removed and will be opened individually, as it requires more testing.

Because 'get_config_parser()' and 'in_container()' functions were being
imported directly, instead of as reference, the mocks that tests perform
were not applying to them, causing test suite to fail when run from
inside a container. Future-wise it is better to manage mocks on one
place, instead of patching the functions whenever they are being
imported.
@cnsnyder cnsnyder requested review from a team and cnsnyder and removed request for a team January 4, 2023 15:06
Copy link
Contributor

@ptoscano ptoscano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general it is OK, thanks for the work!

While I agree with the change wrt the IP addresses collection, I think that that bit need a bit more of discussion and testing, especially that tried to handle some kind of "edge cases". Would it be possible to split that commit in its own draft PR, so we can bring the other two commits in?

@m-horky m-horky closed this Jan 6, 2023
@m-horky m-horky deleted the mhorky/ENT-5536_tests branch January 6, 2023 12:33
* Card ID: ENT-5536

Subprocess calls to 'touch' were sometimes failing to update the
modification date (race condition, probably?), making the tests fail.
When 'os.utime' is used, this is no longer the case and the files are
always reported as modified.
@m-horky m-horky reopened this Jan 6, 2023
@m-horky m-horky force-pushed the mhorky/ENT-5536_tests branch from 6009668 to 68acefc Compare January 6, 2023 12:38
Copy link
Contributor

@ptoscano ptoscano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@ptoscano ptoscano merged commit 414f018 into main Jan 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants