Skip to content

Commit 0e86f06

Browse files
committed
Add unified Makefile.unittests for advanced backend testing
- Introduced a new `Makefile.unittests` to streamline unit and Robot test execution for the advanced backend. - Updated the README.md to include instructions for running unit and Robot tests. - Modified GitHub Actions workflow to reference the new Makefile, ensuring proper test execution on relevant changes. - Removed the old `Makefile.unittests` from the backends/advanced directory to consolidate test management.
1 parent 0748255 commit 0e86f06

4 files changed

Lines changed: 45 additions & 13 deletions

File tree

.github/workflows/advanced-backend-unit-tests.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ on:
55
paths:
66
- 'backends/advanced/**'
77
- '.github/workflows/advanced-backend-unit-tests.yml'
8-
- 'backends/advanced/Makefile.unittests'
8+
- 'Makefile.unittests'
99
push:
1010
branches:
1111
- dev
1212
- main
1313
paths:
1414
- 'backends/advanced/**'
1515
- '.github/workflows/advanced-backend-unit-tests.yml'
16-
- 'backends/advanced/Makefile.unittests'
16+
- 'Makefile.unittests'
1717
workflow_dispatch:
1818

1919
permissions:
@@ -56,5 +56,4 @@ jobs:
5656
EOF
5757
5858
- name: Run advanced backend unit tests
59-
working-directory: backends/advanced
6059
run: make -f Makefile.unittests test-unit

Makefile.unittests

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
.PHONY: help test-unit robot-test robot-all
2+
3+
# Minimal auth env required during import-time test collection.
4+
UNIT_TEST_ENV := AUTH_SECRET_KEY=test-auth-secret ADMIN_PASSWORD=test-admin-password ADMIN_EMAIL=test-admin@example.com
5+
6+
help:
7+
@echo "Repository-level unit/robot test targets"
8+
@echo " make -f Makefile.unittests test-unit Run advanced backend Python unit tests"
9+
@echo ""
10+
@echo "Robot test passthrough targets (runs via tests/)"
11+
@echo " make -f Makefile.unittests robot-test [CONFIG=deepgram-openai.yml]"
12+
@echo " make -f Makefile.unittests robot-all [CONFIG=deepgram-openai.yml]"
13+
14+
test-unit:
15+
@echo "Running advanced backend Python unit tests..."
16+
@cd backends/advanced && $(UNIT_TEST_ENV) uv run --group test pytest tests/unit tests/test_init_llm_setup.py
17+
@echo "Advanced backend Python unit tests completed"
18+
19+
robot-test:
20+
@echo "Starting/rebuilding Robot test containers from tests/..."
21+
@$(MAKE) -C tests start-rebuild $(if $(CONFIG),CONFIG=$(CONFIG),)
22+
@echo "Running Robot test workflow from tests/..."
23+
@$(MAKE) -C tests test $(if $(CONFIG),CONFIG=$(CONFIG),)
24+
25+
robot-all:
26+
@echo "Running all Robot suites from tests/..."
27+
@$(MAKE) -C tests all $(if $(CONFIG),CONFIG=$(CONFIG),)

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,22 @@ cd app
145145
npm start
146146
```
147147

148+
### Unit + Robot Tests
149+
```bash
150+
# Run advanced backend Python unit tests
151+
make -f Makefile.unittests test-unit
152+
153+
# Run Robot test workflow (includes start-rebuild automatically)
154+
make -f Makefile.unittests robot-test
155+
156+
# Run both unit + Robot tests
157+
make -f Makefile.unittests test-unit && make -f Makefile.unittests robot-test
158+
159+
# Optional Robot config override
160+
make -f Makefile.unittests robot-test CONFIG=deepgram-openai.yml
161+
```
162+
163+
148164
### Health Checks
149165
```bash
150166
# Backend health

backends/advanced/Makefile.unittests

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)