From f09b02bd3dd7eb4589ee954317693f75a52e3b4e Mon Sep 17 00:00:00 2001 From: Avi Shah Date: Thu, 12 Dec 2024 17:47:12 +0530 Subject: [PATCH] ember exam test partitioning --- .github/workflows/test.yaml | 60 +++++++++++++++++++++++++++++++++++-- package.json | 3 ++ 2 files changed, 60 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 5f587d885..1de0aa402 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -5,7 +5,7 @@ on: types: [opened, reopened] jobs: - test: + build: runs-on: [ubuntu-latest] concurrency: group: ${{ github.workflow }}-ci-${{ github.ref }} @@ -16,5 +16,59 @@ jobs: - name: Setup Application uses: ./.github/actions/setup-app - - name: Run tests - run: npm test + - name: Upload built ember app + uses: actions/upload-artifact@v1 + with: + name: dist + path: dist + + unitTests: + runs-on: [ubuntu-latest] + concurrency: + group: ${{ github.workflow }}-ci-${{ github.ref }} + cancel-in-progress: true + steps: + - uses: actions/checkout@v4 + + - name: Download built ember app + uses: actions/download-artifact@v1 + with: + name: dist + path: dist + + - name: Run unit tests + run: npm run test:unit + + integrationTests: + runs-on: [ubuntu-latest] + concurrency: + group: ${{ github.workflow }}-ci-${{ github.ref }} + cancel-in-progress: true + steps: + - uses: actions/checkout@v4 + + - name: Download built ember app + uses: actions/download-artifact@v1 + with: + name: dist + path: dist + + - name: Run integration tests + run: npm run test:integration + + acceptanceTests: + runs-on: [ubuntu-latest] + concurrency: + group: ${{ github.workflow }}-ci-${{ github.ref }} + cancel-in-progress: true + steps: + - uses: actions/checkout@v4 + + - name: Download built ember app + uses: actions/download-artifact@v1 + with: + name: dist + path: dist + + - name: Run acceptance tests + run: npm run test:acceptance diff --git a/package.json b/package.json index fdf545833..0b622384b 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,9 @@ "startprod": "cross-env IRENE_API_HOST=https://api.appknox.com ember server", "test": "concurrently \"npm:lint\" \"npm:test:*\" --names \"lint,test:\"", "test:ember": "ember exam --split=6 --parallel", + "test:unit": "ember exam --test-type unit --split=3 --parallel", + "test:acceptance": "ember exam --test-type acceptance --split=6 --parallel", + "test:integration": "ember exam --test-type integration --split=6 --parallel", "cypress:open": "cypress open", "cypress:run": "cypress run --browser chrome", "deploy": "ember deploy production --verbose=true --activate=true --show-progress=true",