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

tox hook workflow #478

Closed
obestwalter opened this issue Mar 12, 2017 · 10 comments
Closed

tox hook workflow #478

obestwalter opened this issue Mar 12, 2017 · 10 comments
Labels
area:configuration level:medium rought estimate that this might be neither easy nor hard to implement

Comments

@obestwalter
Copy link
Member

obestwalter commented Mar 12, 2017

(See #421 (comment) and the following comments for the initial discussion)

Summary: a tox run goes through distinct phases. This is implicitly explained in the documentation and becomes obvious when working a while with tox (especially when running tox -vv. Nevertheless it might help make this a bit more explicit in e.g. the documentation. It also might help in further development to have some "official" terminology for those phases. Might also help with naming of new hooks, etc.

If you look into the code there is the action class, which has reporting hooks to log start and finish of those actions. Those are phases in one respect, but don't map entirely satisfactorily to what the user might think of as phases. The actions that are reported are: packaging, getenv, finishvenv, developpkg, installpkg, envreport, runtests. They are also marked by the context in which they run, which is GLOB for global context and (some envname) for environment context (which might be one of the default environments or whatever environment the user has created).

The test run is executed in subcommand_test.

Those map vaguely onto what a tox user might think about how to organize things (and maybe where to hook into to change the behaviour), but not quite. e.g. finding the interpreter executable is not mirrored as action. I have not looked into the code in enough detail why that is.

Looking at a tox run from the outside, the phases of a test run (meaning: show help, show config or show envs not taken into account here) could be described as:

  • GLOB initialization
  • GLOB package build (optional)
  • ENV interpreter discovery
  • ENV environment creation
  • ENV dependency installation (optional)
  • ENV package under test installation (optional)
  • ENV command execution (optional) (not atm (Regression since 2.5.0: empty commands section causes error #454) but with next release again).
  • GLOB report results
@gaborbernat
Copy link
Member

shouldn't there be another reporting phase at the end, again with GLOB scope?

@gaborbernat
Copy link
Member

I've created a diagram of the stages, and the flow of the application:

Tox phases

Let me know what you think 👍

@obestwalter
Copy link
Member Author

Great! Which tool did you use for that? Would it get too cuttered, if it would be mentioned which hook are called in which phase?

@gaborbernat
Copy link
Member

used Lucid chart diagram, I can give it a try and see how it looks; you are referring to the plugin hooks, yes?

@obestwalter
Copy link
Member Author

@gaborbernat
Copy link
Member

I'll take this.

@obestwalter obestwalter added area:configuration level:medium rought estimate that this might be neither easy nor hard to implement and removed documentation labels Sep 4, 2017
@gaborbernat
Copy link
Member

Duplicate of #867.

@obestwalter
Copy link
Member Author

Normally the duplicate is the issue that was opened later 👅

@gaborbernat gaborbernat changed the title Naming and describing phases of a tox test run tox hook workflow Jul 10, 2018
@gaborbernat
Copy link
Member

I'm actually will reopen this with a different scope: presenting the flow with hooks for plugin writers. Different audience.

@obestwalter
Copy link
Member Author

obestwalter commented Jul 10, 2018

I think that is a good idea. Reminds me of a talk I heard from Daniele Procida: https://www.youtube.com/watch?v=azf6yzuJt54

General idea is to always have the audience in mind and write the docs according to that. So good idea to separate that with different audiences in mind 👍

YouTube
"Speaker: Daniele Procida Nearly everyone (especially in the Python community) agrees that good documentation is important to the success of software project...

@tox-dev tox-dev locked and limited conversation to collaborators Jan 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area:configuration level:medium rought estimate that this might be neither easy nor hard to implement
Projects
None yet
Development

No branches or pull requests

2 participants