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(eos_validate_state): ANTA New action plugin to generate the reports #3352

Merged

Conversation

carl-baillargeon
Copy link
Contributor

@carl-baillargeon carl-baillargeon commented Nov 15, 2023

Change Summary

New action plugin to generate the reports from the ANTA test results.

Related Issue(s)

#3304

Component(s) name

arista.avd.eos_validate_state ANTA Mode

Proposed changes

eos_validate_state_reports.py is the action plugin.

The current eos_validate_state_runner will now save the results into a JSON file per host in the test_results_dir directory. The report plugin will load all results from all play hosts, process them and gather statistics.

ResultsManager class is responsible of storing the results and statistics and will be consumed by CSVReport and MDReport classes to generate the CSV and MD reports.

only_failed_tests can still be used to only write the failed tests in the reports.

validation_report_csv and validation_report_md can be set to false to avoid report generation and only run the tests.

How to test

---
- name: Validate AVD
  hosts: GLOBAL
  tasks:
    - name: Validate states on EOS devices
      import_role:
        name: arista.avd.eos_validate_state
      vars:
        # Some of these are defaults but can be changed
        validation_role:
          only_failed_tests: False
          validation_report_csv: True
          validation_report_md: True
        # To enable ANTA
        use_anta: True
        save_catalog: True
        logging_level: WARNING

Checklist

User Checklist

  • Module documentation and general documentation
  • Add a debug option to save the raw ANTA results
  • Add an option to have a report per device? No

Repository Checklist

  • My code has been rebased from devel before I start
  • I have read the CONTRIBUTING document.
  • My change requires a change to the documentation and documentation have been updated accordingly.
  • I have updated molecule CI testing accordingly. (check the box if not applicable)

@github-actions github-actions bot added the type: documentation Improvements or additions to documentation label Nov 28, 2023
Copy link

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

@carl-baillargeon carl-baillargeon added this to the v4.5.0 milestone Dec 13, 2023
@github-actions github-actions bot added the state: conflict PR with conflict label Dec 14, 2023
Copy link

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

@github-actions github-actions bot removed the state: conflict PR with conflict label Dec 14, 2023
Copy link

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

@gmuloc
Copy link
Contributor

gmuloc commented Dec 14, 2023

To summarize most of @JulioPDX's comments in the PR - the auto generated doc for module where we are using ansible-doc-extractor would need some love for lists and some escaping being done (e.g. ;). which renders weirdly in mkdocs

Copy link
Contributor

@gmuloc gmuloc left a comment

Choose a reason for hiding this comment

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

LGTM :shipit:

@gmuloc gmuloc added the one approval This PR has one approval and is only missing one more. label Dec 14, 2023
Copy link
Member

@carlbuchmann carlbuchmann left a comment

Choose a reason for hiding this comment

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

LGTM - validated in lab

@carlbuchmann carlbuchmann merged commit 0a8ddf8 into aristanetworks:devel Dec 15, 2023
38 checks passed
@carl-baillargeon carl-baillargeon deleted the feat/plugin-anta-report branch May 18, 2024 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
EPIC - eos_validate_state ANTA one approval This PR has one approval and is only missing one more. rn: Feat(eos_validate_state) role: eos_validate_state state: CI Updated CI scenario have been updated in the PR state: Documentation role Updated type: documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants