Skip to content

Unittest top-level-directory option#19398

Merged
karthiknadig merged 4 commits into
microsoft:mainfrom
dazfuller:dazfuller/unittest-topleveldir
Jul 14, 2022
Merged

Unittest top-level-directory option#19398
karthiknadig merged 4 commits into
microsoft:mainfrom
dazfuller:dazfuller/unittest-topleveldir

Conversation

@dazfuller

@dazfuller dazfuller commented Jul 2, 2022

Copy link
Copy Markdown

This is related to issues #5721 and #6881 and adds support for the -t/--top-level-directory argument for test discovery when using unittest.

The following changes have been made.

  • add new function unittestGetTopLevelDirectory to get top level directory value from options
  • If provided then pass this value to the test discovery and test runner processes
    • If not provided then it is omitted so that tests continue to run as they do currently
  • Uses the --ut option already available in the visualstudio_py_testlauncher.py script

The import cleanup in the python files was done automatically by pylance.

@ghost

ghost commented Jul 2, 2022

Copy link
Copy Markdown

CLA assistant check
All CLA requirements met.

@karthiknadig
karthiknadig self-requested a review July 7, 2022 18:18
@karthiknadig karthiknadig added the bug Issue identified by VS Code Team member as probable bug label Jul 7, 2022
@dazfuller

Copy link
Copy Markdown
Author

Reviewed the testing page on the wiki, the edited TS files are not currently part of any test suite. Please advise

@karthiknadig karthiknadig added the skip tests Updates to tests unnecessary label Jul 7, 2022
@karthiknadig

Copy link
Copy Markdown
Member

@dazfuller I have cleared the check for you. No worries.

@karthiknadig
karthiknadig requested a review from anthonykim1 July 7, 2022 19:09
@karthiknadig
karthiknadig merged commit 4ecf02b into microsoft:main Jul 14, 2022
@dazfuller
dazfuller deleted the dazfuller/unittest-topleveldir branch July 18, 2022 13:42
wesm pushed a commit to posit-dev/positron that referenced this pull request Mar 28, 2024
* update unittest discovery to work with user defined top-level-directory

* change to make top-level-dir optional

* add top-level-dir to unittest run args

* update test discovery to use top-level-directory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Issue identified by VS Code Team member as probable bug skip tests Updates to tests unnecessary

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants