From fc87ed4e34ded7e3726f766a27405c8cd029793f Mon Sep 17 00:00:00 2001 From: Abhimanyu Yadav <122007096+Abhi1992002@users.noreply.github.com> Date: Thu, 22 Jan 2026 16:44:48 +0530 Subject: [PATCH] feat(ci): add integration test job and rename e2e test job (#11820) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### Changes 🏗️ - Renamed the `test` job to `e2e_test` in the CI workflow for better clarity - Added a new `integration_test` job to the CI workflow that runs unit tests using `pnpm test:unit` - Created a basic integration test for the MainMarketplacePage component to verify CI functionality ### Checklist 📋 #### For code changes: - [x] I have clearly listed my changes in the PR description - [x] I have made a test plan - [x] I have tested my changes according to the test plan: - [x] Verified the CI workflow runs both e2e and integration tests - [x] Confirmed the integration test for MainMarketplacePage passes #### For configuration changes: - [x] `.env.default` is updated or already compatible with my changes - [x] `docker-compose.yml` is updated or already compatible with my changes --- .github/workflows/platform-frontend-ci.yml | 38 ++++++++++++++++++- .../__tests__/main.test.tsx | 15 ++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/main.test.tsx diff --git a/.github/workflows/platform-frontend-ci.yml b/.github/workflows/platform-frontend-ci.yml index fb7a55055e..499bb03170 100644 --- a/.github/workflows/platform-frontend-ci.yml +++ b/.github/workflows/platform-frontend-ci.yml @@ -128,7 +128,7 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} exitOnceUploaded: true - test: + e2e_test: runs-on: big-boi needs: setup strategy: @@ -258,3 +258,39 @@ jobs: - name: Print Final Docker Compose logs if: always() run: docker compose -f ../docker-compose.yml logs + + integration_test: + runs-on: ubuntu-latest + needs: setup + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: "22.18.0" + + - name: Enable corepack + run: corepack enable + + - name: Restore dependencies cache + uses: actions/cache@v4 + with: + path: ~/.pnpm-store + key: ${{ needs.setup.outputs.cache-key }} + restore-keys: | + ${{ runner.os }}-pnpm-${{ hashFiles('autogpt_platform/frontend/pnpm-lock.yaml') }} + ${{ runner.os }}-pnpm- + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Generate API client + run: pnpm generate:api + + - name: Run Integration Tests + run: pnpm test:unit diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/main.test.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/main.test.tsx new file mode 100644 index 0000000000..bee227a7af --- /dev/null +++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/main.test.tsx @@ -0,0 +1,15 @@ +import { expect, test } from "vitest"; +import { render, screen } from "@/tests/integrations/test-utils"; +import { MainMarkeplacePage } from "../MainMarketplacePage"; +import { server } from "@/mocks/mock-server"; +import { getDeleteV2DeleteStoreSubmissionMockHandler422 } from "@/app/api/__generated__/endpoints/store/store.msw"; + +// Only for CI testing purpose, will remove it in future PR +test("MainMarketplacePage", async () => { + server.use(getDeleteV2DeleteStoreSubmissionMockHandler422()); + + render(); + expect( + await screen.findByText("Featured agents", { exact: false }), + ).toBeDefined(); +});