Skip to content

Commit 5109c3e

Browse files
authored
Merge pull request #139 from AET-DevOps25/feature/add-client-tests
Add client tests
2 parents cbd2239 + 8a46f88 commit 5109c3e

File tree

14 files changed

+7889
-1287
lines changed

14 files changed

+7889
-1287
lines changed

.github/workflows/ci-cd.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ jobs:
3838
if: |
3939
startsWith(github.ref, 'refs/heads/feature/') && needs.detect-changes.outputs.genai == 'true'
4040
runs-on: ubuntu-latest
41+
services:
42+
qdrant:
43+
image: qdrant/qdrant
44+
ports:
45+
- 6333:6333
46+
env:
47+
OPENAI_API_KEY: ${{ secrets.API_OPENAI }}
4148
steps:
4249
- name: Checkout code
4350
uses: actions/checkout@v4
@@ -56,6 +63,11 @@ jobs:
5663
pip install flake8
5764
flake8 . || exit 1
5865
working-directory: genai
66+
67+
- name: Run Tests
68+
run: |
69+
pytest --maxfail=1 --disable-warnings -q
70+
working-directory: genai
5971

6072
build-server:
6173
needs: detect-changes
@@ -132,6 +144,12 @@ jobs:
132144
run: npm install --include=dev
133145
working-directory: client
134146

147+
- name: Run tests
148+
run: npm run test -- --run
149+
working-directory: client
150+
env:
151+
NODE_ENV: test
152+
135153
- name: Build with Node
136154
run: npm run build
137155
working-directory: client

.github/workflows/genai-tests.yml

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

README.md

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -425,10 +425,30 @@ The project includes Helm charts for Kubernetes deployment in the `recipai-chart
425425
## CI/CD Pipeline
426426

427427
The project includes a GitHub Actions workflow `ci-cd.yml` for:
428-
429-
- **Testing Server**: For each push, server tests on server microservices are run.
430428
- **Building Docker Images**: Automatically builds and pushes Docker images to GitHub Container Registry.
431429
- **Deploying Docker Images**: Automatically deploys the application to a production environment by using deployment manifests in helm for K8s cluster.
430+
- **Running Server Tests**: For each push, server tests on server microservices are run.
431+
- **Running GenAI Tests**: Automatically runs the tests defined in the `genai/tests` directory on every code push in genai module.
432+
- **Running Client Tests**: Automatically runs the UI tests defined in the `client/src/components/__tests__` directory on every code push in client module.
433+
434+
### CI/CD Pipeline Workflow (`ci-cd.yml`)
435+
436+
**Triggers:**
437+
- Push to `main` or `feature/**` branches
438+
- Changes in `genai/**`, `server/**`, `client/**`, or workflow files
439+
440+
**Features:**
441+
- **Change Detection**: Uses `dorny/paths-filter` to detect which services have changed
442+
- **Conditional Builds**: Only builds and tests services that have been modified
443+
- **Multi-stage Pipeline**: Build → Test → Docker → Deploy
444+
445+
**Jobs:**
446+
- `detect-changes`: Identifies which services need building/testing
447+
- `build-genai`: Python linting, dependency installation, and genai tests
448+
- `build-server`: Java microservices build and test (API Gateway, Chat, User)
449+
- `build-client`: Node.js build and test
450+
- `docker-release-*`: Builds and pushes Docker images to GitHub Container Registry
451+
- `helm-deploy`: Deploys to Kubernetes using Helm charts
432452

433453
The project includes a GitHub Actions workflow `helm-manual.yml` for:
434454

@@ -438,10 +458,6 @@ The project includes a GitHub Actions workflow `ansible-manual.yml` for:
438458

439459
- **Running Ansible Playbook**: Manually runs any Ansible playbook defined in the `ansible/playbooks` directory against an EC2 instance securely using SSH and Ansible Vault.
440460

441-
The project includes a GitHub Actions workflow `genai-tests.yml` for:
442-
443-
- **Running GenAI Tests**: Automatically runs the tests defined in the `genai/tests` directory on every code push in genai module.
444-
445461
## API Documentation
446462

447463
### User Service

0 commit comments

Comments
 (0)