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): add test atomic results #937

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

Conversation

mtache
Copy link
Collaborator

@mtache mtache commented Nov 26, 2024

Description

Add anta.result_manager.models.AtomicTestResult model.
Create a atomic_results field in anta.result_manager.models.TestResult model.

The exemple below is a serialisation of the atomic_results field:

            "atomic_results": [
                {
                    "result": "success",
                    "messages": [],
                    "description": "Host 10.0.0.1 (src: Management0, vrf: default, size: 100B, repeat: 2)",
                    "inputs": {"destination": "10.0.0.1", "source": "Management0", "vrf": "default", "repeat": 2, "size": 100, "df_bit": False},
                },
                {
                    "description": "Host 10.0.0.2 (src: Management0, vrf: default, size: 100B, repeat: 2)",
                    "inputs": {
                        "destination": "10.0.0.2",
                        "df_bit": False,
                        "repeat": 2,
                        "size": 100,
                        "source": "Management0",
                        "vrf": "default",
                    },
                    "messages": [],
                    "result": "success",
                },
            ]

Fixes #427

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)
  • Make the reports display atomic results

@mtache mtache changed the title feat(anta): add anta.result_manager.models.AtomicTestResult feat(anta): add test atomic results Nov 26, 2024
@mtache mtache marked this pull request as ready for review November 26, 2024 15:36
Copy link

codspeed-hq bot commented Nov 26, 2024

CodSpeed Performance Report

Merging #937 will degrade performances by 19.2%

Comparing mtache:issue-427 (de4be39) with main (0c32b83)

Summary

❌ 4 regressions
✅ 4 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark main mtache:issue-427 Change
test_anta_dry_run[1-device] 60.2 ms 70.9 ms -14.97%
test_anta_dry_run[2-devices] 106.4 ms 127.6 ms -16.58%
test_get_coroutines[1-device] 46.3 ms 57.1 ms -18.93%
test_get_coroutines[2-devices] 91.1 ms 112.8 ms -19.2%

Copy link

sonarcloud bot commented Dec 10, 2024

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

Successfully merging this pull request may close these issues.

Feat: Add granular results for tests with lists of inputs
3 participants