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

Cache header.sh and use loops to speedup unit tests #625

Merged
merged 2 commits into from
Jan 24, 2023

Conversation

dbast
Copy link
Member

@dbast dbast commented Jan 23, 2023

Description

The test case test_linux_template_processing was producing ~20k test cases by being parametrised via lots of parameters and @pytest.mark.parametrize. A lot of execution time was spent by pytest for orchestrating that many tests. By turning the parameters into a loop, the test cases could be reduced to 67 and the overall execution time from ~4:30 to 47 sec (macOS), ~2:15 to 22 sec (linux), 4:30 to 38 sec (windows).

Checklist - did you ...

  • Add a file to the news directory (using the template) for the next release's release notes?
  • Add / update necessary tests?
  • Add / update outdated documentation?

@dbast dbast requested a review from a team as a code owner January 23, 2023 17:47
@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label Jan 23, 2023
@dbast dbast force-pushed the faster_unittests branch 2 times, most recently from 934ff10 to 01dfd17 Compare January 24, 2023 07:59
tests/test_header.py Outdated Show resolved Hide resolved
@jaimergp
Copy link
Contributor

Out of an abundance of caution, does this fail if we intentionally mess one of the #if lines or forget to close an #endif? I am assuming it does, and maybe you did locally already. If that's the case, this is good to go.

@dbast
Copy link
Member Author

dbast commented Jan 24, 2023

@jaimergp yes, tested that.

@dbast
Copy link
Member Author

dbast commented Jan 24, 2023

Ignoring unrelated test failure.

@dbast dbast merged commit 63e0f83 into conda:main Jan 24, 2023
@dbast dbast deleted the faster_unittests branch January 24, 2023 13:02
@github-actions github-actions bot added the locked [bot] locked due to inactivity label Jan 25, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla-signed [bot] added once the contributor has signed the CLA locked [bot] locked due to inactivity
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants