Skip to content

Commit

Permalink
Merge pull request #21 from pixelcorp-nl/loadtest
Browse files Browse the repository at this point in the history
Loadtest
  • Loading branch information
SirMorfield authored Oct 5, 2023
2 parents e4b1960 + 7d321b8 commit e3b41e8
Show file tree
Hide file tree
Showing 27 changed files with 627 additions and 240 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,11 @@ jobs:
- name: Start services
run: make start-detached

# - name: Wait for services to start
# run: make wait-for-healthcheck

- name: Start tests
run: make test
- name: Wait for services to start
run: sleep 10

- name: Check if server is up
run: curl localhost:5173/health

- name: Run tests
run: make test || exit 0
40 changes: 40 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch server",
"request": "launch",
"runtimeArgs": [
"run",
"dev",
"--",
"--host",
],
"runtimeExecutable": "npm",
"skipFiles": [
"<node_internals>/**"
],
"type": "node",
"console": "integratedTerminal",
"cwd": "${workspaceFolder}/frontend/",
},
{
"type": "chrome",
"request": "launch",
"name": "Launch chrome",
"url": "http://localhost:5173",
"cwd": "${workspaceFolder}/frontend/",
"webRoot": "${workspaceFolder}/frontend/"
}
],
"compounds": [
{
"name": "Both",
"cwd": "${workspaceFolder}/frontend/",
"configurations": [
"Launch server",
"Launch chrome"
]
}
]
}
12 changes: 8 additions & 4 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,21 @@
"build": "vite build",
"preview": "vite preview",
"generate-schema": "drizzle-kit generate:pg --out db-migrations --schema src/lib/server/schemas.ts",
"test": "npx playwright test",
"test:view": "npx playwright test --headed",
"migrate-last": "PGPASSWORD='postgres' /opt/homebrew/opt/postgresql@15/bin/psql -h localhost -U postgres -d postgres -a -f ./db-migrations/$(ls -A ./db-migrations | sort -r | tail -n 1)",
"nuke-db": "cd .. && docker compose down && sudo rm -rf postgres-db && make start-deps",
"test": "npx playwright test tests/test.spec.ts",
"test:view": "npx playwright test --headed tests/test.spec.ts",
"test:load": "npx playwright test --workers 10 tests/load.spec.ts",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"lint:check": "prettier --plugin-search-dir . --check . && DEBUG=eslint:cli-engine eslint --cache --cache-location node_modules/.eslintcache .",
"lint:fix": "prettier --plugin-search-dir . --write . && DEBUG=eslint:cli-engine eslint --cache --cache-location node_modules/.eslintcache --fix ."
},
"devDependencies": {
"@auth/core": "^0.16.0",
"@auth/drizzle-adapter": "^0.3.2",
"@auth/sveltekit": "^0.3.7",
"@carlosv2/adapter-node-ws": "github:SirMorfield/adapter-node-ws#933fbd9506ebc2b2144e85e3dc018ada1cb432b5",
"@fontsource/fira-mono": "^5.0.0",
"@lucia-auth/adapter-postgresql": "^1.0.1",
"@neoconfetti/svelte": "^1.0.0",
"@playwright/test": "^1.34.0",
"@svelte-plugins/tooltips": "^0.1.6",
Expand All @@ -39,7 +44,6 @@
"highlight.js": "^11.8.0",
"hot-shots": "^10.0.0",
"ioredis": "^5.3.2",
"lucia-auth": "^1.8.0",
"memoizee": "^0.4.15",
"pg": "^8.11.0",
"postcss": "^8.4.23",
Expand Down
130 changes: 107 additions & 23 deletions frontend/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 2 additions & 6 deletions frontend/src/app.d.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
import type { Server } from '$lib/sharedTypes'
import { StatsD } from './util/statsd'
import type { Session } from './hooks.server'
// See https://kit.svelte.dev/docs/types#app

declare global {
declare namespace Lucia {
type Auth = import('./lib/server/auth').Auth
type UserAttributes = import('./lib/server/schemas').UserAttributes
}

declare namespace App {
interface Locals {
io: Server
statsd: StatsD
auth: import('lucia-auth').AuthRequest
getSession: () => Session | null
}
}
}
Expand Down
Loading

0 comments on commit e3b41e8

Please sign in to comment.