Skip to content

test(e2e): cover organization LLM profile key lifecycle - #1076

Draft
saurya wants to merge 1 commit into
mainfrom
e2e/org-llm-profile-key
Draft

test(e2e): cover organization LLM profile key lifecycle#1076
saurya wants to merge 1 commit into
mainfrom
e2e/org-llm-profile-key

Conversation

@saurya

@saurya saurya commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Migration

Ports https://github.com/OpenHands/saas-deploy/pull/586 from OpenHands/saas-deploy so the test ships with the OpenHands-Cloud chart release it validates.

This pull request is based directly on main, which includes the foundational Playwright harness from OpenHands-Cloud #1048.

Original scenario contract

Scenario

Adds one Playwright spec with one test that creates a uniquely named organization-wide LLM profile using a disposable key, verifies only the non-secret api_key_set flag and model, restores the prior active profile, and deletes the temporary profile through current UI selectors.

Key handling

  • The key is read only from TEST_ORG_LLM_API_KEY.
  • The test contains no console logging and never reads a key back from the API.
  • Assertions use only api_key_set: true; PR output and validation never print the key.

Validation

  • npm ci completed once in the isolated clone
  • npm run typecheck
  • focused ESLint and Prettier checks ✅
  • npx playwright test tests/org-llm-profile-key.spec.ts --list
  • static check confirms no console logging/key interpolation ✅
  • repository-wide npm run lint ⚠️ blocked by 15 pre-existing errors in ConversationPage.ts, HomePage.ts, and smoke.spec.ts; this new spec has no lint errors
  • Live execution not attempted because required auth and provider fixtures are unavailable locally.

Environment contract

  • e2e_tests/fixtures/auth.json: organization admin or owner
  • Selected non-personal organization has organization-wide BYOK profile management enabled and an active profile
  • TEST_ORG_LLM_API_KEY: disposable valid provider key
  • TEST_ORG_LLM_MODEL: compatible provider/model identifier
  • TEST_ORG_LLM_BASE_URL: optional compatible base URL
  • No concurrent organization profile tests

Missing or unsuitable fixtures raise explicit errors; the test never silently skips.

Cleanup

The test deletes the unique temporary profile through the UI. finally deletes it defensively if needed and reactivates the original profile.

Risk

Medium: briefly stores a disposable provider key in an organization profile and may trigger provider-side key validation. Use a restricted test key with no production access. No conversations or completions are created.

This pull request was created by an AI agent (OpenHands) on behalf of the user.

Port validation

  • Exactly one changed file: e2e_tests/tests/org-llm-profile-key.spec.ts.
  • Exactly one Playwright test in the spec.
  • Focused ESLint and Prettier checks passed.
  • tsc --noEmit passed against the Cloud harness.
  • Chromium Playwright --list discovery passed.
  • Live execution still requires the explicit authentication and TEST_* contracts documented above.

AI disclosure: This pull request was migrated by an AI agent (OpenHands) on behalf of the user.

@github-actions github-actions Bot added the type: test Adding or fixing tests label Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: test Adding or fixing tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant