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

Fix test integration with IDEs #1914

Merged
merged 1 commit into from Feb 17, 2022
Merged

Conversation

ssbarnea
Copy link
Member

@ssbarnea ssbarnea commented Feb 17, 2022

This should fix debugging tests in both vscode and pycharm. We need to be sure that we disable pytest-cov inside pytest.ini and enable it only within tox.ini file.

This ensures that we can:

  • run/debug with pytest from console (outside tox)
  • run/debug from vscode
  • run/debug from pycharm
  • capture coverage on CI
  • capture coverage with simple tox -e py (no posargs)

Related: #1912 #1909

@ssbarnea ssbarnea requested a review from a team as a code owner February 17, 2022 08:57
@ssbarnea ssbarnea requested review from relrod, ganeshrn and priyamsahoo and removed request for a team February 17, 2022 08:57
@github-actions github-actions bot added the bug label Feb 17, 2022
@ssbarnea ssbarnea marked this pull request as draft February 17, 2022 10:10
Copy link
Member

@webknjaz webknjaz left a comment

Choose a reason for hiding this comment

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

The base args must be in pytest.ini. Maintaining them only in tox will create an inconsistent experience. tox.ini is only there for conditional overrides.

@ssbarnea
Copy link
Member Author

The base args must be in pytest.ini. Maintaining them only in tox will create an inconsistent experience. tox.ini is only there for conditional overrides.

If you have an alternative that is fixing all the points noted in the description, I would be happy to see it. So far I was not the only contributor that found these issues inconvenient and I do not want to force anyone willing to contribute to alter his environment to make it work, especially as that might be even impossible without altering tracked files.

Copy link
Contributor

@cidrblock cidrblock left a comment

Choose a reason for hiding this comment

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

Anything we can do to ensure the first time test running/debugging experience is smooth I'll +1

@ssbarnea ssbarnea merged commit 53d3039 into ansible:main Feb 17, 2022
@ssbarnea ssbarnea deleted the fix/ide-integration branch February 17, 2022 13:39
@ssbarnea
Copy link
Member Author

I that brings any regressions, we will fix them in follow-ups.

@cognifloyd Please test and report if this is improving the experience for you.

@cognifloyd
Copy link
Member

Nice. Works great in pycharm.
I setup my args in pycharm's settings: -ra -l --tb=short --strict-markers
(ie "Additional Arguments" in the run templates for "autodetect" and "pytest")

@ssbarnea
Copy link
Member Author

Nice. Works great in pycharm. I setup my args in pycharm's settings: -ra -l --tb=short --strict-markers (ie "Additional Arguments" in the run templates for "autodetect" and "pytest")

Probably we can put back some arguments in pytest.ini if they do not break other tools.

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

Successfully merging this pull request may close these issues.

None yet

4 participants