From 303c35fea2eb28965fb5a06ddf03bb71fb66e5d7 Mon Sep 17 00:00:00 2001 From: Andrew Tatomyr Date: Fri, 21 Feb 2025 12:40:56 +0200 Subject: [PATCH 1/2] chore: move rebilly test to a smoke --- .github/workflows/performance.yaml | 10 ++++---- .github/workflows/smoke-rebilly.yaml | 24 +++++++++++++++++++ .github/workflows/tests.yaml | 14 ++++------- .../__snapshots__/rebilly.smoke.ts.snap} | 0 .../rebilly-description.yaml | 0 .../rebilly.smoke.ts} | 2 +- .../rebilly => smoke-rebilly}/rebilly.yaml | 0 package.json | 5 ++-- packages/respect-core/jest.config.unit.js | 6 ----- 9 files changed, 37 insertions(+), 24 deletions(-) create mode 100644 .github/workflows/smoke-rebilly.yaml rename __tests__/{respect/rebilly/__snapshots__/rebilly.test.ts.snap => smoke-rebilly/__snapshots__/rebilly.smoke.ts.snap} (100%) rename __tests__/{respect/rebilly => smoke-rebilly}/rebilly-description.yaml (100%) rename __tests__/{respect/rebilly/rebilly.test.ts => smoke-rebilly/rebilly.smoke.ts} (96%) rename __tests__/{respect/rebilly => smoke-rebilly}/rebilly.yaml (100%) delete mode 100644 packages/respect-core/jest.config.unit.js diff --git a/.github/workflows/performance.yaml b/.github/workflows/performance.yaml index dd952e873a..b1ec1e4bf0 100644 --- a/.github/workflows/performance.yaml +++ b/.github/workflows/performance.yaml @@ -5,6 +5,10 @@ on: branches: - main +env: + CI: true + REDOCLY_TELEMETRY: off + jobs: latest-vs-next: runs-on: ubuntu-latest @@ -29,9 +33,6 @@ jobs: - run: redocly --version - name: Run Benchmark run: hyperfine -i --warmup 3 'redocly lint packages/core/src/benchmark/benches/rebilly.yaml' 'redocly-next lint packages/core/src/benchmark/benches/rebilly.yaml' --export-markdown benchmark_check.md --export-json benchmark_check.json - env: - CI: true - REDOCLY_TELEMETRY: off - name: Comment PR if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} @@ -67,9 +68,6 @@ jobs: npm test # This command is generated and injected into package.json in the previous step. cat benchmark_check.md npm run chart # Creates benchmark_chart.md with the performance bar chart. - env: - CI: true - REDOCLY_TELEMETRY: off - name: Comment PR if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} diff --git a/.github/workflows/smoke-rebilly.yaml b/.github/workflows/smoke-rebilly.yaml new file mode 100644 index 0000000000..dd3e8421a9 --- /dev/null +++ b/.github/workflows/smoke-rebilly.yaml @@ -0,0 +1,24 @@ +name: Smoke tests + +on: + pull_request: + types: [opened, synchronize, reopened] + +env: + CI: true + REDOCLY_TELEMETRY: off + +jobs: + prepare-smoke: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 22 + cache: 'npm' + - name: Install dependencies + run: npm ci + - run: npm run smoke:rebilly + env: + SANDBOX_REBILLY_TOKEN: ${{ secrets.SANDBOX_REBILLY_TOKEN }} diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 3f67c7d6c3..51be07b48f 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -7,6 +7,10 @@ on: branches: - main +env: + CI: true + REDOCLY_TELEMETRY: off + jobs: build-and-unit: runs-on: ubuntu-latest @@ -18,17 +22,13 @@ jobs: cache: 'npm' - name: Install dependencies run: npm ci - env: - CI: true - name: Typecheck run: npm run typecheck - name: Unit Tests run: npm run unit - name: E2E Tests run: npm run e2e - env: - CI: true - SANDBOX_REBILLY_TOKEN: ${{ secrets.SANDBOX_REBILLY_TOKEN }} + cli-package-test: runs-on: ubuntu-latest steps: @@ -39,8 +39,6 @@ jobs: cache: 'npm' - name: Install dependencies run: npm ci - env: - CI: true - name: Prepare CLI and Core packages run: npm run pack:prepare - name: Install CLI Package @@ -76,7 +74,5 @@ jobs: cache: 'npm' - name: Install dependencies run: npm ci - env: - CI: true - run: npm run eslint - run: npm run prettier:check diff --git a/__tests__/respect/rebilly/__snapshots__/rebilly.test.ts.snap b/__tests__/smoke-rebilly/__snapshots__/rebilly.smoke.ts.snap similarity index 100% rename from __tests__/respect/rebilly/__snapshots__/rebilly.test.ts.snap rename to __tests__/smoke-rebilly/__snapshots__/rebilly.smoke.ts.snap diff --git a/__tests__/respect/rebilly/rebilly-description.yaml b/__tests__/smoke-rebilly/rebilly-description.yaml similarity index 100% rename from __tests__/respect/rebilly/rebilly-description.yaml rename to __tests__/smoke-rebilly/rebilly-description.yaml diff --git a/__tests__/respect/rebilly/rebilly.test.ts b/__tests__/smoke-rebilly/rebilly.smoke.ts similarity index 96% rename from __tests__/respect/rebilly/rebilly.test.ts rename to __tests__/smoke-rebilly/rebilly.smoke.ts index dfdd0bead8..a767ff71af 100644 --- a/__tests__/respect/rebilly/rebilly.test.ts +++ b/__tests__/smoke-rebilly/rebilly.smoke.ts @@ -1,4 +1,4 @@ -import { getParams, getCommandOutput, getFixturePath } from '../utils'; +import { getParams, getCommandOutput, getFixturePath } from '../respect/utils'; import { join } from 'path'; test('rebilly test case', () => { diff --git a/__tests__/respect/rebilly/rebilly.yaml b/__tests__/smoke-rebilly/rebilly.yaml similarity index 100% rename from __tests__/respect/rebilly/rebilly.yaml rename to __tests__/smoke-rebilly/rebilly.yaml diff --git a/package.json b/package.json index e4e8fe3154..475942e1ee 100644 --- a/package.json +++ b/package.json @@ -16,13 +16,14 @@ "coverage:cli": "npm run jest -- --roots packages/cli/src --coverage", "coverage:core": "npm run jest -- --roots packages/core/src --coverage", "coverage:respect-core": "npm run jest -- --roots packages/respect-core/src --coverage", - "typecheck": "tsc --noEmit --skipLibCheck", "e2e": "npm run webpack-bundle -- --mode=none && REDOCLY_TELEMETRY=off NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --roots=./__tests__/", + "smoke:rebilly": "npm run webpack-bundle -- --mode=none && REDOCLY_TELEMETRY=off NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --roots=__tests__/smoke-rebilly/ --testMatch='**/rebilly.smoke.ts'", "prettier": " npx prettier --write \"**/*.{ts,js,yaml,yml,json,md}\"", "prettier:check": "npx prettier --check \"**/*.{ts,js,yaml,yml,json,md}\"", "eslint": "eslint packages/**", "clean": "rm -rf packages/**/lib packages/**/node_modules packages/**/*.tsbuildinfo package-lock.json node_modules dist && git checkout package-lock.json", - "watch": "tsc -b tsconfig.build.json --watch ", + "typecheck": "tsc --noEmit --skipLibCheck", + "watch": "npm run respect:parser:generate && tsc -b tsconfig.build.json --watch", "compile": "npm run respect:parser:generate && tsc -b tsconfig.build.json", "prepare": "npm run compile", "cli": "ts-node packages/cli/src/index.ts", diff --git a/packages/respect-core/jest.config.unit.js b/packages/respect-core/jest.config.unit.js deleted file mode 100644 index 18527627f1..0000000000 --- a/packages/respect-core/jest.config.unit.js +++ /dev/null @@ -1,6 +0,0 @@ -const defaultConfig = require('./jest.config.js'); - -module.exports = { - ...defaultConfig, - testPathIgnorePatterns: ['/node_modules/', '/e2e/__tests__/'], -}; From 3312a3de44274bfd16ffaf8037fe8fb85cac4cb6 Mon Sep 17 00:00:00 2001 From: Andrew Tatomyr Date: Fri, 21 Feb 2025 12:51:49 +0200 Subject: [PATCH 2/2] update names --- .github/workflows/smoke-plugins.yaml | 2 +- .github/workflows/smoke-rebilly.yaml | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/smoke-plugins.yaml b/.github/workflows/smoke-plugins.yaml index 832f94ee62..985be0c7a8 100644 --- a/.github/workflows/smoke-plugins.yaml +++ b/.github/workflows/smoke-plugins.yaml @@ -1,4 +1,4 @@ -name: Plugins smoke tests +name: Smoke tests on: pull_request: diff --git a/.github/workflows/smoke-rebilly.yaml b/.github/workflows/smoke-rebilly.yaml index dd3e8421a9..a762826fae 100644 --- a/.github/workflows/smoke-rebilly.yaml +++ b/.github/workflows/smoke-rebilly.yaml @@ -9,7 +9,7 @@ env: REDOCLY_TELEMETRY: off jobs: - prepare-smoke: + run-smoke-rebilly: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -19,6 +19,7 @@ jobs: cache: 'npm' - name: Install dependencies run: npm ci - - run: npm run smoke:rebilly + - name: Run Rebilly smoke test + run: npm run smoke:rebilly env: SANDBOX_REBILLY_TOKEN: ${{ secrets.SANDBOX_REBILLY_TOKEN }}