-
-
Notifications
You must be signed in to change notification settings - Fork 321
test: cut local suite CPU, disk, and E2E matrix #1319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,7 +42,45 @@ export const providers: Provider[] = [ | |
|
|
||
| export { isSupported } | ||
|
|
||
| /** | ||
| * Local `pnpm test:e2e` runs these adapter families (OpenAI, Anthropic, | ||
| * Gemini). Features that none of them support (TTS, image-gen, β¦) still | ||
| * run against whatever providers do. CI and `E2E_PROVIDERS=*` keep the | ||
| * full matrix. Comma-separated ids narrow it further (`E2E_PROVIDERS=grok`). | ||
| */ | ||
| const LOCAL_E2E_PROVIDERS: ReadonlySet<Provider> = new Set([ | ||
| 'openai', | ||
| 'anthropic', | ||
| 'gemini', | ||
| ]) | ||
|
|
||
| function requestedProviders(): 'all' | ReadonlySet<Provider> { | ||
| if (process.env.CI) return 'all' | ||
| const raw = process.env.E2E_PROVIDERS | ||
| if (raw === undefined || raw.trim() === '') return LOCAL_E2E_PROVIDERS | ||
| if (raw.trim() === '*') return 'all' | ||
|
|
||
| const tokens = raw | ||
| .split(',') | ||
| .map((s) => s.trim()) | ||
| .filter(Boolean) | ||
| const known = new Set<string>(providers) | ||
| const unknown = tokens.filter((t) => !known.has(t)) | ||
| if (unknown.length > 0) { | ||
| throw new Error( | ||
| `E2E_PROVIDERS has unknown provider(s): ${unknown.join(', ')}. Known: ${providers.join(', ')}`, | ||
| ) | ||
| } | ||
| return new Set(providers.filter((p) => tokens.includes(p))) | ||
| } | ||
|
|
||
| /** Get only the providers that support a given feature */ | ||
| export function providersFor(feature: Feature): Provider[] { | ||
| return providers.filter((p) => isSupported(p, feature)) | ||
| const supported = providers.filter((p) => isSupported(p, feature)) | ||
| const requested = requestedProviders() | ||
| if (requested === 'all') return supported | ||
| const filtered = supported.filter((p) => requested.has(p)) | ||
| // Feature only exists on providers outside the local default (e.g. TTS | ||
| // on elevenlabs). Keep those tests; don't silently drop the feature. | ||
| return filtered.length > 0 ? filtered : supported | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. π― Functional Correctness | π‘ Minor | β‘ Quick win π Supported by static analysisπ Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- changed hunk ---'
git diff -- testing/e2e/tests/test-matrix.ts
printf '%s\n' '--- target file ---'
sed -n '1,150p' testing/e2e/tests/test-matrix.ts
printf '%s\n' '--- direct references ---'
rg -n --glob '!node_modules' 'E2E_PROVIDERS|LOCAL_E2E_PROVIDERS|supported|filtered' testing/e2e .github package.json README.md 2>/dev/null | head -200Repository: TanStack/ai Length of output: 6718 π€ get_repo_knowledge executed:
Length of output: 8605 π Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- feature support entries ---'
rg -n -C 4 "'(grok|tts|image-gen)'|grok" testing/e2e/src/lib/feature-support.ts
printf '%s\n' '--- providersFor consumers and empty-case handling ---'
rg -n -C 6 "providersFor\(" testing/e2e/tests --glob '*.spec.ts' | head -240
printf '%s\n' '--- e2e README selection contract ---'
sed -n '1,45p' testing/e2e/README.mdRepository: TanStack/ai Length of output: 26171 Restrict explicit When π€ Prompt for AI Agents |
||
| } | ||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π Performance & Scalability | π Major | β‘ Quick win
π Supported by static analysis
π Script executed:
Repository: TanStack/ai
Length of output: 4868
π€ get_repo_knowledge executed:
get_repo_knowledge TanStack/ai /tmp/coderabbit-repo-knowledge/tanstack-ai-745fe4e5/learningsLength of output: 13055
π Script executed:
Repository: TanStack/ai
Length of output: 2121
π Web query:
Playwright test video retain-on-failure records video every test official documentationπ‘ Result:
In Playwright, the 'retain-on-failure' mode for video recording is a configuration option that balances the need for failure evidence with storage efficiency [1]. When you set video: 'retain-on-failure' in your configuration, Playwright records a video for every test run but automatically deletes the recordings for any tests that pass [2][3]. If a test fails, the video file is preserved in your test output directory (typically 'test-results') [2][4]. You can enable this by adding the option to the use object within your playwright.config.ts (or.js) file: import { defineConfig } from '
@playwright/test'; export default defineConfig({ use: { video: 'retain-on-failure', }, }); It is important to note that because Playwright cannot predict whether a test will fail before it begins, this mode still incurs the performance overhead of recording every test during execution [1]. If you need to avoid the recording overhead on the "happy path" entirely, you might consider alternatives like 'on-first-retry' (if your configuration includes retries), which only records the test during its retry attempt [3][1]. For more granular control, the video option can also accept an object, though the 'retain-on-failure' shorthand is the standard way to achieve this behavior [3][5]. Recordings are saved upon the closure of the browser context at the end of each test, so ensure any manually created browser contexts are properly closed [2][4].Citations:
Disable video capture for local runs.
video: 'retain-on-failure'records every test and deletes videos only for passing tests. Setvideotoprocess.env.CI ? 'retain-on-failure' : 'off'to avoid local recording overhead.π€ Prompt for AI Agents
Source: MCP tools