-
Notifications
You must be signed in to change notification settings - Fork 365
chore(repo): Fix nightly e2e tests #6262
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
Changes from all commits
9fcdcb3
c9e4fd9
0d99589
b5c9882
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,15 @@ runs: | |
shell: bash | ||
run: | | ||
nohup ./node_modules/.bin/verdaccio --config ./verdaccio.publish.yaml & echo "VERDACCIO_PID=$!" >> $GITHUB_ENV | ||
sleep 5 | ||
# Wait for Verdaccio to start and verify it's responding | ||
for i in {1..10}; do | ||
if curl -f ${{ inputs.registry }}/ > /dev/null 2>&1; then | ||
echo "Verdaccio is up and running" | ||
break | ||
fi | ||
echo "Waiting for Verdaccio to start (attempt $i)..." | ||
sleep 2 | ||
done | ||
pnpm config set $(echo ${{ inputs.registry }} | sed -E 's/https?://')/:_authToken secretToken | ||
|
||
- name: Publish to Verdaccio | ||
|
@@ -41,10 +49,25 @@ runs: | |
|
||
- name: Stop Verdaccio | ||
shell: bash | ||
run: kill -9 $VERDACCIO_PID | ||
run: | | ||
if [ -n "$VERDACCIO_PID" ]; then | ||
kill -9 $VERDACCIO_PID || true | ||
sleep 2 | ||
fi | ||
Comment on lines
+52
to
+56
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. 🛠️ Refactor suggestion Missing symmetrical shutdown for the second Verdaccio instance You stop the first Verdaccio (publish) instance but never terminate the second one started with the install config. Add a second “Stop Verdaccio (install)” step or trap the PID so both instances are always cleaned up. 🤖 Prompt for AI Agents
|
||
|
||
- name: Run Verdaccio (using install config) | ||
shell: bash | ||
run: | | ||
nohup ./node_modules/.bin/verdaccio --config ./verdaccio.install.yaml & sleep 5 | ||
nohup ./node_modules/.bin/verdaccio --config ./verdaccio.install.yaml & echo "VERDACCIO_PID=$!" >> $GITHUB_ENV | ||
# Wait for Verdaccio to start and verify it's responding | ||
for i in {1..10}; do | ||
if curl -f ${{ inputs.registry }}/ > /dev/null 2>&1; then | ||
echo "Verdaccio is up and running" | ||
break | ||
fi | ||
echo "Waiting for Verdaccio to start (attempt $i)..." | ||
sleep 2 | ||
done | ||
pnpm config set $(echo ${{ inputs.registry }} | sed -E 's/https?://')/:_authToken secretToken | ||
# Verify proxy is working by trying to fetch a known package | ||
pnpm view semver > /dev/null 2>&1 || echo "Warning: Could not fetch semver package, proxy might not be working" |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,18 +1,24 @@ | ||||||||||||||||||||||||||||||||||||||
name: Nightly upstream tests | ||||||||||||||||||||||||||||||||||||||
on: | ||||||||||||||||||||||||||||||||||||||
pull_request: | ||||||||||||||||||||||||||||||||||||||
branches: | ||||||||||||||||||||||||||||||||||||||
- main | ||||||||||||||||||||||||||||||||||||||
- release/v4 | ||||||||||||||||||||||||||||||||||||||
workflow_dispatch: | ||||||||||||||||||||||||||||||||||||||
schedule: | ||||||||||||||||||||||||||||||||||||||
- cron: '0 7 * * *' | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
jobs: | ||||||||||||||||||||||||||||||||||||||
integration-tests: | ||||||||||||||||||||||||||||||||||||||
name: Integration Tests | ||||||||||||||||||||||||||||||||||||||
runs-on: ${{ vars.RUNNER_NORMAL || 'ubuntu-latest' }} | ||||||||||||||||||||||||||||||||||||||
runs-on: ${{ vars.RUNNER_NORMAL || 'ubuntu-latest' }}\ | ||||||||||||||||||||||||||||||||||||||
timeout-minutes: ${{ vars.TIMEOUT_MINUTES_EXTENDED && fromJSON(vars.TIMEOUT_MINUTES_EXTENDED) || 30 }} | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
strategy: | ||||||||||||||||||||||||||||||||||||||
matrix: | ||||||||||||||||||||||||||||||||||||||
test-name: ['nextjs'] | ||||||||||||||||||||||||||||||||||||||
# Don't cancel other matrix jobs if one fails | ||||||||||||||||||||||||||||||||||||||
fail-fast: false | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
steps: | ||||||||||||||||||||||||||||||||||||||
- name: Checkout Repo | ||||||||||||||||||||||||||||||||||||||
|
@@ -40,12 +46,31 @@ jobs: | |||||||||||||||||||||||||||||||||||||
working-directory: ./integration | ||||||||||||||||||||||||||||||||||||||
run: pnpm init && pnpm add @clerk/backend | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
- name: List installed packages in /integration | ||||||||||||||||||||||||||||||||||||||
working-directory: ./integration | ||||||||||||||||||||||||||||||||||||||
run: | | ||||||||||||||||||||||||||||||||||||||
echo "=== Listing installed packages in /integration ===" | ||||||||||||||||||||||||||||||||||||||
pnpm list --json | ||||||||||||||||||||||||||||||||||||||
echo "=== Detailed package info for @clerk/backend ===" | ||||||||||||||||||||||||||||||||||||||
pnpm list @clerk/backend | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
- name: Install @clerk/clerk-js in os temp | ||||||||||||||||||||||||||||||||||||||
working-directory: ${{runner.temp}} | ||||||||||||||||||||||||||||||||||||||
run: mkdir clerk-js && cd clerk-js && pnpm init && pnpm add @clerk/clerk-js | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
Comment on lines
58
to
60
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.
-run: mkdir clerk-js && cd clerk-js && pnpm init && pnpm add @clerk/clerk-js
+run: mkdir clerk-js && cd clerk-js && pnpm init -y && pnpm add @clerk/clerk-js 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||||||||||||||||||||||||||||||||||
- name: Run Integration Tests | ||||||||||||||||||||||||||||||||||||||
run: pnpm turbo test:integration:${{ matrix.test-name }} $TURBO_ARGS --only | ||||||||||||||||||||||||||||||||||||||
id: integration_tests | ||||||||||||||||||||||||||||||||||||||
continue-on-error: true | ||||||||||||||||||||||||||||||||||||||
run: | | ||||||||||||||||||||||||||||||||||||||
# Capture the output and exit code | ||||||||||||||||||||||||||||||||||||||
OUTPUT_FILE="${{runner.temp}}/test-output.log" | ||||||||||||||||||||||||||||||||||||||
# Only run Typedoc tests for one matrix version | ||||||||||||||||||||||||||||||||||||||
if [ "${{ matrix.test-name }}" == "nextjs" ]; then | ||||||||||||||||||||||||||||||||||||||
E2E_DEBUG=1 E2E_APP_ID=quickstart.next.appRouter pnpm test:integration:base --grep @quickstart 2>&1 | tee "$OUTPUT_FILE" | ||||||||||||||||||||||||||||||||||||||
else | ||||||||||||||||||||||||||||||||||||||
E2E_DEBUG=1 pnpm turbo test:integration:${{ matrix.test-name }} $TURBO_ARGS --only 2>&1 | tee "$OUTPUT_FILE" | ||||||||||||||||||||||||||||||||||||||
fi | ||||||||||||||||||||||||||||||||||||||
echo "exit_code=${PIPESTATUS[0]}" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||||||||||||
env: | ||||||||||||||||||||||||||||||||||||||
E2E_APP_CLERK_JS_DIR: ${{runner.temp}} | ||||||||||||||||||||||||||||||||||||||
E2E_CLERK_VERSION: 'latest' | ||||||||||||||||||||||||||||||||||||||
|
@@ -56,11 +81,36 @@ jobs: | |||||||||||||||||||||||||||||||||||||
INTEGRATION_INSTANCE_KEYS: ${{ secrets.INTEGRATION_INSTANCE_KEYS }} | ||||||||||||||||||||||||||||||||||||||
MAILSAC_API_KEY: ${{ secrets.MAILSAC_API_KEY }} | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
# Upload test artifacts if tests failed | ||||||||||||||||||||||||||||||||||||||
- name: Upload Test Artifacts | ||||||||||||||||||||||||||||||||||||||
if: steps.integration_tests.outputs.exit_code != '0' | ||||||||||||||||||||||||||||||||||||||
uses: actions/upload-artifact@v4 | ||||||||||||||||||||||||||||||||||||||
with: | ||||||||||||||||||||||||||||||||||||||
name: test-artifacts-${{ matrix.test-name }} | ||||||||||||||||||||||||||||||||||||||
path: | | ||||||||||||||||||||||||||||||||||||||
${{runner.temp}}/test-output.log | ||||||||||||||||||||||||||||||||||||||
integration/test-results/ | ||||||||||||||||||||||||||||||||||||||
integration/.next/ | ||||||||||||||||||||||||||||||||||||||
${{runner.temp}}/clerk-js/node_modules/ | ||||||||||||||||||||||||||||||||||||||
retention-days: 7 | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
- name: Report Status | ||||||||||||||||||||||||||||||||||||||
if: always() | ||||||||||||||||||||||||||||||||||||||
uses: ravsamhq/notify-slack-action@v1 | ||||||||||||||||||||||||||||||||||||||
with: | ||||||||||||||||||||||||||||||||||||||
status: ${{ job.status }} | ||||||||||||||||||||||||||||||||||||||
status: ${{ steps.integration_tests.outputs.exit_code == '0' && 'success' || 'failure' }} | ||||||||||||||||||||||||||||||||||||||
notify_when: 'failure' | ||||||||||||||||||||||||||||||||||||||
notification_title: 'Integration Test Failure - ${{ matrix.test-name }}' | ||||||||||||||||||||||||||||||||||||||
message_format: | | ||||||||||||||||||||||||||||||||||||||
*Job:* ${{ github.workflow }} (${{ matrix.test-name }}) | ||||||||||||||||||||||||||||||||||||||
*Status:* ${{ steps.integration_tests.outputs.exit_code == '0' && 'Success' || 'Failed' }} | ||||||||||||||||||||||||||||||||||||||
*Commit:* ${{ github.sha }} | ||||||||||||||||||||||||||||||||||||||
*PR:* ${{ github.event.pull_request.html_url }} | ||||||||||||||||||||||||||||||||||||||
*Artifacts:* ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | ||||||||||||||||||||||||||||||||||||||
Comment on lines
+101
to
+109
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. 🛠️ Refactor suggestion Slack notification ignores second test run – potential false green
Consider aggregating both steps, or emit a combined output and reference that: - status: ${{ steps.integration_tests.outputs.exit_code == '0' && 'success' || 'failure' }}
+ status: ${{ (steps.integration_tests.outputs.exit_code == '0' && steps.integration_tests2.outputs.exit_code == '0') && 'success' || 'failure' }} 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||||||||||||||||||||||||||||||||||
env: | ||||||||||||||||||||||||||||||||||||||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_SDK_E2E_ALERTS_WEBHOOK_URL }} | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
# Fail the workflow if tests failed | ||||||||||||||||||||||||||||||||||||||
- name: Check Test Status | ||||||||||||||||||||||||||||||||||||||
if: steps.integration_tests.outputs.exit_code != '0' | ||||||||||||||||||||||||||||||||||||||
run: exit 1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
.cache | ||
.changeset | ||
.github | ||
.idea | ||
.next | ||
.temp_integration | ||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -2,7 +2,7 @@ import { constants } from '../constants'; | |||||||||||||||||||||||
import { fs } from '../scripts'; | ||||||||||||||||||||||||
import type { EnvironmentConfig } from './environment'; | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
type AppParams = { | ||||||||||||||||||||||||
export type AppParams = { | ||||||||||||||||||||||||
id: string; | ||||||||||||||||||||||||
port: number; | ||||||||||||||||||||||||
serverUrl: string; | ||||||||||||||||||||||||
|
@@ -83,6 +83,11 @@ const createStateFile = () => { | |||||||||||||||||||||||
return read().clerkJsHttpServerPid; | ||||||||||||||||||||||||
}; | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
const debug = () => { | ||||||||||||||||||||||||
const json = read(); | ||||||||||||||||||||||||
console.log('state file', JSON.stringify(json, null, 2)); | ||||||||||||||||||||||||
}; | ||||||||||||||||||||||||
Comment on lines
+86
to
+89
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. 🛠️ Refactor suggestion Add explicit return type and JSDoc documentation. The + /**
+ * Logs the current state file content in a pretty-printed format for debugging purposes.
+ */
- const debug = () => {
+ const debug = (): void => {
const json = read();
console.log('state file', JSON.stringify(json, null, 2));
}; 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||||||||||||||||||||
|
||||||||||||||||||||||||
return { | ||||||||||||||||||||||||
remove, | ||||||||||||||||||||||||
setStandAloneApp, | ||||||||||||||||||||||||
|
@@ -91,6 +96,7 @@ const createStateFile = () => { | |||||||||||||||||||||||
getClerkJsHttpServerPid, | ||||||||||||||||||||||||
addLongRunningApp, | ||||||||||||||||||||||||
getLongRunningApps, | ||||||||||||||||||||||||
debug, | ||||||||||||||||||||||||
}; | ||||||||||||||||||||||||
}; | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
|
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.
💡 Verification agent
❓ Verification inconclusive
Add an explicit failure after the readiness-polling loop
If Verdaccio never comes up within the 10 attempts, the script silently proceeds to the publish step and will fail later with a much less obvious error. Abort early to surface the root cause:
Enforce failure if Verdaccio isn’t ready
Add an explicit check after the readiness-poll loop in
.github/actions/verdaccio/action.yml
so the workflow aborts early if Verdaccio never comes up:📝 Committable suggestion
🤖 Prompt for AI Agents