Skip to content

ci: add backend unit tests to Tests workflow#336

Closed
shivv23 wants to merge 11 commits intoc2siorg:mainfrom
shivv23:a-ci/backend-unit-tests
Closed

ci: add backend unit tests to Tests workflow#336
shivv23 wants to merge 11 commits intoc2siorg:mainfrom
shivv23:a-ci/backend-unit-tests

Conversation

@shivv23
Copy link
Copy Markdown
Contributor

@shivv23 shivv23 commented Apr 27, 2026

Summary

The CI integration-tests.yml workflow only ran integration tests, leaving the 162 backend unit tests in tensormap-backend/tests/ completely untested in CI. This PR splits the single integration-test job into two parallel jobs:

  • backend-unit-tests: Runs pytest tests/ against the backend unit test suite
  • integration-tests: Runs pytest ../tests/integration/ against the full integration suite

Changes

  • Added .github/workflows/integration-tests.yml (new file — no conflicts possible)
  • Added a dedicated backend-unit-tests job running uv run pytest tests/ -v --tb=short
  • Both jobs run in parallel on PRs to main
  • Uses pull_request_target for proper fork support, matching lint.yml conventions

Validation

  • All 162 backend unit tests pass locally (162 passed in 2.54s)
  • No changes to application code — CI workflow only

Files Changed

  • .github/workflows/integration-tests.yml — new workflow with two parallel test jobs

shivv23 added 11 commits April 26, 2026 23:09
Supported augmentation techniques:
- flip_horizontal: Mirror along vertical axis
- flip_vertical: Mirror along horizontal axis
- rotate_90: Rotate by 90 degrees
- brightness: Adjust brightness by 20%
- zoom: Zoom to 90% and resize
- gaussian_noise: Add Gaussian noise
- random_crop: Crop to 85% and resize

Endpoint: POST /data/augment/image/{file_id}
Export trained Keras models to:
- SavedModel (TensorFlow native)
- TFLite (mobile/edge optimized)
- ONNX (cross-framework)

Endpoint: GET /model/export/{model_name}?format=savedmodel|tflite|onnx
…re importance

For classification models:
- Confusion matrix generation
- Per-class metrics (precision, recall, F1-score)

For regression models:
- Feature importance via permutation importance

Endpoint: GET /model/interpret/{model_name}?file_id=&project_id=
Compare metrics across multiple training runs:
- Chronological view of runs with loss, accuracy, epochs
- Automatic best run identification (lowest loss)
- Pagination support with configurable limit

Endpoint: GET /model/compare?project_id=&limit=
Grid search over:
- Learning rate (0.001, 0.01)
- Batch size (16, 32)
- Epochs (5, 10)

Returns top 5 configurations sorted by loss with best config highlighted.

Also includes run comparison for tracking training history.

Endpoints:
- GET /model/tune/{model_name}
- GET /model/compare
Split the single integration-test job into two parallel jobs:
- backend-unit-tests: runs pytest against tensormap-backend/tests/ (162 tests)
- integration-tests: runs pytest against tests/integration/

Uses pull_request_target for proper fork support, matching lint.yml conventions.
@github-actions
Copy link
Copy Markdown

PR Review

Rebase

Your branch is 32 commit(s) behind main. Please rebase.

Merge commits detected — please use rebase instead of merge:

c250ce8 Merge all features: interpret, export, compare, tune
6ff1cd4 Merge all features into tune-augment branch
9bf2dc4 Merge main into interpretability-clean
30da92f Merge branch 'main' into pr312-export-clean

Squash

Your PR has 11 commits. Please squash into a single commit.

How to fix

git fetch origin
git rebase -i origin/main   # mark all but first commit as "squash"
git push --force-with-lease

This comment updates automatically on each push.

@shivv23 shivv23 closed this Apr 27, 2026
@shivv23
Copy link
Copy Markdown
Contributor Author

shivv23 commented Apr 27, 2026

Hey @ivantha, I apologize for the confusion with these PRs. The issue was that my local Git state had a polluted index with uncommitted changes from other branches — when I created the branches from what I thought was a clean origin/main, those branches ended up containing 10+ unrelated commits from the stale branch history. Both PRs showed the same 10 commits (augment, export, interpret, compare, tune) because those commits exist in main's merge history.

I've since identified this and reset everything to a clean origin/main. I'm going to create fresh PRs with orphan branches — each containing exactly 1 commit with only its relevant files. They will have no shared commits and zero conflicts. Apologies for the noise!

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