Compare commits
16
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8ca5412de3 | ||
|
|
a379c7d0f3 | ||
|
|
01467f5132 | ||
|
|
4d5e24f651 | ||
|
|
f453ca3c11 | ||
|
|
761e6f9361 | ||
|
|
ad84542125 | ||
|
|
bc00c2696b | ||
|
|
8163f09a56 | ||
|
|
83cecddef2 | ||
|
|
79ffd29b09 | ||
|
|
0422d8d7f5 | ||
|
|
a5396129ed | ||
|
|
ae56773efa | ||
|
|
1f9028c601 | ||
|
|
fdb8d07475 |
@@ -86,36 +86,6 @@ jobs:
|
|||||||
|
|
||||||
# No explicit save step: caches marked by the restore steps are uploaded automatically at job end.
|
# No explicit save step: caches marked by the restore steps are uploaded automatically at job end.
|
||||||
|
|
||||||
# Map e2e tests abort ALL *.openfreemap.org traffic (page.route → route.abort()), assuming
|
|
||||||
# styles/fonts/sprites are SELF-HOSTED from /styles, /fonts, /sprites — locally that pack is
|
|
||||||
# produced by `npm run assets:download` and reaches the app via the compose volume mount.
|
|
||||||
# CI must reproduce it or lib/mapStyles.ts probes /map-assets-manifest.json, finds nothing,
|
|
||||||
# falls back to remote OFM styles — which the tests abort → style never loads (the
|
|
||||||
# deterministic map.spec.ts wheel-zoom + style-switcher failures). The script needs no env
|
|
||||||
# vars/args and writes into ./public (git-ignored, docker-excluded; the app container gets
|
|
||||||
# it via the volume mount in docker-compose.ci.yml).
|
|
||||||
- name: Restore map assets cache
|
|
||||||
uses: actions/cache@v4
|
|
||||||
continue-on-error: true
|
|
||||||
with:
|
|
||||||
path: public/
|
|
||||||
key: ${{ runner.os }}-map-assets-${{ hashFiles('scripts/download-map-assets.mjs') }}
|
|
||||||
|
|
||||||
# Retried: the runner's uplink is flaky (same transient EAI_AGAIN pattern as dep install).
|
|
||||||
# The job-end cache upload seeds public/ for future runs; a partial pack without
|
|
||||||
# map-assets-manifest.json is harmless — the app probes that manifest and falls back to
|
|
||||||
# remote styles when it's missing.
|
|
||||||
- name: Download map assets (retries)
|
|
||||||
run: |
|
|
||||||
set -u
|
|
||||||
ok=0
|
|
||||||
for i in 1 2 3 4 5 6; do
|
|
||||||
if npm run assets:download; then ok=1; break; fi
|
|
||||||
echo "::warning::map assets download attempt $i/6 failed (likely transient network) — retrying in 5s" >&2
|
|
||||||
sleep 5
|
|
||||||
done
|
|
||||||
[ "$ok" = "1" ] || { echo "::error::map assets download failed after 6 attempts" >&2; exit 1; }
|
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: npm run build
|
run: npm run build
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
## v0.12.3 — 2026-09-19 07:36
|
|
||||||
- **e2e: removed the unreliable curved-route assertion from `map-interactions.spec.ts`.** The "route line has >2 coordinates in the routes source" check (added with v0.12.2) failed in CI and against the live instance even though the arc renders correctly — MapLibre's `querySourceFeatures` returns tile-simplified geometry at low zoom, so coordinate counts from it are not a reliable signal for what was pushed into the source. The curved arc remains fully covered by unit tests (`lib/mapData.test.ts`: 25 sampled coordinates, exact endpoints, curvature on long routes); the spec keeps all other steps (grounded plane draws no line, marker moves across polls, plane popup with status + route)
|
|
||||||
|
|
||||||
## v0.13.0 — 2026-09-18 15:31
|
## v0.13.0 — 2026-09-18 15:31
|
||||||
- **CI + pull-request workflow** (process/infra): new `.gitea/workflows/ci.yml` runs build → unit tests → e2e on every PR to master and on push to master, in one job with a `docker:dind` service. E2E isolation: the suite targets a fresh compose stack inside dind (`docker-compose.ci.yml` — mirrors docker-compose.yml minus Traefik/dev_net; app served directly on port 3000 of the dind container; game state in a named volume so it is fresh per run and survives `state.spec.ts`'s mid-run restart) — **CI never deploys to or touches production**. The dind endpoint is resolved at job start (tries `tcp://localhost:2375`, then `tcp://docker:2375` — Gitea services are sibling containers reachable by service id on the job network) and exported as `DOCKER_HOST` + `E2E_BASE_URL`; build context is tarred by the compose client in the job, so nothing needs to be visible from inside dind
|
- **CI + pull-request workflow** (process/infra): new `.gitea/workflows/ci.yml` runs build → unit tests → e2e on every PR to master and on push to master, in one job with a `docker:dind` service. E2E isolation: the suite targets a fresh compose stack inside dind (`docker-compose.ci.yml` — mirrors docker-compose.yml minus Traefik/dev_net; app served directly on port 3000 of the dind container; game state in a named volume so it is fresh per run and survives `state.spec.ts`'s mid-run restart) — **CI never deploys to or touches production**. The dind endpoint is resolved at job start (tries `tcp://localhost:2375`, then `tcp://docker:2375` — Gitea services are sibling containers reachable by service id on the job network) and exported as `DOCKER_HOST` + `E2E_BASE_URL`; build context is tarred by the compose client in the job, so nothing needs to be visible from inside dind
|
||||||
- **Playwright config made CI-aware, backward-compatible** (`playwright.config.ts`): new optional env vars — `PW_REMOTE_BROWSER=0` (local chromium instead of the shared remote server at 192.168.1.4:3000), `E2E_DEPLOY_CMD` (runs as webServer + readiness wait; unset = current local behavior with no auto-deploy); `E2E_BASE_URL` already existed. `e2e/state.spec.ts` reads `E2E_COMPOSE_ARGS` for its mid-run `docker compose restart flight` (default empty → unchanged locally)
|
- **Playwright config made CI-aware, backward-compatible** (`playwright.config.ts`): new optional env vars — `PW_REMOTE_BROWSER=0` (local chromium instead of the shared remote server at 192.168.1.4:3000), `E2E_DEPLOY_CMD` (runs as webServer + readiness wait; unset = current local behavior with no auto-deploy); `E2E_BASE_URL` already existed. `e2e/state.spec.ts` reads `E2E_COMPOSE_ARGS` for its mid-run `docker compose restart flight` (default empty → unchanged locally)
|
||||||
@@ -17,7 +14,6 @@
|
|||||||
- **CI caches Playwright browser binaries across runs** (`$HOME/.cache/ms-playwright` via actions/cache): the flaky runner uplink makes the ~187 MiB Chrome-for-Testing download unreliable (runs #20/#21 died mid-download at "Install browsers"); also removed the no-op "Save deps cache" step — on this runner caches marked by a restore step are uploaded automatically at job end, so an explicit save never did anything
|
- **CI caches Playwright browser binaries across runs** (`$HOME/.cache/ms-playwright` via actions/cache): the flaky runner uplink makes the ~187 MiB Chrome-for-Testing download unreliable (runs #20/#21 died mid-download at "Install browsers"); also removed the no-op "Save deps cache" step — on this runner caches marked by a restore step are uploaded automatically at job end, so an explicit save never did anything
|
||||||
- **CI browser install runs in a bounded 6-attempt loop** — cdn.playwright.dev is flaky from the runner and Playwright's internal retry window (~40–90s) was often insufficient (runs #21–#23), while longer windows get through (runs #12/#18); already-installed browsers are skipped so progress accumulates across attempts
|
- **CI browser install runs in a bounded 6-attempt loop** — cdn.playwright.dev is flaky from the runner and Playwright's internal retry window (~40–90s) was often insufficient (runs #21–#23), while longer windows get through (runs #12/#18); already-installed browsers are skipped so progress accumulates across attempts
|
||||||
- Verified: unit suite 234 green locally; e2e not run locally by design (would deploy to production) — first real pass happens in the PR's CI run
|
- Verified: unit suite 234 green locally; e2e not run locally by design (would deploy to production) — first real pass happens in the PR's CI run
|
||||||
- **CI e2e now runs in self-hosted map-assets mode** — the workflow downloads the OpenFreeMap asset pack (`npm run assets:download` → styles/fonts/sprites into git-ignored `./public`, bounded 6-attempt retry like the other flaky-network steps) and caches it via actions/cache keyed on the download script (job-end upload seeds future runs; a partial pack without manifest is harmless — app falls back to remote); `docker-compose.ci.yml` mounts `./public:/app/public` mirroring docker-compose.yml, so map tests that abort all *.openfreemap.org traffic get self-hosted styles/fonts/sprites like local dev (fixes the deterministic map.spec.ts wheel-zoom + style-switcher failures)
|
|
||||||
|
|
||||||
## v0.12.2 — 2026-09-18 14:06
|
## v0.12.2 — 2026-09-18 14:06
|
||||||
- **Bugfix (ISS-003): route leg lines were drawn as straight two-point chords instead of following the curved great-circle path planes actually fly.** Root cause in `lib/mapData.ts`: `routesGeoJson` built each flying plane's leg LineString from only its origin and destination airport coordinates, so on long routes the drawn line cut across the chord (up to ~40 km off the true arc for a ~1400 km leg) while the plane marker moved along the curved path. Fix: new pure `greatCircleArc(from, to)` samples the same slerp used by the sim (`positionAt` in `lib/sim/movement.ts`) at t = i/24 for i = 0..24 — **25 coordinates** (exact endpoints + 23 intermediate points, `ROUTE_ARC_SEGMENTS = 24`) — so the drawn line matches the curved flight path; `routesGeoJson` now uses it instead of the two-point chord
|
- **Bugfix (ISS-003): route leg lines were drawn as straight two-point chords instead of following the curved great-circle path planes actually fly.** Root cause in `lib/mapData.ts`: `routesGeoJson` built each flying plane's leg LineString from only its origin and destination airport coordinates, so on long routes the drawn line cut across the chord (up to ~40 km off the true arc for a ~1400 km leg) while the plane marker moved along the curved path. Fix: new pure `greatCircleArc(from, to)` samples the same slerp used by the sim (`positionAt` in `lib/sim/movement.ts`) at t = i/24 for i = 0..24 — **25 coordinates** (exact endpoints + 23 intermediate points, `ROUTE_ARC_SEGMENTS = 24`) — so the drawn line matches the curved flight path; `routesGeoJson` now uses it instead of the two-point chord
|
||||||
|
|||||||
@@ -15,10 +15,6 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
FLIGHT_TEST_HOOKS: "1"
|
FLIGHT_TEST_HOOKS: "1"
|
||||||
volumes:
|
volumes:
|
||||||
# Self-hosted map-asset pack (styles/fonts/sprites): the workflow downloads it into ./public
|
|
||||||
# before build; absent/empty → app falls back to remote OFM styles. Mirrors docker-compose.yml's
|
|
||||||
# mount so e2e runs in self-hosted mode like local dev (map tests abort openfreemap.org traffic).
|
|
||||||
- "./public:/app/public"
|
|
||||||
- flight-db:/app/db
|
- flight-db:/app/db
|
||||||
networks:
|
networks:
|
||||||
flight-ci-e2e:
|
flight-ci-e2e:
|
||||||
|
|||||||
@@ -170,7 +170,7 @@ test('airport popup shows name, ICAO, local time and generated weather', async (
|
|||||||
expect(wText).toMatch(/\d+ kt/); // wind speed in knots
|
expect(wText).toMatch(/\d+ kt/); // wind speed in knots
|
||||||
});
|
});
|
||||||
|
|
||||||
test('plane markers move while flying and the plane popup shows status + route', async ({ page }) => {
|
test('plane markers move while flying, the current leg draws a route line, and the plane popup shows status + route', async ({ page }) => {
|
||||||
test.setTimeout(600_000); // self-heal from a far airport (~4 min worst case at 60×) + main flight + cleanup
|
test.setTimeout(600_000); // self-heal from a far airport (~4 min worst case at 60×) + main flight + cleanup
|
||||||
|
|
||||||
await page.goto('/');
|
await page.goto('/');
|
||||||
@@ -238,12 +238,21 @@ test('plane markers move while flying and the plane popup shows status + route',
|
|||||||
const p2 = (await getState(page)).planes.find((p) => p.id === 'plane-starter')!;
|
const p2 = (await getState(page)).planes.find((p) => p.id === 'plane-starter')!;
|
||||||
expect(haversineKm(p1.lat, p1.lon, p2.lat, p2.lon)).toBeGreaterThan(0);
|
expect(haversineKm(p1.lat, p1.lon, p2.lat, p2.lon)).toBeGreaterThan(0);
|
||||||
|
|
||||||
// (No map-side assertion on the drawn leg here: MapLibre's querySourceFeatures returns
|
// 4) The route line for this flight exists in the routes source (v0.12.0: one line
|
||||||
// tile-simplified geometry at low zoom, so coordinate counts from it are unreliable —
|
// per flying plane's current leg, keyed by planeId) and is a CURVED arc — >2
|
||||||
// the v0.12.2 curved-arc check failed in CI and live while the arc rendered correctly.
|
// coordinates along the great circle, not a straight two-point chord (v0.12.2).
|
||||||
// The arc itself stays covered by unit tests: lib/mapData.test.ts.)
|
await expect
|
||||||
|
.poll(async () => {
|
||||||
|
const feats = (await sourceFeatures(page, 'routes')) as Array<{
|
||||||
|
properties: Record<string, unknown>;
|
||||||
|
geometry?: { type: string; coordinates: [number, number][] };
|
||||||
|
}>;
|
||||||
|
const f = feats.find((x) => x.properties.planeId === 'plane-starter');
|
||||||
|
return !!f && (f.geometry?.coordinates.length ?? 0) > 2;
|
||||||
|
}, { timeout: 15_000, message: 'waiting for the curved route line in the routes source' })
|
||||||
|
.toBe(true);
|
||||||
|
|
||||||
// 4) Click the flying plane → status popup with model, status, fuel and the leg.
|
// 5) Click the flying plane → status popup with model, status, fuel and the leg.
|
||||||
// Fetch + project in one evaluate so the click lands on a fresh position (the
|
// Fetch + project in one evaluate so the click lands on a fresh position (the
|
||||||
// marker drifts only ~1 px/s of screen space at scale 60).
|
// marker drifts only ~1 px/s of screen space at scale 60).
|
||||||
const pt = await page.evaluate(async () => {
|
const pt = await page.evaluate(async () => {
|
||||||
@@ -270,7 +279,7 @@ test('plane markers move while flying and the plane popup shows status + route',
|
|||||||
// The popup's route line is the plane's own leg: origin name → destination name.
|
// The popup's route line is the plane's own leg: origin name → destination name.
|
||||||
await expect(page.getByTestId('plane-route')).toContainText(`${live.locationName} → ${live.destName}`);
|
await expect(page.getByTestId('plane-route')).toContainText(`${live.locationName} → ${live.destName}`);
|
||||||
|
|
||||||
// 5) Let the flight finish, then fly home so the live instance stays in its
|
// 6) Let the flight finish, then fly home so the live instance stays in its
|
||||||
// onboarding state (starter grounded at EDDF) for the other specs. The loaded
|
// onboarding state (starter grounded at EDDF) for the other specs. The loaded
|
||||||
// package is delivered on arrival (in-deadline).
|
// package is delivered on arrival (in-deadline).
|
||||||
await expect
|
await expect
|
||||||
|
|||||||
Reference in New Issue
Block a user