Skip to content

test: add unit tests for environment variable propagation to PyATS subprocesses #709

@aitestino

Description

@aitestino

Description

PR #655 adds NAC_TEST_TEST_DIR to the environment dict passed to PyATS subprocesses in two locations:

  • orchestrator.py (line 319): env["NAC_TEST_TEST_DIR"] = str(self.test_dir) for API tests
  • device_executor.py (line 111): "NAC_TEST_TEST_DIR": str(self.test_dir) for D2D tests

Neither location has unit test coverage verifying that the env var is included in the subprocess environment. If someone accidentally removes either line, the plugin silently degrades to bare filename stems — the exact bug #653 reported.

Missing Test Cases

  1. API tests: verify NAC_TEST_TEST_DIR appears in the env dict passed to subprocess_runner.execute_job()
  2. D2D tests: verify NAC_TEST_TEST_DIR appears in the env dict passed to the D2D job subprocess
  3. Value correctness: verify the env var value matches str(self.test_dir)

Context

Introduced in #655. The env var is the mechanism that connects the orchestrator's test_dir knowledge to the subprocess plugin's name computation. Without tests, this contract is implicit.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions