chore: split session test suite and increase token ttl

This commit is contained in:
Antonella Sgarlatta
2026-04-09 15:05:49 -03:00
parent dd69fe2fcc
commit 87d287c851
4 changed files with 42 additions and 7 deletions
+9 -4
View File
@@ -67,8 +67,13 @@ jobs:
sed -i "s/ENCRYPTION_SERVER_KEY=/ENCRYPTION_SERVER_KEY=$(openssl rand -hex 32)/g" packages/home-server/.env
sed -i "s/PSEUDO_KEY_PARAMS_KEY=/PSEUDO_KEY_PARAMS_KEY=$(openssl rand -hex 32)/g" packages/home-server/.env
sed -i "s/VALET_TOKEN_SECRET=/VALET_TOKEN_SECRET=$(openssl rand -hex 32)/g" packages/home-server/.env
echo "ACCESS_TOKEN_AGE=4" >> packages/home-server/.env
echo "REFRESH_TOKEN_AGE=10" >> packages/home-server/.env
if [[ "${{ inputs.suite }}" == "session" || "${{ inputs.suite }}" == "all" ]]; then
echo "ACCESS_TOKEN_AGE=4" >> packages/home-server/.env
echo "REFRESH_TOKEN_AGE=10" >> packages/home-server/.env
else
echo "ACCESS_TOKEN_AGE=120" >> packages/home-server/.env
echo "REFRESH_TOKEN_AGE=600" >> packages/home-server/.env
fi
echo "REVISIONS_FREQUENCY=2" >> packages/home-server/.env
echo "CONTENT_SIZE_TRANSFER_LIMIT=100000" >> packages/home-server/.env
echo "HTTP_REQUEST_PAYLOAD_LIMIT_MEGABYTES=1" >> packages/home-server/.env
@@ -93,10 +98,10 @@ jobs:
PORT: 3123
- name: Wait for server to start
run: for i in {1..30}; do curl -s http://localhost:3123/healthcheck && break || sleep 1; done
run: for i in {1..30}; do if curl -fsS http://localhost:3123/healthcheck; then exit 0; fi; sleep 1; done; echo "Server did not become healthy in time"; exit 1
- name: Run E2E Test Suite
run: yarn dlx mocha-headless-chrome --timeout 3600000 --polling 1000 -a no-sandbox -a disable-setuid-sandbox -f http://localhost:9001/mocha/test.html?suite=${{ inputs.suite }}
run: yarn dlx mocha-headless-chrome --timeout 3600000 --polling 1000 -a no-sandbox -a disable-setuid-sandbox -f "http://localhost:9001/mocha/test.html?suite=${{ inputs.suite }}&trace=1"
- name: Archive failed run logs
if: ${{ failure() }}
+15 -1
View File
@@ -39,12 +39,24 @@ jobs:
- name: Install
run: yarn install --immutable
- name: Resolve token ages for suite
run: |
if [[ "${{ inputs.suite }}" == "session" || "${{ inputs.suite }}" == "all" ]]; then
echo "AUTH_SERVER_ACCESS_TOKEN_AGE=4" >> $GITHUB_ENV
echo "AUTH_SERVER_REFRESH_TOKEN_AGE=10" >> $GITHUB_ENV
else
echo "AUTH_SERVER_ACCESS_TOKEN_AGE=120" >> $GITHUB_ENV
echo "AUTH_SERVER_REFRESH_TOKEN_AGE=600" >> $GITHUB_ENV
fi
- name: Run Server
run: docker compose -f docker-compose.ci.yml up -d
env:
DB_TYPE: mysql
CACHE_TYPE: redis
SERVICE_PROXY_TYPE: ${{ matrix.service_proxy_type }}
AUTH_SERVER_ACCESS_TOKEN_AGE: ${{ env.AUTH_SERVER_ACCESS_TOKEN_AGE }}
AUTH_SERVER_REFRESH_TOKEN_AGE: ${{ env.AUTH_SERVER_REFRESH_TOKEN_AGE }}
- name: Output Server Logs to File
run: docker compose -f docker-compose.ci.yml logs -f > logs/docker-compose.log 2>&1 &
@@ -52,12 +64,14 @@ jobs:
DB_TYPE: mysql
CACHE_TYPE: redis
SERVICE_PROXY_TYPE: ${{ matrix.service_proxy_type }}
AUTH_SERVER_ACCESS_TOKEN_AGE: ${{ env.AUTH_SERVER_ACCESS_TOKEN_AGE }}
AUTH_SERVER_REFRESH_TOKEN_AGE: ${{ env.AUTH_SERVER_REFRESH_TOKEN_AGE }}
- name: Wait for server to start
run: docker/is-available.sh http://localhost:3123 $(pwd)/logs
- name: Run E2E Test Suite
run: yarn dlx mocha-headless-chrome --timeout 3600000 --polling 1000 -a no-sandbox -a disable-setuid-sandbox -f http://localhost:9001/mocha/test.html?suite=${{ inputs.suite }}
run: yarn dlx mocha-headless-chrome --timeout 3600000 --polling 1000 -a no-sandbox -a disable-setuid-sandbox -f "http://localhost:9001/mocha/test.html?suite=${{ inputs.suite }}&trace=1"
- name: Archive failed run logs
if: ${{ failure() }}
+8
View File
@@ -103,6 +103,14 @@ jobs:
snjs_image_tag: 'latest'
suite: 'base'
e2e-session:
needs: build
name: E2E Session Suite
uses: standardnotes/server/.github/workflows/common-e2e.yml@main
with:
snjs_image_tag: 'latest'
suite: 'session'
e2e-vaults:
needs: build
name: E2E Vaults Suite
+10 -2
View File
@@ -106,6 +106,14 @@ jobs:
snjs_image_tag: 'latest'
suite: 'base'
e2e-session:
needs: build
name: E2E Session Suite
uses: standardnotes/server/.github/workflows/common-e2e.yml@main
with:
snjs_image_tag: 'latest'
suite: 'session'
e2e-vaults:
needs: build
name: E2E Vaults Suite
@@ -115,13 +123,13 @@ jobs:
suite: 'vaults'
publish-self-hosting:
needs: [ test, lint, e2e-base, e2e-vaults ]
needs: [ test, lint, e2e-base, e2e-session, e2e-vaults ]
name: Publish Self Hosting Docker Image
uses: standardnotes/server/.github/workflows/common-self-hosting.yml@main
secrets: inherit
publish-services:
needs: [ test, lint, e2e-base, e2e-vaults ]
needs: [ test, lint, e2e-base, e2e-session, e2e-vaults ]
runs-on: ubuntu-latest