Comments (3)
Thanks for raising this :)
Implementing tests as coroutines is definitely needed for this framework to scale.
Do you have any example of a test that would require to be run sequentially ?
from anta.
Thanks for raising this :) Implementing tests as coroutines is definitely needed for this framework to scale. Do you have any example of a test that would require to be run sequentially ?
I think it could be useful for large deployments, or where there are a vast number of tests with high correlation. For example, some BGP overlay session tests wouldn't make sense if the loopback is not defined, therefore you could cluster tests together, running the tests inside the cluster as co-routines and separate cluster tests in sequence. For instance:
- Test group 1:
- test_function_1
- test_function_2
- test_function_3
- Test group 2:
- test_function_4
- test_function_5
- test_function_6
Where usually the functions in test_group1 need to pass in order to make sense out of the tests in group 2, etc.
async def run_sequence(*functions: Awaitable[Any]) -> None:
for function in functions:
await function
async def run_parallel(*functions: Awaitable[Any]) -> None:
await asyncio.gather(*functions)
await run_sequence(
run_parallel(
test_function_1(),
test_function_2(),
test_function_3()
),
run_parallel(
test_function_4(),
test_function_5(),
test_function_6()
)
)
Other use cases could be managing how tests run across the inventory of devices (e.g., first spines, then the leafs, etc). This kind of flexibility may allow to easily optimize performance based on the inventory and test catalog...
from anta.
PR #122 implements asyncio in ANTA. However, we still cannot define a test hierarchy/dependency if some of them needs to be run sequentially: everything runs in parallel today.
However, we have written the anta_test decorator to factorise code that is identical across all tests.
from anta.
Related Issues (20)
- Add the test case to verify the expiry of ssl cerificate
- CI: enable Ruff
- Relax Interface custom type to be case insensitive
- anta get from-ansible request for --username attribut HOT 1
- Add the test case to verify the BGP redistribution
- Add the test case to verify the BGP peering capabilities
- Catch `privileged mode required` and display a warning suggesting to use `--enable`
- Add the test case to verify the BGP neighbor authentication
- Add the test case to verify the BGP neighbor community
- Add the test case to verify the BFD session, timers and peers
- Update the pass/fail criteria for testcase VerifyBFD
- Add the test case to verify the BGP ECMP path install
- Add the test case to verify the BGP EVPN type-3 routes
- Add the test case to verify the BGP hold and keep alive timers
- Ship a Click activation script file with the build to activate autocompletion
- `clear hardware counter drop` is not supported on some platforms HOT 1
- AntaCommand and AntaTemplate should all have a revision number
- Test: Unit tests for `get_failed_logs`
- Add the test case to verify the system information(name, location, contact)
- Add the test case to verify the system login messages(login banner, motd banner)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from anta.