Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ services:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
ports:
- "5432:5432"
- "5434:5432"
volumes:
- "../pg/db:/var/lib/postgresql/data"
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -d webknossos -U ${POSTGRES_USER} -h 127.0.0.1 -p 5432"]
interval: 2s
Expand All @@ -111,3 +111,7 @@ services:
timeout: 1s
interval: 5s
retries: 10

volumes:
postgres_data:
external: false
4 changes: 3 additions & 1 deletion .github/workflows/build_test_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ on:
push:
branches:
- master
tags:
- '*'
pull_request:
branches:
- '*'

env:
USER_UID: 1001
USER_GID: 1001
POSTGRES_URL: "jdbc:postgresql://localhost:5432/webknossos"
POSTGRES_URL: "jdbc:postgresql://localhost:5434/webknossos"
POSTGRES_USER: "webknossos_user"
POSTGRES_PASSWORD: "secret_password"
CERTIFICATE: ${{ secrets.CERTIFICATE_FOR_CI_ONLY }}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@
"test-e2e": "tools/postgres/dbtool.js prepare-test-db && tools/test.sh test-e2e --timeout=60s --verbose",
"test-screenshot": "tools/test.sh test-screenshot --timeout=5m",
"test-wkorg-screenshot": "tools/test.sh test-wkorg-screenshot --timeout=5m",
"refresh-screenshots": "rm -rf frontend/javascripts/test/screenshots/** && docker compose up screenshot-tests",
"refresh-screenshots": "tools/refresh-screenshots.sh",
"test-help": "echo For development it is recommended to run yarn test-prepare-watch in one terminal and yarn test-watch in another. This is the fastest way to perform incremental testing. If you are only interested in running test once, use yarn test.",
"remove-e2e-snapshots": "rm -rf frontend/javascripts/test/snapshots/public-test/test-bundle/test/backend-snapshot-tests/ && rm -rf frontend/javascripts/test/snapshots/public-test/test-bundle/test/enzyme/",
"remove-all-snapshots": "rm -rf frontend/javascripts/test/snapshots/",
"stash-cmake-cache": "[ -f webknossos-jni/target/native/x86_64-linux/build/CMakeCache.txt ] && mv webknossos-jni/target/native/x86_64-linux/build/CMakeCache.txt webknossos-jni/target/native/x86_64-linux/build/CMakeCache.txt.bak || true",
"stash-pop-cmake-cache": "[ -f webknossos-jni/target/native/x86_64-linux/build/CMakeCache.txt.bak ] && mv webknossos-jni/target/native/x86_64-linux/build/CMakeCache.txt.bak webknossos-jni/target/native/x86_64-linux/build/CMakeCache.txt || true",
"refresh-e2e-snapshots": "yarn remove-e2e-snapshots && mkdir -p frontend/javascripts/test/snapshots/type-check && yarn stash-cmake-cache && docker compose down && docker compose up e2e-tests && yarn stash-pop-cmake-cache",
"refresh-e2e-snapshots": "yarn remove-e2e-snapshots && mkdir -p frontend/javascripts/test/snapshots/type-check && yarn stash-cmake-cache && ./tools/docker-env.sh sbt -v 'testOnly e2e.* -- -Ddatastore.watchFileSystem.enabled=false' && yarn stash-pop-cmake-cache",
"refresh-all-snapshots": "yarn remove-all-snapshots && yarn test && yarn refresh-e2e-snapshots",
"check-frontend": "yarn run biome check frontend package.json && tools/assert-no-test-only.sh",
"fix-frontend": "yarn run biome check frontend package.json --write && echo Please proofread the applied suggestions, as they may not be safe.",
Expand Down
20 changes: 20 additions & 0 deletions tools/docker-env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash

# Start Docker
export POSTGRES_URL=jdbc:postgresql://localhost:5434/webknossos
export POSTGRES_USER="webknossos"
export POSTGRES_PASSWORD="secret"

cd .github || exit
docker compose down -v
docker compose up -d postgres fossildb
cd .. || exit

"$@"
RESULT=$?

cd .github || exit
docker compose down -v
cd .. || exit

exit "$RESULT"
13 changes: 13 additions & 0 deletions tools/refresh-screenshots.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

set -xe

rm -rf frontend/javascripts/test/screenshots/**

docker run --rm -t \
-e "URL=$URL" \
-e "WK_AUTH_TOKEN=$WK_AUTH_TOKEN" \
-w "/home/pptruser/webknossos" \
-v ".:/home/pptruser/webknossos" \
-u "$(id -u):$(id -g)" \
scalableminds/puppeteer:master bash -c 'for i in {1..3}; do yarn test-screenshot && break; done'