cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
298
Views
2
Helpful
1
Replies

How to generate per-test-suite summary results in parallel pyATS

 

Hi All,

I am currently working on a pyATS automation project where I have implemented parallel execution of testcases using the aetest framework.

So far, my script provides an overall summary at the end of execution, including the number of tests that passed, failed, and errored, along with the full report.

Here is a simplified version of my current code structure:

 

 
from genie.testbed import load from pyats import aetest class CommonSetup(aetest.CommonSetup): @aetest.subsection def connect_to_device(self, testbed) -> None: # Device connection logic pass class TestStp(aetest.Testcase): @aetest.test def test_verify(self, steps # Test logic pass class CommonCleanup(aetest.CommonCleanup): @aetest.subsection def reset_device_configuration(self # Cleanup logic pass

class CommonSetup(aetest.CommonSetup
 
@aetest.subsection
def connect_to_device(self, testbed) -> None:
# Device connection logic
pass

class TestStp(aetest.Testcase
@aetest.test
def test_verify(self, steps
# Test logic
pass

class CommonCleanup(aetest.CommonCleanup
 
@aetest.subsection
def reset_device_configuration(self
# Cleanup logic
pass

What I want to achieve:

  • In addition to the overall results, I want to generate a detailed summary for each test suite executed in parallel.

  • For every test suite, I want to know:

    • Number of passed tests

    • Number of failed tests

    • Number of errored tests

    • Total tests executed

Basically, I want both overall and per-test-suite results after the run, ideally in a single report or JSON summary.

My Question:
What is the best approach to collect per-test-suite statistics in pyATS while running testcases in parallel execution?

  • Should I use shared variables, or is there a built-in pyATS API for this?

  • Are there any examples of suite-level reporting in pyATS for parallel execution?

Thanks in advance for your guidance!
@bigevilbeard 

1 Reply 1

So what i would do it, process runtime job tasks after the parallel execution completes, this would gives you exactly what you need without modifying existing the test code. 

Hope this helps.

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io