Skip to content

details impact of specifying CI or BUILD_NUMBER #12578

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

Merged
merged 9 commits into from
Jul 8, 2024

Conversation

MarcBresson
Copy link
Contributor

@MarcBresson MarcBresson commented Jul 5, 2024

I also added the mention in pytest -h. Closes #12577.

FYI, the doc of 8.x is not very well referenced, and when I was looking for this env var, I always was on the doc of version 7.x

@nicoddemus
Copy link
Member

FYI, the doc of 8.x is not very well referenced, and when I was looking for this env var, I always was on the doc of version 7.x

Indeed, we have made steps towards improving this recently.

Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

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

Thanks @MarcBresson for getting this ball rolling.

@@ -1120,7 +1120,11 @@ Environment variables that can be used to change pytest's behavior.

.. envvar:: CI

When set (regardless of value), pytest acknowledges that is running in a CI process. Alternative to ``BUILD_NUMBER`` variable.
When set (regardless of value), pytest acknowledges that is running in a CI process:
Copy link
Member

Choose a reason for hiding this comment

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

It would probably be best for us to create a new docs session somewhere detailing how pytest detects CI and the consequences of that, and link to that session here.

Copy link
Member

Choose a reason for hiding this comment

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

Took a cursory look and did not find a suitable place to add this information to, perhaps we can just create a new document in doc/en/explanation/ci.rst. This could explain the rationale for auto-detecting CI, mention the two variables, and what pytest does differently when running on CI.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I feel like "how we detect we are in a CI env?" and "what are the consequences?" are too short and simple to have a doc session (which I guess is a dedicated file?) somewhere

Copy link
Member

Choose a reason for hiding this comment

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

I disagree, I don't think it is a problem having a short document: it is a place to explain this rationale, and to grow in case we change other behaviors in the future depending if we are on CI or not.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fair enough! I'll try to dig out the original issue to create a good documentation :)

Copy link
Member

Choose a reason for hiding this comment

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

Awesome, thanks! Really appreciate it.

I think a short document with:

  • Rationale
  • How CI is detected
  • Effects on CI

With one or two paragraphs each, would be perfect.

@psf-chronographer psf-chronographer bot added the bot:chronographer:provided (automation) changelog entry is part of PR label Jul 5, 2024
@MarcBresson
Copy link
Contributor Author

the output of pytest -h in the reference doc seemed outdated. Maybe there could be a CI pipeline to check that somewhere ?

@nicoddemus
Copy link
Member

the output of pytest -h in the reference doc seemed outdated. Maybe there could be a CI pipeline to check that somewhere ?

Do not worry about it, we update it at release time.

@MarcBresson
Copy link
Contributor Author

should I drop my commit then ?

@nicoddemus
Copy link
Member

Ahh no harm keeping it. 👍 😁

Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

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

Thanks @MarcBresson this looks great!

Applied some syntax/grammar fixes, but minor ones in general.

LGTM for merging, but will leave it open for a few days in case others want to chime in (specially @The-Compiler which identified the need initially).

@nicoddemus nicoddemus merged commit 6933bef into pytest-dev:main Jul 8, 2024
29 checks passed
Copy link

patchback bot commented Jul 8, 2024

Backport to 8.2.x: 💚 backport PR created

✅ Backport PR branch: patchback/backports/8.2.x/6933bef0b0f193a32a3716a72a26e7184542376b/pr-12578

Backported as #12587

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Jul 8, 2024
Closes #12577

Co-authored-by: Marc Bresson <[email protected]>
Co-authored-by: Bruno Oliveira <[email protected]>
(cherry picked from commit 6933bef)
nicoddemus pushed a commit that referenced this pull request Jul 8, 2024
Closes #12577

Co-authored-by: Marc Bresson <[email protected]>
Co-authored-by: Bruno Oliveira <[email protected]>
(cherry picked from commit 6933bef)

Co-authored-by: Marc Bresson <[email protected]>
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.

Mention CI and BUILD_NUMBER in pytest -h
3 participants