Skip to content

test(dataviewer): make backend tests deterministic - #1601

Draft
Alexandre Gattiker (algattik) wants to merge 2 commits into
mainfrom
algattik-refactor-dataviewer-backend-tests
Draft

Alexandre Gattiker (algattik) wants to merge 2 commits into
mainfrom
algattik-refactor-dataviewer-backend-tests

Conversation

@algattik

Copy link
Copy Markdown
Collaborator

Pull Request

Description

Refactor the dataviewer backend test suite around deterministic pytest fixtures and public behavior. External storage, media, model, and cloud boundaries use controlled fakes; temporary datasets replace repository-local data; shared fixtures move to conftest.py; and exact API, persistence, fallback, and contract assertions replace legacy and implementation-coupled patterns.

Closes #128

Type of Change

  • 🐛 Bug fix (non-breaking change fixing an issue)
  • ✨ New feature (non-breaking change adding functionality)
  • 💥 Breaking change (fix or feature causing existing functionality to change)
  • 📚 Documentation update
  • 🏗️ Infrastructure change (Terraform/IaC)
  • ♻️ Refactoring (no functional changes)

Component(s) Affected

  • infrastructure/terraform/prerequisites/ - Azure subscription setup
  • infrastructure/terraform/ - Terraform infrastructure
  • infrastructure/setup/ - OSMO control plane / Helm
  • workflows/ - Training and evaluation workflows
  • training/ - Training pipelines and scripts
  • docs/ - Documentation

Dataviewer backend tests under data-management/viewer/backend/tests/ are affected.

Testing Performed

  • Terraform plan reviewed (no unexpected changes)
  • Terraform apply tested in dev environment
  • Training scripts tested locally with Isaac Sim
  • OSMO workflow submitted successfully
  • Smoke tests passed (smoke_test_azure.py)
  • Backend suite: 980 tests and 40 Schemathesis subtests passed
  • Combined line and branch coverage: 92.08% (90% required)
  • Ruff check and formatting validation passed
  • Two isolated full-suite runs produced identical result summaries

Documentation Impact

  • No documentation changes needed
  • Documentation updated in this PR
  • Documentation issue filed

Bug Fix Checklist

Not applicable; this PR refactors tests without changing production behavior.

  • Linked to issue being fixed
  • Regression test included, OR
  • Justification for no regression test: the change itself strengthens and reorganizes the regression suite

Checklist

- isolate datasets and external services with pytest fixtures
- replace private and legacy patterns with public behavior
- restore subprocess, loader, storage, and validation coverage

🧪 - Generated by Copilot

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 31f89bdc-925b-401f-baab-20cc131db360
@github-actions

github-actions Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA 1172cd5.
Ensure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice.

Scanned Files

None

@codecov-commenter

Codecov Comments Bot (codecov-commenter) commented Sep 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.30%. Comparing base (8d49dca) to head (1172cd5).
⚠️ Report is 17 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1601      +/-   ##
==========================================
+ Coverage   88.10%   88.30%   +0.19%     
==========================================
  Files         279      279              
  Lines       23203    23203              
  Branches     3153     3153              
==========================================
+ Hits        20444    20490      +46     
+ Misses       2071     1978      -93     
- Partials      688      735      +47     
Flag Coverage Δ *Carryforward flag
go 100.00% <ø> (ø)
pester 86.64% <ø> (ø) Carriedforward from 5057409
pytest-data-pipeline 100.00% <ø> (ø) Carriedforward from 5057409
pytest-dataviewer 90.43% <ø> (+0.77%) ⬆️ Carriedforward from 5057409
pytest-dm-tools 100.00% <ø> (ø) Carriedforward from 5057409
pytest-evaluation 95.40% <ø> (ø) Carriedforward from 5057409
pytest-fuzz 3.99% <ø> (ø)
pytest-inference 100.00% <ø> (ø) Carriedforward from 5057409
pytest-shared-ci 100.00% <ø> (ø) Carriedforward from 5057409
pytest-training 92.60% <ø> (ø) Carriedforward from 5057409
vitest 85.66% <ø> (ø) Carriedforward from 5057409
vitest-app 85.66% <ø> (ø) Carriedforward from 5057409
vitest-components 85.66% <ø> (ø) Carriedforward from 5057409
vitest-features 85.66% <ø> (ø) Carriedforward from 5057409
vitest-lib 85.66% <ø> (ø) Carriedforward from 5057409
vitest-state 85.66% <ø> (ø) Carriedforward from 5057409

*This pull request uses carry forward flags. Click here to find out more.
see 14 files with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

🔤 - Generated by Copilot

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 16904c91-fd21-4efb-9909-c008f45ca45e
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.

test(dataviewer): refactor backend tests with mocks, pytest patterns, and fixture deduplication

2 participants