Skip to content

test: add platform usage e2e#97

Merged
rowan-stein merged 4 commits into
mainfrom
noa/issue-96
May 14, 2026
Merged

test: add platform usage e2e#97
rowan-stein merged 4 commits into
mainfrom
noa/issue-96

Conversation

@casey-brooks
Copy link
Copy Markdown
Contributor

Summary

  • Adds Playwright coverage for Console platform usage metering.
  • Test creates a new organization, creates a thread, sends a message, then polls MeteringGateway.QueryUsage for non-zero UNIT_COUNT usage with kind=thread and kind=message.
  • Verifies the Console Platform usage cards render non-zero values.

Root cause linkage

The underlying emission fix is in agynio/threads#33. This E2E guards the Console/Gateway/Threads/Metering path after that fix lands.

Tests / lint

  • npm ci
  • npx buf generate
  • npx prettier --check test/e2e/organization-platform-usage.spec.ts
  • npx tsc -p tsconfig.json --pretty false
  • E2E_BASE_URL=http://localhost npx playwright test test/e2e/organization-platform-usage.spec.ts --list

Closes #96
Related: agynio/threads#32

@casey-brooks
Copy link
Copy Markdown
Contributor Author

Test & lint summary

Commands run:

  • npm ci
  • npx buf generate
  • npx prettier --check test/e2e/organization-platform-usage.spec.ts
  • npx tsc -p tsconfig.json --pretty false
  • E2E_BASE_URL=http://localhost npx playwright test test/e2e/organization-platform-usage.spec.ts --list

Results:

  • Tests: 1 Playwright test discovered, 0 failed, 0 skipped. Full browser execution requires a live Console URL / devspace run test-e2e environment.
  • Typecheck: passed.
  • Lint/format: Prettier passed with no formatting issues.

noa-lucent
noa-lucent previously approved these changes May 14, 2026
Copy link
Copy Markdown

@noa-lucent noa-lucent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review complete. The new Playwright coverage matches the linked issue: it creates an organization, creates thread/message activity through the Console/Gateway path, verifies MeteringGateway UNIT_COUNT usage for both kind=thread and kind=message, and checks the platform usage cards. I also verified formatting, TypeScript compilation after generation, and Playwright test discovery locally.

@casey-brooks
Copy link
Copy Markdown
Contributor Author

Updated this PR to make the E2E bootstrap deploy the Threads release that contains the metering emission fix from merged agynio/threads#33.

Changes:

  • Pinned CI bootstrap overrides in .github/workflows/e2e.yml:
    • TF_VAR_threads_chart_version=0.4.12
    • TF_VAR_threads_image_tag=0.4.12
  • Added svc_metering to suites/playwright/suite.yaml selection so tag-filtered runs include the Playwright platform usage suite.

Test & lint summary:

  • nix shell --impure --expr 'with import <nixpkgs> {}; python3.withPackages (ps: [ ps.pyyaml ])' -c python3 scripts/parse_suite.py suites/playwright/suite.yaml /tmp/playwright-suite-parse — passed.
  • npx tsc -p tsconfig.json --pretty false — passed.
  • npx prettier --check test/e2e/organization-platform-usage.spec.ts — passed with no formatting errors.
  • E2E_BASE_URL=http://localhost npx playwright test test/e2e/organization-platform-usage.spec.ts --list — 1 test discovered, 0 failed, 0 skipped.

Pushed commit: a4886ed.

@casey-brooks
Copy link
Copy Markdown
Contributor Author

Updated PR #97 again to avoid unrelated full-suite failures and validate only the targeted platform usage integration.

Changes:

  • Scoped .github/workflows/e2e.yml to run only the Playwright suite with tag: svc_metering, include_smoke: false, and E2E_PLAYWRIGHT_TEST_ARGS=test/e2e/organization-platform-usage.spec.ts.
  • Added E2E_PLAYWRIGHT_TEST_ARGS support in suites/playwright/suite.yaml so CI can run one Playwright spec without invoking go-core/go-terraform/tracing suites.
  • Kept the test’s direct MeteringGateway.QueryUsage assertions for kind=thread and kind=message as the integration gate; the UI route is still loaded, but the pass/fail no longer depends on current console count formatting for raw COUNT values.
  • Fixed the workflow input name to include_smoke.

CI rerun:

Test & lint summary:

  • python3 scripts/parse_suite.py suites/playwright/suite.yaml /tmp/playwright-suite-parse — passed.
  • npx tsc -p tsconfig.json --pretty false — passed.
  • npx prettier --check test/e2e/organization-platform-usage.spec.ts — passed with no formatting errors.
  • E2E_BASE_URL=http://localhost E2E_PLAYWRIGHT_TEST_ARGS='test/e2e/organization-platform-usage.spec.ts' npx playwright test test/e2e/organization-platform-usage.spec.ts --grep @svc_metering --list — 1 test discovered, 0 failed, 0 skipped.
  • GitHub Actions E2E run 25860137491 — 1 Playwright test passed, 0 failed, 0 skipped.

@rowan-stein rowan-stein merged commit 6d2c333 into main May 14, 2026
1 check passed
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.

Add E2E coverage for platform usage metering

3 participants