FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Only enable CI mode is `$CI` or `$BUILD_NUMBER` is set to a non-empty string by macdjord · Pull Request #13772 · pytest-dev/pytest · GitHub

Only enable CI mode is $CI or $BUILD_NUMBER is set to a non-empty string - #13772

Merged
bluetech merged 1 commit into
pytest-dev:mainfrom
macdjord:improve_ci_detection
Oct 1, 2025
Merged

Only enable CI mode is $CI or $BUILD_NUMBER is set to a non-empty string#13772
bluetech merged 1 commit into
pytest-dev:mainfrom
macdjord:improve_ci_detection

Conversation

macdjord commented Oct 1, 2025

Copy link
Copy Markdown

Previously, if either $CI or $BUILD_NUMBER was defined, CI mode would be activated, even if the variable was set to the empty string. This had some unfortunate consequences:

  • The easy and obvious method of setting those variables, i.e. CI="${OTHER_VAR}", would not work, because $CI would always end up being defined even if $OTHER_VAR was undefined.
  • The easy and obvious method of clearing those variables at runtime, i.e. CI="" pytest ..., would not work, because again $CI would still be defined even though it was blank.

Now, at least one of those variables must be set to a non-empty string in order to enable CI mode.

Closes #13766

psf-chronographer Bot added the bot:chronographer:provided (automation) changelog entry is part of PR label Oct 1, 2025

Copy link
Copy Markdown
Member

Thank you for opening the issue, #13767 is moving it elsewhere you'll probably need to rebase on it when it's merged.

bluetech left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks!

No worries about the rebase, I will handle it, along with a few minor changes. Out of abundance of caution I will also mark this a breaking change. The next release is 9.0 so that's OK :)

… string

Previously, if either env variable was defined, CI mode would be activated,
even if the variable was set to the empty string.
This had some unfortunate consequences:
* The easy and obvious method of setting those variables,
  i.e. `CI="${OTHER_VAR}"`,
  would not work,
  because `$CI` would always end up being defined
  even if `$OTHER_VAR` was undefined.
* The easy and obvious method of clearing those variables at runtime,
  i.e. `CI="" pytest ...`,
  would not work,
  because again `$CI` would still be defined even though it was blank.

Now, at least one of those variables must be set to a non-empty string
in order to enabled CI mode.

Closes pytest-dev#13766
bluetech force-pushed the improve_ci_detection branch from cfe90bc to 304743c Compare October 1, 2025 07:41

bluetech commented Oct 1, 2025

Copy link
Copy Markdown
Member

macos CI is down, I doubt it's relevant here, so force-merging.

bluetech merged commit 42c9fe0 into pytest-dev:main Oct 1, 2025
28 of 32 checks passed
macdjord deleted the improve_ci_detection branch October 1, 2025 08:02
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

Labels

bot:chronographer:provided (automation) changelog entry is part of PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI Pipeline Detection Issues

3 participants


Back | FazBrowse Home | New Git URL