Skip to content

Ci/GitHub actions tests - #99

Merged
ToastyDom merged 4 commits into
developmentfrom
ci/github-actions-tests
Jun 25, 2026
Merged

ToastyDom merged 4 commits into
developmentfrom
ci/github-actions-tests

Conversation

@ToastyDom

Copy link
Copy Markdown
Collaborator

Add tiered test suite + GitHub Actions CI

This PR adds an automated test suite and GitHub Actions CI for BERG. The tests are split into cost-based tiers so pull requests remain fast, while heavier real-weight checks can still be run manually when needed.

CI

Adds .github/workflows/ci.yml, which runs on pull requests and manual dispatch.

The workflow includes three jobs:

  • smoke
    Runs on Python 3.11 and 3.12. Covers weight-free unit and smoke tests. This is the required PR check.

  • feature-extraction
    Downloads only a torchvision backbone and verifies real feature extractors without using BERG S3 weights.

  • integration
    Runs real-weight end-to-end tests. This job is only available through workflow_dispatch and does not run on pull requests.

Tests

Adds a tiered test suite under tests/.

Weight-free tests

Covers:

  • BERG import and model registration completeness
  • Catalog, list, and describe functionality
  • YAML card schema validation
  • Parameter validators
  • Model construction and expected error paths
  • Stubbed generate_response pipeline

Heavy tests

Marked with heavy.

Covers real ViT and AlexNet feature extractor construction and verifies output shapes.

Real-weight tests

Marked with weights.

Covers real encode() output invariants:

  • output dtype and finite values
  • deterministic outputs
  • distinct outputs across representations
  • selection == slice
  • ROI outputs match metadata-based slices

The tests are parametrized over the model registry, so newly registered models are covered automatically.

Test markers and tier behavior are configured in pyproject.toml. The weights tier is skipped by default.

Other changes

  • Adds defensive model registration through safe_import, so missing optional dependencies skip only the affected model instead of breaking import berg.
  • Moves sphinx-rtd-theme out of runtime dependencies and into an optional docs dependency group.

@ToastyDom
ToastyDom merged commit 6c9413d into development Jun 25, 2026
4 checks passed
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