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(anta.tests): Cleaning up Services tests module (VerifyErrdisableRecovery) #955

Merged
merged 12 commits into from
Jan 14, 2025

Conversation

vitthalmagadum
Copy link
Collaborator

@vitthalmagadum vitthalmagadum commented Dec 9, 2024

Description

Refactoring Services tests module to address the following issues:

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

codspeed-hq bot commented Dec 9, 2024

CodSpeed Performance Report

Merging #955 will not alter performance

Comparing vitthalmagadum:feat/services (1705689) with main (35f246f)

Summary

✅ 22 untouched benchmarks

anta/input_models/services.py Outdated Show resolved Hide resolved
anta/input_models/services.py Outdated Show resolved Hide resolved
anta/input_models/services.py Show resolved Hide resolved
anta/input_models/services.py Outdated Show resolved Hide resolved
anta/input_models/services.py Show resolved Hide resolved
anta/input_models/services.py Outdated Show resolved Hide resolved
anta/tests/services.py Outdated Show resolved Hide resolved
anta/tests/services.py Outdated Show resolved Hide resolved
anta/tests/services.py Outdated Show resolved Hide resolved
continue

if not all([error_reason.status == (act_status := reason_output["status"]), error_reason.interval == (act_interval := int(reason_output["interval"]))]):
self.result.is_failure(f"{error_reason} - Incorrect reason details - Status: {act_status} Interval: {act_interval}")
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
self.result.is_failure(f"{error_reason} - Incorrect reason details - Status: {act_status} Interval: {act_interval}")
self.result.is_failure(f"{error_reason} - Incorrect configuration - Status: {act_status} Interval: {act_interval}")

@gmuloc gmuloc added this to the v1.3.0 milestone Dec 24, 2024
anta/input_models/services.py Outdated Show resolved Hide resolved
anta/input_models/services.py Outdated Show resolved Hide resolved
anta/tests/services.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 if CI passes.

@carl-baillargeon carl-baillargeon merged commit 529e997 into aristanetworks:main Jan 14, 2025
25 checks passed
geetanjalimanegslab pushed a commit to geetanjalimanegslab/anta that referenced this pull request Jan 15, 2025
…ecovery) (aristanetworks#955)

* Refactored VerifyErrdisableRecovery test for input models

* addressed review comments: updated the input model, docstring

* Addressed review comments: updated input models, unit tests for input model

* improved the test coverage

* removed field validator as 'Field' constraints the input

* updated input models and deprecation warning

* updated unit test cases

* Minor fixes

---------

Co-authored-by: Carl Baillargeon <carl.baillargeon@arista.com>
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.

3 participants