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

When running an individual test it tries to run all test #21

Closed
johlju opened this issue Aug 11, 2021 · 14 comments
Closed

When running an individual test it tries to run all test #21

johlju opened this issue Aug 11, 2021 · 14 comments

Comments

@johlju
Copy link
Contributor

johlju commented Aug 11, 2021

When choosing "Run Test" from the individual test "list" (first play symbol):

image

it tries to run all found tests

image

If choosing the second "play button" called "Debug Test" the individual test run as expected.

FYI, it stops and asks for MainGitBranch because it runs a test that is not part of the project, a test that requires parameters to run. See issue #20.

@JustinGrote
Copy link
Collaborator

I couldn't reproduce, I'll need to check out your repo.

@johlju
Copy link
Contributor Author

johlju commented Aug 11, 2021

This seems to only happen when the list is collapsed. If expanding the test file to see individual tests inside the test file "Run Test" runs the test.

@JustinGrote
Copy link
Collaborator

JustinGrote commented Aug 11, 2021

This seems to only happen when the list is collapsed. If expanding the test file to see individual tests inside the test file "Run Test" runs the test.

Oh in that case this is a dupe of #14 if you try to run tests before "discovering" them, I just need to bolt in some logic to detect if a testfile hasn't been discovered yet and do a discovery for the adapter.

@johlju
Copy link
Contributor Author

johlju commented Aug 17, 2021

@JustinGrote this was not fixed by #14.

RunAllTests

@JustinGrote
Copy link
Collaborator

I saw it pop up "maingitbranch" there, do your tests require parameters or prompts? Interactive tests are not supported at the moment, that would be a separate enhancement.

@johlju
Copy link
Contributor Author

johlju commented Aug 17, 2021

No, the issue is that it runs all 228 files even when I start just one.

The prompt is from a test that is not part of the project that should not be shown in test explorer at all (will be fixed when issue #20 is resolved). It just happens to be that test that is the first file to run of the 228 files.

@JustinGrote
Copy link
Collaborator

The logic looks correct, when you click run it's passing your specific test file and line 447 as the inclusion filter.

Can you take that second PesterInterface command that it runs and change the verbosity to diagnostic and psot the output?

@johlju
Copy link
Contributor Author

johlju commented Aug 17, 2021

When running "Debug Test" it always work. The problem is only with "Run Test".
DebugTestSingleFile

@johlju
Copy link
Contributor Author

johlju commented Aug 17, 2021

Not sure you have any use of the output?

@JustinGrote
Copy link
Collaborator

Debug and Run have different verbosity level settings in vscode, try setting them the same. Also make sure your $PesterPreference isn't set.
image

@johlju
Copy link
Contributor Author

johlju commented Aug 17, 2021

Ah didn't know that setting - learned something new. 🙂 The one "Output Verbosity" were set to "FromPreference". Changing it to Diagnostic made "Run test" work. Setting it to any value other than "FromPreference" makes "Run Test" work.

@johlju
Copy link
Contributor Author

johlju commented Aug 17, 2021

It should default to "Normal" when it is set to "FromPreference". Seems it does not?

@JustinGrote
Copy link
Collaborator

Like I said probably a bug, I'll look into it and open this as a new issue.

@johlju
Copy link
Contributor Author

johlju commented Aug 17, 2021

At least we found the issue. Thanks for the guidance! 😃

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

No branches or pull requests

2 participants