Skip to content

test(integration): run Auth variants from one project and a manifest - #1932

Draft
grdsdev wants to merge 1 commit into
guilhermesouza/sdk-3343-supabase-swift-verify-es384-andfrom
claude/integration-tests-restructure-6aa44a
Draft

grdsdev wants to merge 1 commit into
guilhermesouza/sdk-3343-supabase-swift-verify-es384-andfrom
claude/integration-tests-restructure-6aa44a

Conversation

@grdsdev

@grdsdev grdsdev commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Stacked on #1931. Restructures how integration test variants run: one shared project, one
.env file per variant, and a .variant(...) trait instead of a --skip list.

Chosen design: A + B + D below, one CI job per OS.

Local run (macOS, native stack)

==> main
✔ Test run with 437 tests in 55 suites passed after 95.640 seconds.
==> eddsa
✔ Test run with 1 test in 1 suite passed after 0.116 seconds.
==> es384
✘ Test claimsVerifiesES384LocallyAgainstJWKS() recorded an issue at AuthClientIntegrationTests.swift:1154:4: Caught error: AuthError(server): error generating jwt token [status 500] [code unexpected_failure]
==> es512
✔ Test claimsVerifiesES512LocallyAgainstJWKS() passed after 0.119 seconds.
==> secure-email-change
✔ Test verifyOTPForSecureEmailChange() passed after 0.127 seconds.
Integration tests: 4 passed (main eddsa es512 secure-email-change), 1 failed (es384)

ES384 fails as on #1931, until an Auth release with supabase/auth#2989 ships. It no longer hides
the later variants.

Design note

Problem

Each test that needs a different Auth setup adds:

  • a full copy of a ~70-line config.toml (three copies today, which differ in 1–2 lines),
  • 4–5 CI steps (key gen, start, export endpoints, run, stop) on both OSes,
  • 2–3 lines in scripts/test-integration.sh,
  • a --skip in the main run, in two places (script and CI), which must stay in sync,
  • a section in DEVELOPMENT.md.

Also, the variant steps run in sequence in one CI job. Today a failure in the main suite or in
one variant skips every later variant (ES384 is placed last on purpose to work around this).

What the Supabase CLI supports (checked, not guessed)

CLI 3.5.0, source in supabase/cli apps/cli/src/config/cli-config-keys.ts and
commands/start/SIDE_EFFECTS.md:

  • Every config key has a shell-env override: SUPABASE_ + the upper-snake path, for example
    auth.email.enable_confirmations → SUPABASE_AUTH_EMAIL_ENABLE_CONFIRMATIONS. Precedence is
    flag > shell env > project .env* > config > default, on both backends (legacy Docker and
    the experimental stack). Only the [local] section has no override.
  • supabase start --stack <name> (experimental stack only) runs several named stacks of one
    project, each on its own ports.

Probed locally with one minimal project:

Override Native stack (macOS) Docker stack (legacy, as Linux CI)
SUPABASE_AUTH_SIGNING_KEYS_PATH (ES512 set) JWKS has P-256 + P-521 same (relative path resolves against supabase/)
SUPABASE_AUTH_EMAIL_ENABLE_CONFIRMATIONS=false over true in config mailer_autoconfirm: true same

So the three variant projects can collapse into one.

Options

A. One shared variant project + env overrides (fewer projects)

Replace supabase-secure-email-change, supabase-eddsa, and supabase-ecdsa with one minimal
Auth-only project, Tests/IntegrationTests/supabase-variants. A variant sets only what differs,
as SUPABASE_* env vars.

  • Pro: one config to maintain. A new Auth setting needs no new project.
  • Con: a variant that needs a different schema, seed, or service set (not Auth config) still needs
    its own project. That is not the case for any variant today.

B. A manifest that drives the script and CI

One file per variant, for example Tests/IntegrationTests/variants/es512.env:

# claimsVerifiesES512LocallyAgainstJWKS: Auth signs with a P-521 key.
SETUP="scripts/gen-ecdsa-signing-key.sh ES512 \$KEYS"
SUPABASE_AUTH_SIGNING_KEYS_PATH=./signing_keys.json
FILTER=claimsVerifiesES512LocallyAgainstJWKS

scripts/test-integration.sh runs the main suite, then loops over variants/*.env. CI calls the
same script, so a new variant is one file plus its tests, with no CI or script edit.

  • Pro: one source of truth for local runs and CI.
  • Con: CI shows one "Run integration tests" step, not one step per variant. Mitigation:
    ::group:: per variant and a pass/fail table in $GITHUB_STEP_SUMMARY.

C. A CI matrix job per variant

  • Pro: each variant is its own check; one failure does not hide another.
  • Con: each job pays runner start, Swift build-cache restore, and CLI setup. On macOS that is
    several minutes and the most expensive runner, for a test that runs in seconds. 6 variants × 2
    OSes = 12 jobs instead of 2. The Linux sticky disk is keyed per job name, so it either fans out
    into 6 disks or races on one.
  • The isolation benefit is cheaper to get inside one job (see below).

D. Test selection: a variant trait instead of a --skip list

A small Swift Testing trait, for example .variant("es512"), enables a test only when
SUPABASE_TEST_VARIANT matches. The main run sets no variant, so it needs no --skip list. The
variant run sets SUPABASE_TEST_VARIANT and --filters to its tests. A forgotten skip can no
longer break the main suite, and a variant test can no longer run against the wrong stack by
accident.

(Swift Testing tags alone do not help here: swift test has no tag filter on the command line,
and tags cannot read the environment.)

Recommendation

A + B + D, in one job per OS (not C).

  • One supabase-variants project, overridden per variant by env vars.
  • One variants/<name>.env file per variant; scripts/test-integration.sh is the only runner,
    and CI calls it.
  • The script runs every variant even when an earlier one fails, prints a summary, and exits
    non-zero at the end. ES384 then fails on its own and the others still report, with no ordering
    trick.
  • A .variant(...) trait replaces the --skip list.
  • DEVELOPMENT.md gets one "Adding an integration test variant" section; the per-project
    sections go away.

Adding a variant after this: one .env file, the tests with .variant("name"), and (if needed)
a setup script. No CI, script, config, or doc edits.

Not in scope: running variants in parallel with --stack on macOS (Docker uses fixed ports, so
Linux cannot), and moving the main suite onto the manifest.

Also seen

Merge supabase-secure-email-change, supabase-eddsa and supabase-ecdsa into
one minimal project, supabase-variants. Each variant is now one
supabase-variants/<name>.env file with its test filter, an optional setup
command, and SUPABASE_* overrides, which the CLI reads as config overrides
on both the Docker and the native stack.

scripts/test-integration.sh runs the main suite and every variant, goes on
after a failure, and prints a summary. CI calls the script instead of
repeating each start, export, run and stop step. A .variant(...) trait
enables a variant's tests only in its run, so the main run needs no
--skip list.
@coderabbitai

coderabbitai Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@grdsdev
grdsdev added this pull request to stack #1933 December 4, 2026 12:12
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 47329990324

Warning

No base build found for commit 17265f1 on guilhermesouza/sdk-3343-supabase-swift-verify-es384-and.
Coverage changes can't be calculated without a base build.
If a base build is processing, this comment will update automatically when it completes.

Coverage: 96.396%

Details

  • Patch coverage: No coverable lines changed in this PR.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

Requires a base build to compare against. How to fix this →


Coverage Stats

Coverage Status
Relevant Lines: 18260
Covered Lines: 17602
Line Coverage: 96.4%
Coverage Strength: 7140.87 hits per line

💛 - Coveralls

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants