Skip to content

Adjust unit test infrastructure to facilitate running tests via IDEs #65

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

Merged
merged 2 commits into from
Dec 20, 2023
Merged

Adjust unit test infrastructure to facilitate running tests via IDEs #65

merged 2 commits into from
Dec 20, 2023

Conversation

per1234
Copy link
Collaborator

@per1234 per1234 commented Dec 20, 2023

The previous configuration worked fine when running pytest directly or via the python:test task. However, some complex configuration of Python IDEs was necessary in order to run the tests via their convenient UI, making the project less friendly to contributors.

The new configuration should allow IDEs to automatically discover tests and run them correctly without any special configuration.

The previous location worked fine when running pytest directly or via the task. It was also possible to run the tests
from the PyCharm UI after a bit of configuration. However, I had no luck with using the VS Code test explorer.

VS Code is likely to be the most common development environment of contributors so it will be important to make it easy
to use with VS Code. Moving pytest.ini file to the root of the repository allowed the VS Code test explorer to correctly
recognize it.
Previously, the python:test task set PYTHONPATH via environment variable. That approach is fine when running the tests
via the task, but meant that PYTHONPATH was not correctly configured when running the tests via the interface of an IDE.
Each contributor would be forced to configure their IDE in order to allow it to run the tests successfully.

Configuring PYTHONPATH via the pytest.ini file makes this universal.
@per1234 per1234 added type: enhancement Proposed improvement topic: infrastructure Related to project infrastructure labels Dec 20, 2023
@per1234 per1234 self-assigned this Dec 20, 2023
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (2f24632) 100.00% compared to head (15af6ae) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #65   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         2           
  Lines          732       732           
=========================================
  Hits           732       732           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@per1234 per1234 merged commit 5494460 into arduino:main Dec 20, 2023
@per1234 per1234 deleted the pytest-config branch December 20, 2023 05:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: infrastructure Related to project infrastructure type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants