Skip to content

Commit 1f2fe6f

Browse files
committed
Merge branch 'fix-load-landscape' into 'main'
Update landscape in backend on landscape load See merge request ExplorViz/code/trace-generator!2
2 parents f6f07d2 + 60add27 commit 1f2fe6f

25 files changed

Lines changed: 5015 additions & 19 deletions

.github/workflows/deploy-docker.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,29 @@ on:
88
workflow_dispatch:
99

1010
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
timeout-minutes: 10
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Set up Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: '22'
21+
- name: Install pnpm
22+
uses: pnpm/action-setup@v4
23+
with:
24+
version: 9
25+
- name: Install dependencies
26+
run: pnpm install --frozen-lockfile
27+
- name: Run tests
28+
run: pnpm test
29+
1130
build:
1231
runs-on: ubuntu-latest
1332
timeout-minutes: 30
33+
needs: test
1434

1535
steps:
1636
- uses: actions/checkout@v4

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ npm-debug.log*
66
# Build files
77
dist
88

9+
# Test coverage
10+
coverage
11+
912
# Diagnostic reports (https://nodejs.org/api/report.html)
1013
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
1114

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,23 @@ docker run -p 8079:8079 \
9595
Note: The OpenTelemetry collector URL can also be configured per-request via the frontend form,
9696
which will override the default environment variable values for that specific trace generation
9797
request.
98+
99+
## Testing
100+
101+
The backend includes unit tests using Vitest.
102+
103+
### Running Tests
104+
105+
```bash
106+
# Run all tests
107+
pnpm test
108+
109+
# Run tests in watch mode
110+
pnpm test:watch
111+
112+
# Run tests with UI
113+
pnpm test:ui
114+
115+
# Run tests with coverage
116+
pnpm test:coverage
117+
```

package.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@
1616
"lint:fix": "eslint . --ext .ts,.tsx,.js,.jsx --fix",
1717
"format": "prettier --write \"**/*.{ts,tsx,js,jsx,json,css,md}\"",
1818
"format:check": "prettier --check \"**/*.{ts,tsx,js,jsx,json,css,md}\"",
19-
"test": "echo \"Error: no test specified\" && exit 1",
19+
"test": "vitest run",
20+
"test:watch": "vitest",
21+
"test:ui": "vitest --ui",
22+
"test:coverage": "vitest run --coverage",
2023
"prepare": "node .husky/install.mjs || true"
2124
},
2225
"author": "",
@@ -26,6 +29,8 @@
2629
"@types/node": "^22.9.1",
2730
"@typescript-eslint/eslint-plugin": "^8.47.0",
2831
"@typescript-eslint/parser": "^8.47.0",
32+
"@vitest/coverage-v8": "4.0.16",
33+
"@vitest/ui": "^4.0.16",
2934
"autoprefixer": "^10.4.22",
3035
"concurrently": "^9.2.1",
3136
"eslint": "^9.39.1",
@@ -43,7 +48,8 @@
4348
"tailwindcss": "^4.1.17",
4449
"tsx": "^4.19.2",
4550
"typescript": "^5.6.3",
46-
"typescript-eslint": "^8.47.0"
51+
"typescript-eslint": "^8.47.0",
52+
"vitest": "^4.0.16"
4753
},
4854
"dependencies": {
4955
"@faker-js/faker": "^9.2.0",

0 commit comments

Comments
 (0)