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

Add test duration information to output, similar tox #938

Open
chirizxc opened this issue Mar 6, 2025 · 4 comments
Open

Add test duration information to output, similar tox #938

chirizxc opened this issue Mar 6, 2025 · 4 comments

Comments

@chirizxc
Copy link
Contributor

chirizxc commented Mar 6, 2025

How would this feature be useful?

This feature would be useful for tracking test execution time. It would help developers identify performance regressions and optimize their workflows.

Describe the solution you'd like

for example:

nox > Session fastapi_latest was successful (12.34 seconds).
nox > Ran multiple sessions:
nox > * fastapi_0096: success (9.34 seconds)
nox > * fastapi_0109: success (2.12 seconds)
nox > * fastapi_latest: success (0.88 seconds)

or

nox > Session fastapi_latest was successful.
nox > Ran multiple sessions:
nox > * fastapi_0096: success (9.34 seconds)
nox > * fastapi_0109: success (2.12 seconds)
nox > * fastapi_latest: success (0.88 seconds)
nox > Total 12.34 seconds

Describe alternatives you've considered

No response

Anything else?

No response

@DiddiLeija
Copy link
Collaborator

I think this could be a useful feature! But IMO I'd like it to be optional and not the default. Maybe having a --timer flag or something would work, to ask Nox to report test duration?

@namurphy
Copy link

namurphy commented Mar 6, 2025

This sounds useful! I'm reminded of pytest --durations n which lists the tests with the n longest durations. Using --durations as the flag would help for consistency with pytest (with n being optional). I don't see an equivalent flag in tox. 🤔

@chirizxc
Copy link
Contributor Author

chirizxc commented Mar 6, 2025

This sounds useful! I'm reminded of pytest --durations n which lists the tests with the n longest durations. Using --durations as the flag would help for consistency with pytest (with n being optional). I don't see an equivalent flag in tox. 🤔

tox show duration by default

@DiddiLeija
Copy link
Collaborator

Yup, tox shows duration by default. But many Nox users don't mind at all about these details, so in order to keep our simplicity approach, I'd recommend having an optional flag for this (the suggested --duration sounds nice) :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants