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

chore: Add vscode python debugger for anta code #908

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

titom73
Copy link
Collaborator

@titom73 titom73 commented Oct 31, 2024

Description

Implement VSCode Python debugger configuration to run ANTA CLI in debug mode.

This mechanism gives you following options:

  • Add breakpoint to stop code execution
  • Variables watch to inspect content during code execution.
  • Capture Exceptions

And more

Default configuration is based on the following files:

  • .vscode/inventory.yml: List of hosts to use in anta. Use ATD IP address
    schema.
  • .vscode/nrfu.yml: List of NRFU tests to run.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have run pre-commit for code linting and typing (pre-commit run)
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes (tox -e testenv)

Copy link

sonarcloud bot commented Oct 31, 2024

Copy link

codspeed-hq bot commented Oct 31, 2024

CodSpeed Performance Report

Merging #908 will not alter performance

Comparing titom73:chore/python-debugger (556f176) with main (27a1699)

Summary

✅ 8 untouched benchmarks

.vscode/launch.json Outdated Show resolved Hide resolved
@@ -0,0 +1,21 @@
---
anta_inventory:
Copy link
Collaborator

Choose a reason for hiding this comment

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

do we want these in the repo or should it be to each its own?

@@ -1,14 +0,0 @@
{
"ruff.enable": true,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm @mtache ok for you if this goes?

@@ -34,10 +35,11 @@ def test_cli_error_missing(capsys: pytest.CaptureFixture[Any]) -> None:
"""Test ANTA errors out when anta[cli] was not installed."""
with patch.dict(sys.modules) as sys_modules, patch("builtins.__import__", import_mock):
del sys_modules["anta.cli._main"]
del sys_modules["anta.cli.console"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this one needed?

Copy link
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

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

Successfully merging this pull request may close these issues.

2 participants