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

feat(anta.cli): Check catalog functionality #414

Merged
merged 54 commits into from
Nov 10, 2023

Conversation

gmuloc
Copy link
Collaborator

@gmuloc gmuloc commented Sep 27, 2023

Description

  • Add anta check catalog -c <CATALOG>
  • Add AntaCatalog class to manipulate test catalog
    • tests property can be used to get and set tests to the catalog.
    • get_tests_by_tags to filter tests by tag
    • get_tests_by_device to filter tests by device
  • Add AntaCatalogFile pydantic model to provide validation for test catalog YAML file
    catalog = AntaCatalog(filename='/mnt/lab/my_anta_catalog.yaml')
    catalog.check()
  • Add AntaTestDefinition pydantic model to provide validation mainly for programmatic AntaCatalog instantiation.
    AntaCatalog(tests=[(AntaTest, AntaTest.Input())])

Fixes #408
Fixes #407

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)

@gmuloc gmuloc added this to the v0.10.0 milestone Sep 27, 2023
@titom73 titom73 added framework-enhancement New feature or request Anta CLI All things around CLI labels Sep 28, 2023
@gmuloc gmuloc modified the milestones: v0.10.0, v0.11.0 Oct 9, 2023
anta/catalog.py Outdated Show resolved Hide resolved
@github-actions
Copy link
Contributor

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

@mtache mtache marked this pull request as ready for review October 27, 2023 13:15
.vscode/settings.json Outdated Show resolved Hide resolved
@github-actions
Copy link
Contributor

Conflicts have been resolved. A maintainer will review the pull request shortly.

anta/catalog.py Outdated Show resolved Hide resolved
anta/logger.py Outdated Show resolved Hide resolved
Copy link
Contributor

@carl-baillargeon carl-baillargeon left a comment

Choose a reason for hiding this comment

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

LGTM. Tested with AVD as well. Thanks!!

Co-authored-by: Carl Baillargeon <carl.baillargeon@arista.com>
@gmuloc gmuloc merged commit e4c1a90 into aristanetworks:main Nov 10, 2023
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Anta CLI All things around CLI framework-enhancement New feature or request rn: feat(anta.cli)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feat(anta.cli): Implement anta check catalog / anta check inventory Optimize runner once #377 is pushed
4 participants