Skip to content

Commit 4082b65

Browse files
[chore]: fix e2e local tests in CI (#1323)
# why - our `e2e:local` tests now require LLM API keys - these are currently unavailable during the `e2e:local` step in CI, which causes them to fail # what changed - added the relevant LLM API keys to the `env` in CI <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fixes failing e2e:local tests in CI by skipping forks and passing the required API keys to the job. # Why: - E2E local tests were failing due to missing secrets and forked PRs not having access to them. # What: - Added job condition to run only on pushes and same-repo PRs (skip forks). - Passed required env secrets: OPENAI_API_KEY, ANTHROPIC_API_KEY, GOOGLE_GENERATIVE_AI_API_KEY, BROWSERBASE_API_KEY, BROWSERBASE_PROJECT_ID. - Added ANTHROPIC_API_KEY to turbo.json env for the e2e:local task. # Test Plan: - Push a branch in this repo: e2e:local job runs and passes. - Open a PR from this repo: job runs and external API calls succeed. - Open a PR from a fork: e2e:local job is skipped. - Run tests locally with required API keys set: tests pass. <sup>Written for commit 7eb1ed9. Summary will update automatically on new commits.</sup> <!-- End of auto-generated description by cubic. -->
1 parent ea41abb commit 4082b65

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,15 @@ jobs:
187187
needs: [run-lint, run-build]
188188
runs-on: ubuntu-latest
189189
timeout-minutes: 50
190+
if: >
191+
github.event_name == 'push' ||
192+
(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)
190193
env:
194+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
191195
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
196+
GOOGLE_GENERATIVE_AI_API_KEY: ${{ secrets.GOOGLE_GENERATIVE_AI_API_KEY }}
197+
BROWSERBASE_API_KEY: ${{ secrets.BROWSERBASE_API_KEY }}
198+
BROWSERBASE_PROJECT_ID: ${{ secrets.BROWSERBASE_PROJECT_ID }}
192199
HEADLESS: true
193200
steps:
194201
- name: Check out repository code

turbo.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,10 @@
8787
"playwright-report/**",
8888
"test-results/**"
8989
],
90-
"cache": false
90+
"cache": false,
91+
"env": [
92+
"ANTHROPIC_API_KEY"
93+
]
9194
},
9295
"e2e:bb": {
9396
"dependsOn": ["build"],

0 commit comments

Comments
 (0)