Skip to content

TPI: Dynamic Run Unittest #21495

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

Closed
3 tasks done
eleanorjboyd opened this issue Jun 26, 2023 · 2 comments
Closed
3 tasks done

TPI: Dynamic Run Unittest #21495

eleanorjboyd opened this issue Jun 26, 2023 · 2 comments

Comments

@eleanorjboyd
Copy link
Member

eleanorjboyd commented Jun 26, 2023

Refs: #21149

Author: @eleanorjboyd

Create Issue


Prerequisites:

Use the following repo of tests or use your own repo of unittest 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

  1. make sure you have the setting "python.experiments.optInto": ["All"]
  2. Open the inc_dec_example_repo/inc_dec_example_test_suite testing repo folder in vscode
  3. Use the create environment command from the command palette, select venv and whatever python version you want >=3.7
  4. In the terminal run python -m pip install pytest
  5. From the command palette run python: configure tests select unittest and "." (root directory) and test_*.py

Part 1: UI Nesting & Run

  1. Go to the testing explorer, and confirm all the tests are discovered

Part 2: Debugging

  1. add some break points to the unittest tests and check to make sure these break points are hit
  2. make sure you can do other normal debugging actions (stop, restart, step over, etc)

Part 3: Large Files

  1. change for i in range(0, 100): in test_subtest.py to be much larger like i in range(0, 10000): and make sure it both works for discovery and run tests (tests should be displayed on the test explorer after discovery and run)

Part 4: Seeing Dynamic Run

  1. Expand the testing explorer UI to see all the nodes (especially test_two_classes.py which has a wait inside one of its tests)
  2. Click run all and make sure that you are seeing the nodes on the test UI finish at different times (ie they don't all resolve together, like some are still spinning while others are complete with a check or an x)
@eleanorjboyd eleanorjboyd added this to the June 2023 milestone Jun 26, 2023
@ghost ghost assigned hbons, amunger and rzhao271 Jun 27, 2023
@lramos15 lramos15 assigned lramos15 and unassigned hbons Jun 27, 2023
This was referenced Jun 27, 2023
@lramos15 lramos15 removed their assignment Jun 27, 2023
@lramos15
Copy link
Member

I had to delete the __pycache__ files locally from the repo if anyone else runs into that issue as well.

@eleanorjboyd
Copy link
Member Author

I had to delete the __pycache__ files locally from the repo if anyone else runs into that issue as well.
Sorry about this- will push an update to the repo

Secondly, this repo requires pytest so I just updated the directions to include installing pytest. This is a requirement for the example repo but not for using unittest in general. (thank you @lramos15 and @lramos15 for pointing this out!)

Thanks!

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

No branches or pull requests

6 participants