Skip to content

Commit 846457c

Browse files
committed
Add advanced backend unit tests workflow and new test target
- Created a GitHub Actions workflow for running unit tests on the advanced backend, triggered by pull requests and pushes to specific branches. - Added a new `test-unit` target in the Makefile to execute Python unit tests for the advanced backend, ensuring proper test execution and reporting. - Enhanced the Makefile to include the new test target, improving the testing process for backend development.
1 parent 7bae9de commit 846457c

2 files changed

Lines changed: 48 additions & 1 deletion

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Advanced Backend Unit Tests
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'backends/advanced/**'
7+
- '.github/workflows/advanced-backend-unit-tests.yml'
8+
- 'Makefile'
9+
push:
10+
branches:
11+
- dev
12+
- main
13+
paths:
14+
- 'backends/advanced/**'
15+
- '.github/workflows/advanced-backend-unit-tests.yml'
16+
- 'Makefile'
17+
workflow_dispatch:
18+
19+
permissions:
20+
contents: read
21+
22+
jobs:
23+
advanced-backend-unit-tests:
24+
name: Run advanced backend unit tests
25+
runs-on: ubuntu-latest
26+
timeout-minutes: 20
27+
28+
steps:
29+
- name: Checkout code
30+
uses: actions/checkout@v4
31+
32+
- name: Set up Python
33+
uses: actions/setup-python@v5
34+
with:
35+
python-version: "3.12"
36+
37+
- name: Install uv
38+
uses: astral-sh/setup-uv@v4
39+
40+
- name: Run advanced backend unit tests
41+
run: make test-unit

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export $(shell sed 's/=.*//' config.env | grep -v '^\s*$$' | grep -v '^\s*\#')
1919
SCRIPTS_DIR := scripts
2020
K8S_SCRIPTS_DIR := $(SCRIPTS_DIR)/k8s
2121

22-
.PHONY: help menu setup-k8s setup-infrastructure setup-rbac setup-storage-pvc config config-docker config-k8s config-all clean deploy deploy-docker deploy-k8s deploy-k8s-full deploy-infrastructure deploy-apps check-infrastructure check-apps build-backend up-backend down-backend k8s-status k8s-cleanup k8s-purge audio-manage mycelia-sync-status mycelia-sync-all mycelia-sync-user mycelia-check-orphans mycelia-reassign-orphans test-robot test-robot-integration test-robot-unit test-robot-endpoints test-robot-specific test-robot-clean
22+
.PHONY: help menu setup-k8s setup-infrastructure setup-rbac setup-storage-pvc config config-docker config-k8s config-all clean deploy deploy-docker deploy-k8s deploy-k8s-full deploy-infrastructure deploy-apps check-infrastructure check-apps build-backend up-backend down-backend k8s-status k8s-cleanup k8s-purge audio-manage mycelia-sync-status mycelia-sync-all mycelia-sync-user mycelia-check-orphans mycelia-reassign-orphans test-robot test-robot-integration test-robot-unit test-robot-endpoints test-robot-specific test-robot-clean test-unit
2323

2424
# Default target
2525
.DEFAULT_GOAL := menu
@@ -428,3 +428,9 @@ test-robot-clean: ## Clean up Robot Framework test results
428428
@echo "🧹 Cleaning up Robot Framework test results..."
429429
@rm -rf results/
430430
@echo "✅ Test results cleaned"
431+
432+
433+
test-unit: ## Run Python unit tests for advanced backend, make sure to have more folders as unit tests geta added
434+
@echo "🧪 Running Python unit tests for advanced backend..."
435+
@cd backends/advanced && uv run --group test pytest tests/unit tests/test_init_llm_setup.py
436+
@echo "✅ Advanced backend Python unit tests completed"

0 commit comments

Comments
 (0)