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

[VSC-1515] fix unit tests not being refresh #1338

Merged
merged 2 commits into from
Nov 19, 2024

Conversation

brianignacio5
Copy link
Collaborator

@brianignacio5 brianignacio5 commented Nov 8, 2024

Description

Fix unit tests not being refreshed when Refresh tests button is clicked.

Fixes #1336

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Steps to test this pull request

  1. Open a ESP-IDF project like unity-test that contains test cases as described in https://docs.espressif.com/projects/vscode-esp-idf-extension/en/latest/additionalfeatures/unit-testing.html
  2. Add a new test case in any file test_*.c file
  3. Press menu View then Testing Click the Refresh Tests button in the top of the side (Looks like a loading button)
  4. The new test should appear.
  • Expected behaviour:
    Test cases should be added, deleted or modified when Refresh Tests button is executed and test cases have changed.

  • Expected output:

How has this been tested?

Manual testing using the unity-test esp-idf example.

Test Configuration:

  • ESP-IDF Version: 5.0
  • OS (Windows,Linux and macOS): MacOS

Checklist

  • PR Self Reviewed
  • Applied Code formatting
  • Added Documentation
  • Added Unit Test
  • Verified on all platforms - Windows,Linux and macOS

@brianignacio5 brianignacio5 added the bugfix Fixing some issue and bug in this PR label Nov 8, 2024
@brianignacio5 brianignacio5 added this to the 1.9.0 milestone Nov 8, 2024
@brianignacio5 brianignacio5 self-assigned this Nov 8, 2024
Copy link

github-actions bot commented Nov 8, 2024

Download the artifacts for this pull request:
You can test these changes by installing this VSIX by click menu View -> Command Palette..., type Install from VSIX and then select downloaded esp-idf-extension.vsix file to install the extension.

@radurentea
Copy link
Collaborator

LGTM

@Fabricio-ESP Fabricio-ESP changed the title fix unit tests not being refresh [VSC-1515] fix unit tests not being refresh Nov 15, 2024
@Fabricio-ESP
Copy link
Collaborator

Hi @brianignacio5 ,
Confirmed that the new fix capture new test_ files created for the components. I may not be fully familiar with the functionality but is it correct to only look for test_ files in the components folder?

Also noticed that if I rename a test file and try to update the testing tab I see a new entry with the new file name, fur the application does not remove the old entry, so it ends up showing 2 files with the old and new name. If I restart VSCode than it removes the old entry. Is there a reason we would like to keep the old filename on the testing tab?

@brianignacio5
Copy link
Collaborator Author

Hi @brianignacio5 , Confirmed that the new fix capture new test_ files created for the components. I may not be fully familiar with the functionality but is it correct to only look for test_ files in the components folder?

Yes that is correct that is looking for test_* files.

Also noticed that if I rename a test file and try to update the testing tab I see a new entry with the new file name, fur the application does not remove the old entry, so it ends up showing 2 files with the old and new name. If I restart VSCode than it removes the old entry. Is there a reason we would like to keep the old filename on the testing tab?

Updated the PR to delete all items before creating them on refresh. PTAL again @Fabricio-ESP

Copy link
Collaborator

@Fabricio-ESP Fabricio-ESP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed working as expected.
Testing tab was able to locate test files and update the list upon clicking the refresh button.
Note that test files should start with test_ and should be inside a folder called test.
This is not properly set int he unit_test example provided by IDF and might confuse the users.

@brianignacio5 brianignacio5 merged commit 161ec29 into master Nov 19, 2024
6 checks passed
@brianignacio5 brianignacio5 deleted the bugfix/refresh-unit-tests branch November 19, 2024 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Fixing some issue and bug in this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request]: Add button to refresh tests in testing tab (VSC-1515)
3 participants