Skip to content

Commit c263f13

Browse files
committed
Add additional logging for Supabase schema migration on GitHub workflow
1 parent 3bdde7b commit c263f13

2 files changed

Lines changed: 43 additions & 37 deletions

File tree

.github/workflows/test.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,10 @@ jobs:
188188
npm run containers:supabase:db-push
189189
echo "::endgroup::"
190190
191+
echo "::group::Supabase migration status"
192+
FORCE_COLOR=1 npx supabase migration list --local --workdir suprabase
193+
echo "::endgroup::"
194+
191195
echo "::group::Supabase schema snapshot"
192196
schema_dir="artifacts/supabase"
193197
schema_path="${schema_dir}/schema.sql"
@@ -198,6 +202,39 @@ jobs:
198202
echo "(full schema saved to ${schema_path})"
199203
echo "::endgroup::"
200204
205+
echo "::group::Supabase schema guard"
206+
bash <<'BASH'
207+
set -euo pipefail
208+
209+
db_container_line=$(docker ps --format '{{.ID}} {{.Names}} {{.Image}}' | awk '$3 ~ /supabase\/postgres/ {print $1" "$2; exit}')
210+
if [ -z "${db_container_line}" ]; then
211+
echo "Supabase database container not found; cannot verify migrations" >&2
212+
exit 1
213+
fi
214+
215+
container_id=$(echo "${db_container_line}" | awk '{print $1}')
216+
container_name=$(echo "${db_container_line}" | awk '{print $2}')
217+
echo "Inspecting tables inside ${container_name} (${container_id})"
218+
219+
required_tables=(newsletter_confirmations consent_records dsar_requests)
220+
missing=0
221+
222+
for table in "${required_tables[@]}"; do
223+
if ! docker exec "${container_id}" psql -U postgres -d postgres -At -c "select to_regclass('public.${table}');" | grep -q "public.${table}"; then
224+
echo "❌ Missing table public.${table}"
225+
missing=1
226+
else
227+
echo "✅ Found table public.${table}"
228+
fi
229+
done
230+
231+
if [ "${missing}" -ne 0 ]; then
232+
echo "Required tables missing after Supabase migrations" >&2
233+
exit 1
234+
fi
235+
BASH
236+
echo "::endgroup::"
237+
201238
echo "::group::Restart Supabase REST container"
202239
bash <<'BASH'
203240
set -euo pipefail
Lines changed: 6 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,12 @@
11
/**
2-
* Service Worker Tests
3-
* Validates service worker registration, caching, and offline fallbacks.
2+
* Service Worker Tests - Must be QA'd manually
3+
*
4+
* Note: Automated testing of service workers is not feasible in this E2E test suite
5+
* due to limitations with the Astro build process and Vercel adapter.
46
*/
57

6-
import { expect, test } from '@test/e2e/helpers'
7-
import { PwaPage } from '@test/e2e/helpers/pageObjectModels/PwaPage'
8+
import { test } from '@test/e2e/helpers'
89

910
test.describe('Service Worker', () => {
10-
test.skip('@ready service worker registers and activates', async ({ page: playwrightPage }) => {
11-
const pwaPage: PwaPage = await PwaPage.init(playwrightPage)
12-
await pwaPage.navigateToHomeAndWaitForSW()
13-
14-
await pwaPage.expectServiceWorkerRegistered()
15-
await pwaPage.expectServiceWorkerActivated()
16-
})
17-
18-
test.skip('@ready service worker populates caches after first run', async ({ page: playwrightPage }) => {
19-
const pwaPage: PwaPage = await PwaPage.init(playwrightPage)
20-
await pwaPage.navigateToHomeAndWaitForSW()
21-
22-
const cachedAssets = await pwaPage.getCachedAssetsCount()
23-
expect(cachedAssets).toBeGreaterThan(0)
24-
await pwaPage.expectCacheVersioning()
25-
})
26-
27-
test.skip('@ready offline navigation falls back to 404 page', async ({ page: playwrightPage, context, browserName }) => {
28-
test.skip(browserName === 'webkit', 'Playwright WebKit cannot perform navigation requests while offline')
29-
30-
const pwaPage: PwaPage = await PwaPage.init(playwrightPage)
31-
await pwaPage.navigateToHomeAndWaitForSW()
32-
33-
await pwaPage.goOffline(context)
34-
try {
35-
const response = await pwaPage.goto('/definitely-not-real')
36-
expect(response).not.toBeNull()
37-
await pwaPage.expectNotFoundFallback()
38-
} finally {
39-
await pwaPage.goOnline(context)
40-
}
41-
})
11+
test.fixme('@ready service worker cannot be tested in automated E2E tests and must be QAed manually, because the @vite-pwa/astro integration that generates sw.js runs on the astro:build:done so that it has access to all generated build artifacts. The Vercel adapter for Astro is incompatible with astro serve, so it is not possible to test against a built environment.', async () => {})
4212
})
43-

0 commit comments

Comments
 (0)