Improve Manager Test CI by reducing conftest.py dependencies
- Dominant language
- Python
- Stars
- 670
- Forks
- 183
- Avg merge
- 17h 7m
- Merged PRs (30d)
- 358
Description
## Overview
The `tests/manager/conftest.py` file has heavy top-level imports that create excessive transitive dependencies. When using `pants test --changed-dependents=transitive`, changes to any manager module trigger all manager tests to run, even if they're unrelated.
## Problem
Current conftest.py imports:
- `ai.backend.manager.server` (build_root_app, config_provider_ctx, etcd_ctx)
- `ai.backend.manager.registry` (AgentRegistry)
- `ai.backend.manager.models` (various model classes)
- `ai.backend.manager.api.context` (RootContext)
- `ai.backend.manager.cli.dbschema` (oneshot)
These imports cause pants to consider all manager tests as dependents of most manager source files.
## Goal
Reduce conftest.py dependencies so that `--changed-dependents=transitive` only runs truly affected tests.
## Approach
1. Remove server.py dependent fixtures
1. Replace cli_schema_oneshot with direct table creation
1. Move models imports to individual test files
1. Remove registry.py dependent fixtures
1. Remove RootContext dependent fixtures
JIRA Issue: BA-3339
Contributor guide
Assessment
This issue has not been assessed yet.