-
-
Notifications
You must be signed in to change notification settings - Fork 17
chore: better local dev #2524
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
CommanderStorm
wants to merge
41
commits into
main
Choose a base branch
from
better-local-dev
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,269
−197
Draft
chore: better local dev #2524
Changes from all commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
79ea7e8
make sure to prefer local files over remote files
CommanderStorm 9a03ea2
move /cdn into the server instead
CommanderStorm 7e701ae
add an e2e test
CommanderStorm 7b3c170
Merge branch 'main' into better-local-dev
CommanderStorm 63d1a0c
Merge branch 'main' into better-local-dev
CommanderStorm cf6651a
add public_transport.parquet to the CDN
CommanderStorm 07d6625
rewrite tests
CommanderStorm 40a8fd6
remove impossible condition for qr code gen
CommanderStorm 6bb9213
add server tests
CommanderStorm 0d0e0c4
Update server.api.spec.ts
CommanderStorm eb60b07
add ui tests
CommanderStorm 4160f3c
improve the tests a bit
CommanderStorm 39ceb3e
pin dependencys
CommanderStorm fc934d5
cleanup of the workflow
CommanderStorm 1573eeb
move files one level up
CommanderStorm 0a54a50
Update tests/specs/server.api.spec.ts
CommanderStorm 9b77d81
remove chrome from server side
CommanderStorm d0d4b49
fix tests
CommanderStorm 4f702bd
various spec fixes
CommanderStorm 842162f
more testcase refactoring
CommanderStorm 21a1f15
remove a few very flaky tests
CommanderStorm 353a291
fix another test
CommanderStorm 34ce0c4
more debugging
CommanderStorm 3a42edf
harden action a bit
CommanderStorm aed018c
git stash
CommanderStorm 15aede5
remove git pull
CommanderStorm dd157cf
chore: Update OpenAPI spec and types
autofix-ci[bot] 7657e17
add an action to free disk space
CommanderStorm 5a1c1c8
lockfile maintenance
CommanderStorm 912e376
remove the one time in the e2e CI when I was trying to be smart :shak…
CommanderStorm 1c8fa46
made tests a bit more robust
CommanderStorm 0615e81
drop down to debug loglevel
CommanderStorm d08ba42
increase general timeouts
CommanderStorm db17187
remove a few unnesesary waitForTimeout
CommanderStorm b77ab02
try another stabilistaition attempt
CommanderStorm dd0182c
skip all cdn tests
CommanderStorm e5ef3c7
fix the e2e tests likely not waiting actually long enough before star…
CommanderStorm 434d857
fix including the floor overview on the details page
CommanderStorm 151e7d7
fix calendar/about tests
CommanderStorm 96d3c71
make sure that the calendarURL is to the frontend
CommanderStorm f036fea
fix working directory
CommanderStorm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,228 @@ | ||
| name: E2E Tests | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [main] | ||
| types: [opened, reopened, synchronize] | ||
| push: | ||
| branches: [main] | ||
| workflow_dispatch: | ||
| permissions: {} | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| api-tests: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 30 | ||
| permissions: | ||
| contents: read | ||
|
|
||
| steps: | ||
| - uses: BRAINSia/free-disk-space@f9f59b0ef974ff4b873aa243ce5278ab644eedc6 # v2.1.2 | ||
| with: | ||
| tool-cache: false | ||
| mandb: true | ||
| android: true | ||
| dotnet: true | ||
| haskell: true | ||
| large-packages: true | ||
| docker-images: true | ||
| swap-storage: true | ||
| - name: Checkout code | ||
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | ||
| with: { persist-credentials: false } | ||
|
|
||
| - name: Setup | Pull Docker images | ||
| run: docker compose pull | ||
| - name: Setup | Build Docker images | ||
| run: docker compose -f compose.local.yml build server data | ||
|
|
||
| - name: Setup | pnpm | ||
| uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0 | ||
| with: | ||
| version: 10.14.0 | ||
| - name: Setup | Node.js | ||
| uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 | ||
| with: | ||
| node-version: 24 | ||
| cache: 'pnpm' | ||
| cache-dependency-path: tests/pnpm-lock.yaml | ||
|
|
||
| - name: Setup | Playwright dependencies | ||
| working-directory: tests | ||
| run: pnpm install | ||
|
|
||
| - name: Create .env file for docker-compose | ||
| run: | | ||
| cat > .env << EOF | ||
| POSTGRES_PASSWORD=test_password | ||
| POSTGRES_USER=postgres | ||
| POSTGRES_DB=navigatum_test | ||
| MEILI_MASTER_KEY=test_master_key | ||
| LOG_LEVEL=debug | ||
| EOF | ||
|
|
||
| - name: Wait for server to become ready | ||
| run: | | ||
| set -euo pipefail | ||
|
|
||
| echo "::group::Starting services…" | ||
| docker compose -f compose.local.yml up -d | ||
|
|
||
| echo "Current container status:" | ||
| docker compose -f compose.local.yml ps | ||
|
|
||
| echo "Waiting for API to become healthy (max 120s)…" | ||
|
|
||
| timeout 120 bash -c 'until curl -f http://localhost:3003/api/search?q=MI; do sleep 2; done' | ||
| if ! timeout 120 bash -c ' | ||
| until curl -fs http://localhost:3003/api/locations/mi >/dev/null; do | ||
| echo "Still waiting for API…" | ||
| sleep 2 | ||
| done | ||
| '; then | ||
| echo "::endgroup::" | ||
| echo "::error::Timed out waiting for API to become healthy" | ||
|
|
||
| echo "::group::Container status:" | ||
| docker compose -f compose.local.yml ps | ||
| echo "::endgroup::" | ||
|
|
||
| echo "::group::Recent container logs:" | ||
| docker compose -f compose.local.yml logs --tail=100 | ||
| echo "::endgroup::" | ||
|
|
||
| exit 1 | ||
| fi | ||
|
|
||
| echo "::group::API is responding" | ||
| curl -v -f http://localhost:3003/api/status | ||
| echo "::endgroup::" | ||
|
|
||
| - name: Run API tests | ||
| working-directory: tests | ||
| run: pnpm test:api | ||
| env: | ||
| SKIP_WEBSERVER: true | ||
| BASE_URL: http://localhost:3003 | ||
|
|
||
| - name: Upload test results (JUnit) | ||
| if: always() | ||
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | ||
| with: | ||
| name: api-test-results | ||
| path: tests/test-results/junit.xml | ||
| retention-days: 30 | ||
|
|
||
| - name: Server logs on failure | ||
| if: failure() | ||
| run: docker compose -f compose.local.yml logs server | ||
| - name: MeiliSearch logs on failure | ||
| if: failure() | ||
| run: docker compose -f compose.local.yml logs meilisearch | ||
| - name: Database logs on failure | ||
| if: failure() | ||
| run: docker compose -f compose.local.yml logs db | ||
|
|
||
| ui-tests-desktop: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 20 | ||
| permissions: | ||
| contents: read | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| browser: [chromium] | ||
| subsystem: [main, search, navigation, details, calendar-about] | ||
|
|
||
| steps: | ||
| - uses: BRAINSia/free-disk-space@f9f59b0ef974ff4b873aa243ce5278ab644eedc6 # v2.1.2 | ||
| with: | ||
| tool-cache: false | ||
| mandb: true | ||
| android: true | ||
| dotnet: true | ||
| haskell: true | ||
| large-packages: true | ||
| docker-images: true | ||
| swap-storage: true | ||
| - name: Checkout code | ||
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | ||
| with: { persist-credentials: false } | ||
|
|
||
| - name: Setup | Pull Docker images | ||
| run: docker compose pull | ||
| - name: Setup | Build Docker images | ||
| run: docker compose -f compose.local.yml build | ||
|
|
||
| - name: Setup | Set up pnpm | ||
| uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0 | ||
| with: | ||
| version: 10.14.0 | ||
| - name: Setup | Set up Node.js | ||
| uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 | ||
| with: | ||
| node-version: 24 | ||
| cache: 'pnpm' | ||
| cache-dependency-path: tests/pnpm-lock.yaml | ||
|
|
||
| - name: Setup | Install Playwright dependencies | ||
| working-directory: tests | ||
| run: pnpm install | ||
| - name: Install Browser | ||
| working-directory: tests | ||
| run: pnpm exec playwright install --with-deps ${{ matrix.browser }} | ||
|
|
||
| - name: Setup | Create .env file for docker-compose | ||
| run: | | ||
| cat > .env << EOF | ||
| POSTGRES_PASSWORD=test_password | ||
| POSTGRES_USER=postgres | ||
| POSTGRES_DB=navigatum_test | ||
| MEILI_MASTER_KEY=test_master_key | ||
| LOG_LEVEL=debug | ||
| EOF | ||
|
|
||
| - name: Setup | Start Docker services | ||
| run: | | ||
| docker compose -f compose.local.yml up -d | ||
| echo "Waiting for services to be healthy..." | ||
| timeout 120 bash -c 'until curl -f http://localhost:3003/api/locations/mi; do sleep 2; done' | ||
| timeout 120 bash -c 'until curl -f http://localhost:3003/api/search?q=MI; do sleep 2; done' | ||
| timeout 120 bash -c 'until curl -f http://localhost:3000/; do sleep 2; done' | ||
|
|
||
| - name: Run UI tests (${{ matrix.subsystem }}) | ||
| working-directory: tests | ||
| run: pnpm test specs/${{ matrix.subsystem }}.ui.spec.ts --project=ui-tests-${{ matrix.browser }} | ||
| env: | ||
| BASE_URL: http://localhost:3000 | ||
| SKIP_WEBSERVER: true | ||
|
|
||
| - name: Upload test results | ||
| if: always() | ||
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | ||
| with: | ||
| name: ui-playwright-report-${{ matrix.browser }}-${{ matrix.subsystem }} | ||
| path: tests/playwright-report/ | ||
| retention-days: 30 | ||
|
|
||
| - name: Upload test results (JUnit) | ||
| if: always() | ||
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | ||
| with: | ||
| name: ui-test-results-${{ matrix.browser }}-${{ matrix.subsystem }} | ||
| path: tests/test-results/junit.xml | ||
| retention-days: 30 | ||
|
|
||
| - name: Server logs on failure | ||
| if: failure() | ||
| run: docker compose -f compose.local.yml logs server | ||
| - name: MeiliSearch logs on failure | ||
| if: failure() | ||
| run: docker compose -f compose.local.yml logs meilisearch | ||
| - name: Database logs on failure | ||
| if: failure() | ||
| run: docker compose -f compose.local.yml logs db | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.