Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve test performance and organization #318

Merged
merged 8 commits into from
Dec 9, 2021

Conversation

samdoran
Copy link
Contributor

@samdoran samdoran commented Dec 9, 2021

Move unit tests to test/unit.
Use tmp_path fixture instead of tmpdir
Use mocker fixture

Mock out real system return value since different operating systems do not
always respond the same to invalid flags. Specifically sleep on macOS does
not exit 1 for invalid values for [seconds]. This caused the unit test to fail
on macOS.
Integration tests running in parallel can cause this.
Update tests to be more reliable and not subject to race condition.
Remove used of tempfile in tests
Use Path objects rather than strings for paths
@samdoran samdoran requested a review from a team as a code owner December 9, 2021 17:06
@github-actions github-actions bot added needs_triage New item that needs to be triaged test Changes to test files labels Dec 9, 2021
@Shrews Shrews added gate and removed needs_triage New item that needs to be triaged labels Dec 9, 2021
Copy link
Contributor

@ansible-zuul ansible-zuul bot left a comment

Choose a reason for hiding this comment

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

LGTM!

@ansible-zuul ansible-zuul bot merged commit 1ad38e4 into ansible:devel Dec 9, 2021
@samdoran samdoran deleted the ci/improve-tests branch December 9, 2021 18:03
samdoran added a commit to samdoran/ansible-builder that referenced this pull request Dec 9, 2021
Improve test performance and organization

Move unit tests to test/unit.
Use tmp_path fixture instead of tmpdir
Use mocker fixture

Reviewed-by: David Shrewsbury <None>
Reviewed-by: None <None>.
(cherry picked from commit 1ad38e4)

Co-authored-by: Sam Doran <sdoran@redhat.com>
samdoran added a commit to samdoran/ansible-builder that referenced this pull request Dec 9, 2021
Improve test performance and organization

Move unit tests to test/unit.
Use tmp_path fixture instead of tmpdir
Use mocker fixture

Reviewed-by: David Shrewsbury <None>
Reviewed-by: None <None>
ansible-zuul bot pushed a commit that referenced this pull request Dec 9, 2021
[release_1.0] Improve test performance and organization (#318)

Backport of #318 for Ansible Builder 1.0.

Reviewed-by: David Shrewsbury <None>
Reviewed-by: None <None>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Changes to test files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants