Context
: Following the investigation in Support Ticket #98593, we identified that the Test Intelligence (TI) agent (both v1 and v2) fails to execute in hardened container.
Current Limitations: The TI agent currently operates on implicit assumptions about the underlying Python environment that cause failures in secure images:
- Root Assumption: The agent attempts to install dependencies (e.g., pip install coverage) assuming it has write access to system-level site-packages. This fails in containers running as a non-root user (e.g., USER 1001).
- Path Assumption: The agent fails to discover coverage reports or dependencies (specifically pytest-cov) if they are installed in custom locations (defined via PYTHONPATH), even if those locations are valid and accessible to the shell.
Desired Behavior / Request:
Environment Agnostic: The TI Agent should respect the existing environment variables (like PYTHONPATH and PATH) and run successfully as a non-root user.
Configurable Paths: If auto-discovery is not possible, provide explicit plugin configuration options to point the agent to the correct coverage or dependency folders.
Documentation: If strict environmental prerequisites (like root access) are unavoidable, they must be explicitly documented in the official setup guide.
Steps to Reproduce (from Ticket #98593):
1) Use a Python base image configured with a non-root user.
2) Install pytest and coverage in a user-local directory (e.g., /home/app/.local).
3) Configure a "Run Tests" step with TI enabled.
Result
: The step fails with ModuleNotFoundError or report discovery errors, despite the tests running successfully in a standard shell step.