NO-SNOW: Lower pytest verbosity level in CI#4122
Open
sfc-gh-joshi wants to merge 5 commits intomainfrom
Open
Conversation
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.
Which Jira issue is this PR addressing? Make sure that there is an accompanying issue to your PR.
Fixes SNOW-NNNNNNN
Fill out the following pre-review checklist:
Please describe how your code solves the related issue.
This PR significantly reduces CI storage usage and slightly reduces CI runtime by lowering pytest verbosity and removing ANSI color control characters. Each Snowpark Python precommit job runs >5300 tests, and each Modin job runs >39600 tests, with even more in the daily job suite. Tests were set to run with
-vvvway back in 2021, and the size of the test suite means GH actions is storing ridiculous amounts of data for each test, most of which is unnecessary noise. The text log for the largest jobs (modin daily tests) are nearly 19 MB in size on a passing run, which adds up very quickly considering the number of jobs in a single precommit run. While I don't have access to billing information for this repository, I'd imagine this excessive logging is running up our storage costs.Changes
The size reduction is achieved by 3 means:
-vor higher, pytest prints 2 lines of text for each test (one when a worker collects the test, and one when the test passes/fails). With the default verbosity, each test is instead printed as a single dot on pass, a single letter F on failure, and R on retry--the names of passing tests are not printed. While this decreases visibility somewhat, in the vast majority of cases the names of passing tests are irrelevant, and removing them trims megabytes of output from each test.--color=no. While color-coding in a local terminal is quite helpful, the ANSI color characters used to display this appear in the raw file output of tests on github, and make copy-pasting failing test names unnecessarily annoying.log_cliby default, while keepinglog_cli_level = DEBUG. Whenlog_cli = Trueis set, ALL logging messages are included in the output, which includes all query text issued (even for passing tests). The new configuration hides logging for passing tests, while ensuring it remains displayed on failure.Here's an example of what a failing run looks like in this PR (stack traces and log messages are still visible): https://github.com/snowflakedb/snowpark-python/actions/runs/23166329988/job/67445181785?pr=4122
While seeing full test names is occasionally useful (e.g. concurrency issues where the order of test collection matters, merge conflicts where tests added in the main branch are unexpectedly being run), these scenarios are rare enough that I believe the space savings from hiding them are significant enough to justify needing to manually increase verbosity for such cases.
Improvements
Snowpark Python precommit CI jobs finished about 5 min faster with this change, but this should mostly be a consequence of actions runners load differences rather than an actual runtime difference. The heaviest Snowpark pandas daily jobs also finished about 3-5 min faster. The biggest benefit from this PR is a reduction in output size. Consider
Test modin-ubuntu-latest-64-cores-3.12-awsas an example:pytest -vvv --color=yesw/ live_log=True: 13 MBpytest --color=yesw/ live_log=False (default verbosity): 763 KBpytest --color=now/ live_log=False (this PR): 381 KBYes, we indeed went from MB to KB. This is a 34x reduction in log size for the largest tests.