Skip to content

Comments

feat(dry-run): add PyATS dry-run support#554

Open
oboehmer wants to merge 4 commits intorelease/pyats-integration-v1.1-betafrom
feat/460-dry-run-pyats-v2
Open

feat(dry-run): add PyATS dry-run support#554
oboehmer wants to merge 4 commits intorelease/pyats-integration-v1.1-betafrom
feat/460-dry-run-pyats-v2

Conversation

@oboehmer
Copy link
Collaborator

Description

Add --dry-run support for PyATS tests. Previously, --dry-run only worked for Robot Framework tests while PyATS tests would execute anyway.

PyATS dry-run behavior:

  • Discovers and categorizes tests (API vs D2D) normally
  • Prints which tests would be executed without actually running them
  • Returns exit code 0 (no tests executed = no failures)

Example output:

======================================================================
🔍 DRY-RUN MODE: Showing tests that would be executed
======================================================================

📋 API Tests (2):
   • tests/verify_sdwan_sync.py
   • tests/verify_aci_tenant.py

📋 D2D/SSH Tests (1):
   • tests/d2d/verify_iosxe_control.py

======================================================================
✅ PyATS dry-run complete (no tests executed)
======================================================================

Closes

Related Issue(s)

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactoring / Technical debt (internal improvements with no user-facing changes)
  • Documentation update
  • Chore (build process, CI, tooling, dependencies)
  • Other (please describe):

Test Framework Affected

  • PyATS
  • Robot Framework
  • Both
  • N/A (not test-framework specific)

Network as Code (NaC) Architecture Affected

  • ACI (APIC)
  • NDO (Nexus Dashboard Orchestrator)
  • NDFC / VXLAN-EVPN (Nexus Dashboard Fabric Controller)
  • Catalyst SD-WAN (SDWAN Manager / vManage)
  • Catalyst Center (DNA Center)
  • ISE (Identity Services Engine)
  • FMC (Firepower Management Center)
  • Meraki (Cloud-managed)
  • NX-OS (Nexus Direct-to-Device)
  • IOS-XE (Direct-to-Device)
  • IOS-XR (Direct-to-Device)
  • Hyperfabric
  • All architectures
  • N/A (architecture-agnostic)

Platform Tested

  • macOS (version tested: macOS with Python 3.12)
  • Linux (distro/version tested: )

Key Changes

  • Add dry_run parameter to PyATSOrchestrator.__init__()
  • Add _print_dry_run_summary() method to display discovered tests
  • Update CombinedOrchestrator to pass dry_run to PyATSOrchestrator
  • Update CLI --dry-run help text to describe PyATS behavior
  • Add 6 unit tests for PyATS dry-run functionality
  • Add 11 E2E tests with mixed Robot + PyATS scenario

Testing Done

  • Unit tests added/updated
  • Integration tests performed
  • Manual testing performed:
    • PyATS tests executed successfully
    • Robot Framework tests executed successfully
    • D2D/SSH tests executed successfully (if applicable)
    • HTML reports generated correctly
  • All existing tests pass (pytest / pre-commit run -a)

Test Commands Used

# Run all tests
uv run pytest -n auto --dist loadscope
# 658 passed, 71 skipped

# Run dry-run specific tests
uv run pytest tests/pyats_core/test_orchestrator_dry_run.py tests/e2e/test_e2e_scenarios.py::TestE2EDryRun -v
# 17 passed

# Pre-commit checks
uv run pre-commit run --all-files
# All passed

Checklist

  • Code follows project style guidelines (pre-commit run -a passes)
  • Self-review of code completed
  • Code is commented where necessary (especially complex logic)
  • Documentation updated (if applicable)
  • No new warnings introduced
  • Changes work on both macOS and Linux
  • CHANGELOG.md updated (if applicable)

Screenshots (if applicable)

N/A

Additional Notes

The dry-run implementation intercepts after test discovery and categorization but before job file generation and execution. This ensures that all validation (file discovery, categorization logic) is exercised while preventing actual test execution.

Add --dry-run support for PyATS tests. Previously, --dry-run only worked
for Robot Framework tests while PyATS tests would execute anyway.

PyATS dry-run behavior:
- Discovers and categorizes tests (API vs D2D) normally
- Prints which tests would be executed without actually running them
- Returns exit code 0 (no tests executed = no failures)

Changes:
- Add dry_run parameter to PyATSOrchestrator
- Add _print_dry_run_summary() method to display discovered tests
- Update CombinedOrchestrator to pass dry_run to PyATSOrchestrator
- Update CLI --dry-run help text to describe PyATS behavior
- Add unit tests for PyATS dry-run functionality
- Add E2E tests with mixed Robot + PyATS scenario
@oboehmer oboehmer added bug Something isn't working new-infra Issues related to the new pyats/robot infra currently under development pyats PyATS framework related labels Feb 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working new-infra Issues related to the new pyats/robot infra currently under development pyats PyATS framework related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant