Skip to content

Use tox testenv listing for generating the tree view #34

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

s-hemer
Copy link

@s-hemer s-hemer commented Apr 27, 2023

This PR is my suggestion to solve #33. It also cleans up some stuff. The last commit is subject for further discussions, works for my use-case but I will try to create a more generic test setup.

@The-Compiler
Copy link
Owner

Thanks! I still think it'd be a cleaner solution to open a new terminal for every project directory and run tox there. I'll need to take a closer look, but I'm a bit busy this and next week, so it might take a bit.

@s-hemer
Copy link
Author

s-hemer commented Apr 27, 2023

Don't hurry, I just wanted to get that out as I will also have to move to something else. Yet, don't want to loose it.

s-hemer added 5 commits April 28, 2023 13:57
If multiple projects with tox.ini's are present in the workspace, the
test tree view contains just multiple 'tox.ini' entrys with no
visible way to differentiate. Use the description field and fill with
project/folder name.
Cleaned some trailing whitespaces while at it.
toxTaskProvider may re-use even more from run.ts. To get a better
overview, at least collect the tox commands at a common place there.
Use the same way to split the output of tox's testenv here as in run.ts
Did not adopt the indentation style of toxTaskProvider (used four spaces
instead of tabs) for cleaner diff.

Signed-off-by: Steffen Hemer <[email protected]>
…here

Instead of having two code sections with the same purpose (one with a
more elaborate error handling), fuse them to one.
listed testenv

Instead of parsing the tox.ini file for testenv with a regex,
testController uses the output from tox and tries to locate the listed
testenvs (with the regex) within the file to add the test task marker.
Additionally, it adds all testenvs that could not be located (i.e. the
ones from permutations) to line zero. This lets them at least appear
correctly in the tree view.
To run tests from tox.ini files from different projects, create (and
re-use) separate terminals. Terminal identifier uses label and
description of root test item (the tox.ini).
@s-hemer
Copy link
Author

s-hemer commented Apr 28, 2023

I moved the additional description to the description field of testItem (makes sense) and just use separate terminals now (named after the root test item's label and description).

@cidrblock
Copy link

TY for working on this!

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

Successfully merging this pull request may close these issues.

3 participants