Skip to content

NO-SNOW: Lower pytest verbosity level in CI#4122

Open
sfc-gh-joshi wants to merge 5 commits intomainfrom
joshi/lower-pytest-verbosity
Open

NO-SNOW: Lower pytest verbosity level in CI#4122
sfc-gh-joshi wants to merge 5 commits intomainfrom
joshi/lower-pytest-verbosity

Conversation

@sfc-gh-joshi
Copy link
Contributor

@sfc-gh-joshi sfc-gh-joshi commented Mar 13, 2026

  1. Which Jira issue is this PR addressing? Make sure that there is an accompanying issue to your PR.

    Fixes SNOW-NNNNNNN

  2. Fill out the following pre-review checklist:

    • I am adding a new automated test(s) to verify correctness of my new code
      • If this test skips Local Testing mode, I'm requesting review from @snowflakedb/local-testing
    • I am adding new logging messages
    • I am adding a new telemetry message
    • I am adding new credentials
    • I am adding a new dependency
    • If this is a new feature/behavior, I'm adding the Local Testing parity changes.
    • I acknowledge that I have ensured my changes to be thread-safe. Follow the link for more information: Thread-safe Developer Guidelines
    • If adding any arguments to public Snowpark APIs or creating new public Snowpark APIs, I acknowledge that I have ensured my changes include AST support. Follow the link for more information: AST Support Guidelines
  3. 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 -vvv way 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:

  • Setting verbosity to default: at -v or 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.
  • Setting --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.
  • Unsetting log_cli by default, while keeping log_cli_level = DEBUG. When log_cli = True is 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-aws as an example:

  • pytest -vvv --color=yes w/ live_log=True: 13 MB
  • pytest --color=yes w/ live_log=False (default verbosity): 763 KB
  • pytest --color=no w/ live_log=False (this PR): 381 KB

Yes, we indeed went from MB to KB. This is a 34x reduction in log size for the largest tests.

@sfc-gh-joshi sfc-gh-joshi added the NO-CHANGELOG-UPDATES This pull request does not need to update CHANGELOG.md label Mar 16, 2026
@sfc-gh-joshi sfc-gh-joshi marked this pull request as ready for review March 17, 2026 20:59
@sfc-gh-joshi sfc-gh-joshi requested review from a team as code owners March 17, 2026 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

NO-CHANGELOG-UPDATES This pull request does not need to update CHANGELOG.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant