Skip to content

Commit

Permalink
fix(anta): Reset indexes when catalog tests are set (#928)
Browse files Browse the repository at this point in the history
* Fix(anta): Reset indexes when catalog tests are set

* Update anta/catalog.py

---------

Co-authored-by: Carl Baillargeon <carl.baillargeon@arista.com>
  • Loading branch information
gmuloc and carl-baillargeon authored Feb 7, 2025
1 parent 83660e0 commit bdc0e68
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions anta/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,8 @@ def tests(self, value: list[AntaTestDefinition]) -> None:
msg = "A test in the catalog must be an AntaTestDefinition instance"
raise TypeError(msg)
self._tests = value
# Tests were modified so indexes need to be rebuilt.
self.clear_indexes()

@staticmethod
def parse(filename: str | Path, file_format: Literal["yaml", "json"] = "yaml") -> AntaCatalog:
Expand Down

0 comments on commit bdc0e68

Please sign in to comment.