Refs (overarching issue): #19098
Author: @eleanorjboyd
Create Issue
Thank you for doing this testing! I apologize for how long it is and please let me know if you have any questions!
Prerequisites:
- Use the following repo of tests or use your own repo of pytests https://github.com/eleanorjboyd/inc_dec_example_repo
Background Information:
This rewrite is for the underlying infrastructure of how python handles testing therefore all behavior visible to the user should be pretty much the same (minus maybe some error logs going in a better place or test names shortened). Therefore throughout this testing, you can reference the current testing in Python to compare if you think something doesn't look right (or you can always post here too!).
Steps:
Part 0: Setup
- make sure you have the setting
"python.experiments.optInto": ["All"], in your user settings json
- set the log level to trace
- go to the python output channel and search for
pythonTestAdapter and something should come up that looks like this: 2023-05-26 11:12:04.297 [info] Experiment 'pythonTestAdapter' is active (this confirms you are actively in the experiment)
- Now open the
inc_dec_example_repo/inc_dec_example_test_suite testing repo folder in vscode
- use the
create environment command from the command palette, select venv and whatever python version you want >=3.7
- in the terminal run
python -m pip install pytest
- from the command palette run
python: configure tests select unittest and "." (root directory) and test_*.py
Part 1: Debugging
- Go to the testing explorer, and confirm all the tests are discovered and nested correctly by file structure.
- add some break points to the unittest tests and check to make sure these break points are hit
- make sure you can do other normal debugging actions (stop, restart, step over, etc)
Part 2: Large repo
- If you have a very large python repo definitely try it on that repo but if not you can use the provided repo
inc_dec_example_repo/inc_dec_example_test_suite
- if you are using the provided repo: in the
test_subtests.py file, change for i in range(0, 10): to be much larger like for i in range(0, 10000): and make sure it both works for discovery and run tests (the subtests should not be displayed in the test explorer after discovery only after run)
- if you are using your own: make sure all tests can be discovered and run as expected within your large repo when set to use unittests
Part 3: Multiroot Workspace
- now you are going to open
inc_dec_example_repo/folder3 but open it as a multiroot workspace (open the file testing3/testing3.code-workspace)
- go to the testing panel, make sure that the tests are set up with the correct setting per workspace. This means that
testFolder1 and testFolder3 are pytest and testFolder2 is unittest and they should all be displayed the correct tests based on this type.
Refs (overarching issue): #19098
Complexity: 4
Author: @eleanorjboyd
Create Issue
Thank you for doing this testing! I apologize for how long it is and please let me know if you have any questions!
Prerequisites:
Background Information:
This rewrite is for the underlying infrastructure of how python handles testing therefore all behavior visible to the user should be pretty much the same (minus maybe some error logs going in a better place or test names shortened). Therefore throughout this testing, you can reference the current testing in Python to compare if you think something doesn't look right (or you can always post here too!).
Steps:
Part 0: Setup
"python.experiments.optInto": ["All"],in your user settings jsonpythonTestAdapterand something should come up that looks like this:2023-05-26 11:12:04.297 [info] Experiment 'pythonTestAdapter' is active(this confirms you are actively in the experiment)inc_dec_example_repo/inc_dec_example_test_suitetesting repo folder in vscodecreate environmentcommand from the command palette, select venv and whatever python version you want >=3.7python -m pip install pytestpython: configure testsselectunittestand"." (root directory)andtest_*.pyPart 1: Debugging
Part 2: Large repo
inc_dec_example_repo/inc_dec_example_test_suitetest_subtests.pyfile, changefor i in range(0, 10):to be much larger likefor i in range(0, 10000):and make sure it both works for discovery and run tests (the subtests should not be displayed in the test explorer after discovery only after run)Part 3: Multiroot Workspace
inc_dec_example_repo/folder3but open it as a multiroot workspace (open the filetesting3/testing3.code-workspace)testFolder1andtestFolder3are pytest andtestFolder2is unittest and they should all be displayed the correct tests based on this type.