From ab29eff0abe71ca27192cc1d1bde7b792dce0e9b Mon Sep 17 00:00:00 2001 From: LekoArts Date: Thu, 23 May 2024 11:21:58 +0200 Subject: [PATCH] Revert Debugging --- .github/workflows/ci.yml | 24 ++----------------- integration/models/application.ts | 1 - integration/models/applicationConfig.ts | 5 ++-- integration/playwright.config.ts | 2 +- integration/presets/elements.ts | 2 +- integration/tests/elements/otp.test.ts | 1 - package.json | 2 +- .../eslint-config-custom/github-actions.js | 2 +- 8 files changed, 8 insertions(+), 31 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6ac1fd41d9..9bc6385018 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -129,7 +129,7 @@ jobs: strategy: matrix: - test-name: ['elements'] + test-name: ['generic', 'nextjs', 'express', 'quickstart', 'ap-flows', 'elements'] test-project: ['chrome'] steps: @@ -164,32 +164,12 @@ jobs: - name: Run Integration Tests id: integration-tests - run: npx turbo test:integration:${{ matrix.test-name }} --cache-dir=./.turbo-cache --concurrency=4 --summarize=false --verbosity=2 --log-order=stream --only -- --project=${{ matrix.test-project }} + run: npx turbo test:integration:${{ matrix.test-name }} $TURBO_ARGS --only -- --project=${{ matrix.test-project }} env: E2E_APP_CLERK_JS_DIR: ${{runner.temp}} E2E_CLERK_VERSION: 'latest' INTEGRATION_INSTANCE_KEYS: ${{ secrets.INTEGRATION_INSTANCE_KEYS }} MAILSAC_API_KEY: ${{ secrets.MAILSAC_API_KEY }} - - - name: ENV VARS ARGHHH - if: ${{ cancelled() || failure() }} - run: echo "APP_DIR_PATH=${appDirPath}" >> $GITHUB_ENV - - - name: Upload test artifacts - if: ${{ cancelled() || failure() }} - uses: actions/upload-artifact@v4 - with: - name: playwright-traces-${{ matrix.test-name }} - path: integration/test-results - retention-days: 1 - - - name: Upload tempdir artifacts - if: ${{ cancelled() || failure() }} - uses: actions/upload-artifact@v4 - with: - name: temp-app-${{ matrix.test-name }} - path: /tmp/.temp_integration/long-running--elements.next.appRouter__123 - retention-days: 1 # - name: Upload Integration Report for ${{ matrix.test-name }} # uses: actions/upload-artifact@v3 diff --git a/integration/models/application.ts b/integration/models/application.ts index dc2e4533e4..264da6a93f 100644 --- a/integration/models/application.ts +++ b/integration/models/application.ts @@ -36,7 +36,6 @@ export const application = (config: ApplicationConfig, appDirPath: string, appDi if (force || !nodeModulesExist) { const log = logger.child({ prefix: 'setup' }).info; await run(scripts.setup, { cwd: appDirPath, log }); - await run(`cd node_modules/@clerk/elements && ls`, { cwd: appDirPath, log }); state.completedSetup = true; } }, diff --git a/integration/models/applicationConfig.ts b/integration/models/applicationConfig.ts index 016660b594..87695cdf8e 100644 --- a/integration/models/applicationConfig.ts +++ b/integration/models/applicationConfig.ts @@ -5,7 +5,7 @@ import { createLogger, fs } from '../scripts'; import { application } from './application.js'; import type { EnvironmentConfig } from './environment'; import type { Helpers } from './helpers.js'; -import { helpers } from './helpers.js'; +import { hash, helpers } from './helpers.js'; export type ApplicationConfig = ReturnType; type Scripts = { dev: string; build: string; setup: string; serve: string }; @@ -64,11 +64,10 @@ export const applicationConfig = () => { return self; }, commit: async (opts?: { stableHash?: string }) => { - // eslint-disable-next-line @typescript-eslint/no-unused-vars const { stableHash } = opts || {}; logger.info(`Creating project "${name}"`); - const appDirName = `${name}__123`; + const appDirName = stableHash || `${name}__${Date.now()}__${hash()}`; const appDirPath = path.resolve(constants.TMP_DIR, appDirName); // Copy template files diff --git a/integration/playwright.config.ts b/integration/playwright.config.ts index 4d8c558c79..ae48bc2578 100644 --- a/integration/playwright.config.ts +++ b/integration/playwright.config.ts @@ -19,7 +19,7 @@ export const common: PlaywrightTestConfig = { timeout: 90000, maxFailures: process.env.CI ? 1 : undefined, workers: process.env.CI ? numAvailableWorkers : '70%', - reporter: 'line', + reporter: process.env.CI ? 'line' : 'list', use: { trace: 'on-first-retry', bypassCSP: true, // We probably need to limit this to specific tests diff --git a/integration/presets/elements.ts b/integration/presets/elements.ts index df04a07d6c..b137759c13 100644 --- a/integration/presets/elements.ts +++ b/integration/presets/elements.ts @@ -9,7 +9,7 @@ const nextAppRouter = applicationConfig() .setName('elements-next') .useTemplate(templates['elements-next']) .setEnvFormatter('public', key => `NEXT_PUBLIC_${key}`) - .addScript('setup', 'npm i --verbose') + .addScript('setup', 'npm i') .addScript('dev', 'npm run dev') .addScript('build', 'npm run build') .addScript('serve', 'npm run start') diff --git a/integration/tests/elements/otp.test.ts b/integration/tests/elements/otp.test.ts index 0ca61c0c35..47b6da387f 100644 --- a/integration/tests/elements/otp.test.ts +++ b/integration/tests/elements/otp.test.ts @@ -13,7 +13,6 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withEmailCodes] })('OTP @elem test.beforeEach(async ({ page, context }) => { const u = createTestUtils({ app, page, context }); await u.page.goToRelative('/otp'); - await u.page.waitForClerkJsLoaded(); }); const otpTypes = { diff --git a/package.json b/package.json index d193c1ff5e..d2901305a9 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "test": "FORCE_COLOR=1 turbo test --concurrency=${TURBO_CONCURRENCY:-80%}", "test:cache:clear": "FORCE_COLOR=1 turbo test:cache:clear --continue --concurrency=${TURBO_CONCURRENCY:-80%}", "test:integration:ap-flows": "npm run test:integration:base -- --grep @ap-flows", - "test:integration:base": "DEBUG=1 npx playwright test --config integration/playwright.config.ts --trace=retain-on-failure", + "test:integration:base": "DEBUG=1 npx playwright test --config integration/playwright.config.ts", "test:integration:cleanup": "DEBUG=1 npx playwright test --config integration/playwright.cleanup.config.ts", "test:integration:deployment:nextjs": "DEBUG=1 npx playwright test --config integration/playwright.deployments.config.ts", "test:integration:elements": "E2E_APP_ID=elements.* npm run test:integration:base -- --grep @elements", diff --git a/packages/eslint-config-custom/github-actions.js b/packages/eslint-config-custom/github-actions.js index b107cf2b55..b8a4a9cdc9 100644 --- a/packages/eslint-config-custom/github-actions.js +++ b/packages/eslint-config-custom/github-actions.js @@ -8,7 +8,7 @@ module.exports = { parser: 'any-eslint-parser', rules: { 'regex/invalid': [ - 'warn', + 'error', [ { regex: '^(?!.*\\$TURBO_ARGS( |$)).*turbo \\S+',