-
Notifications
You must be signed in to change notification settings - Fork 334
[VSC-1670] Pytest unit test customize services and glob pattern #1593
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
Conversation
|
Download the artifacts for this pull request: |
|
This works as expected. Thank you. |
radurentea
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, nice work!
a7ea9ce to
1923244
Compare
src/espIdf/unitTest/utils.ts
Outdated
| const filePattern = | ||
| readParameter("idf.unitTestFilePattern", workspaceFolderUri) || | ||
| "**/test/test_*.c"; | ||
| const relativePattern = new RelativePattern(workspaceFolderUri, filePattern); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RelativePattern() constructor will throw an exception with 'Illegal argument: base' when used with my configuration. Using the workspacefolder (with something like workspace.workspaceFolders?.[0]) instead of uri seems to work somehow.
Doctor command for my System (WSL)
report.txt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've update the PR to use workspace Folder instead of Uri. Please take a look at the latest vsix installer https://nightly.link/espressif/vscode-esp-idf-extension/actions/artifacts/3553155120.zip
…oc for customize pytest unit test
571a802 to
15680b9
Compare
Fabricio-ESP
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed working.
Description
Add
idf.pyTestEmbeddedServicesandidf.unitTestFilePatternto allow customize the pytest embedded services and the unit test file GLOB pattern to find test files.Add
Unit Test: Build Unit Test AppandUnit Test: Flash Unit Test Appto just build or just flash the unity-app.This should allow cpp unit testing according to our user @fenderle. Please take a look.
This PR also fix these issue with current Run test implementation.
Check that the
${workspaceFolder}/unity-appexists onTestingtab ->Run testto avoid copy the unity-app again if exists.Allow the user to have workspaceFolder defined tests. This means the unity-app will exists in the current workspace folder and tests found are only within the currently selected workspace folder (with
ESP-IDF: Pick a Workspace FolderCommand) until refresh.Fixes #1248
Fixes #1536
Type of change
Steps to test this pull request
Set
idf.unitTestFilePatternto"/test/test_*.cppto find cpp files instead. Setidf.pyTestEmbeddedServicesto["idf", "qemu"]to use idf and QEMU for testing. Use an ESP-IDF project with unit test according to documentation.View->Testing. You should be able to see the tests that match pattern inidf.unitTestFilePatternRun Test).idf.pyTestEmbeddedServicesdefined services.Unit Test: Build Unit Test AppandUnit Test: Flash Unit Test Appcommands. You should build or flash only output.Run test(play button) on the Testing tab doesn't override the unity-app if it already exists.ESP-IDF: Pick a Workspace FolderCommandExpected behaviour:
Expected output:
How has this been tested?
Manual testing as described above.
Test Configuration:
Checklist