Skip to content

feat(test): add test infrastructure and fix test suite (Phase T0) - #12

Merged
manas-fortifyroot merged 3 commits into
fr-v0.52.6.xfrom
feat/test-infrastructure-t0
Mar 28, 2026
Merged

feat(test): add test infrastructure and fix test suite (Phase T0)#12
manas-fortifyroot merged 3 commits into
fr-v0.52.6.xfrom
feat/test-infrastructure-t0

Conversation

@manas-fortifyroot

Copy link
Copy Markdown

Summary

  • Rewrite run-tests.sh to use per-package isolated venvs (uv sync + uv run pytest) instead of a shared venv, eliminating cross-package dependency conflicts
  • Add --all, --cassettes, --python flags and platform/version-aware skip logic
  • Update fr-pr.yaml CI with all-tests job across Python 3.10–3.13
  • Fix test failures across 9 packages (test isolation bugs, hardcoded attribute strings, missing deps, stale data cleanup, version pins)
  • Add VCR conftest template and .env.test.example for future test phases

Test results

Platform Pass Fail Skip
macOS x86_64 31 0 4
Ubuntu 22.04 34 0 1

Test plan

  • ./scripts/run-tests.sh --all passes on macOS (0 failures)
  • ./scripts/run-tests.sh --fr passes on macOS (0 failures)
  • Full suite verified on Ubuntu 22.04 via Docker (0 failures)
  • No uv.lock files modified in the commit
  • No .bin or test data artifacts committed

Rewrite run-tests.sh to use per-package isolated venvs (uv sync + uv run
pytest) instead of a single shared venv. This eliminates dependency
conflicts across the 35 instrumentation packages and matches the upstream
CI approach.

Test runner enhancements:
- Add --all, --cassettes, --python flags
- Per-package venv isolation via uv sync + uv run pytest
- Platform and Python version-aware skip logic
- Smart install failure handling (skip vs error)
- Exclude sample-app from discovery
- Guard against uncommitted uv.lock changes

CI pipeline (fr-pr.yaml):
- Add all-tests job running --all (UT + FR + VCR)
- Both jobs now test Python 3.10, 3.11, 3.12, 3.13
- Add uv install step (astral-sh/setup-uv)

Test fixes across packages:
- traceloop-sdk: fix endpoint detection for FR rebranding, fix
  span postprocess callback fixture isolation
- bedrock: fix streaming wrapper attribute name, scope metric
  assertions to bedrock-specific metrics only
- openai: use SpanAttributes constants instead of hardcoded strings
  for reasoning attributes
- anthropic: add safety handler cleanup fixture
- google-genai: add session-scoped instrumentor with re-instrument
  guard, make token metric assertion conditional, pin google-genai
  test dep
- llamaindex: pin llama-index and llama-index-core test deps
- lancedb: fix version constraint, add stale table cleanup
- fortifyroot: add pytest-asyncio test dependency

New files:
- .env.test.example: environment variable template for cassette recording
- scripts/templates/conftest_vcr.py: standardized VCR conftest template

Validated: 0 test failures on macOS (31 pass, 4 skip) and Ubuntu 22.04
(34 pass, 1 skip).
@manas-fortifyroot
manas-fortifyroot merged commit 5974188 into fr-v0.52.6.x Mar 28, 2026
8 checks passed
@manas-fortifyroot
manas-fortifyroot deleted the feat/test-infrastructure-t0 branch March 28, 2026 06:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant