Skip to content

ci: add backend unit tests to Tests workflow#339

Open
shivv23 wants to merge 11 commits intoc2siorg:mainfrom
shivv23:pr1/backend-unit-tests
Open

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

Conversation

@shivv23
Copy link
Copy Markdown
Contributor

@shivv23 shivv23 commented Apr 27, 2026

Summary

The CI pipeline had no backend unit test coverage — the 162 tests in tensormap-backend/tests/ were never run on PRs. This PR adds a Tests workflow with two parallel jobs:

  • backend-unit-tests: runs pytest tests/ -v --tb=short
  • integration-tests: runs pytest ../tests/integration/ -v --tb=short

Changes

  • New .github/workflows/integration-tests.yml file
  • Uses pull_request_target for proper fork support
  • Both jobs run in parallel on PRs to main

Validation

  • All 162 backend unit tests pass locally

Files Changed

  • .github/workflows/integration-tests.yml

shivv23 added 10 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
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 27, 2026

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 force-pushed the pr1/backend-unit-tests branch from c86b3c4 to f27e40c Compare April 27, 2026 06:03
@shivv23
Copy link
Copy Markdown
Contributor Author

shivv23 commented Apr 27, 2026

Hey @ivantha, apologies again for the earlier confusion with polluted commits. This PR now has the cleanest possible state — only 1 new file (integration-tests.yml) added. The 11 commits visible in the history are from main's merge chain, not file changes. The actual diff is just +56 lines in 1 new file. All 162 backend tests pass. Happy to address any review feedback here!

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