Skip to content

Conversation

@Abhi1992002
Copy link
Contributor

@Abhi1992002 Abhi1992002 commented Jan 22, 2026

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:

  • I have clearly listed my changes in the PR description
  • I have made a test plan
  • I have tested my changes according to the test plan:
    • Verified the CI workflow runs both e2e and integration tests
    • Confirmed the integration test for MainMarketplacePage passes

For configuration changes:

  • .env.default is updated or already compatible with my changes
  • docker-compose.yml is updated or already compatible with my changes

Abhi1992002 and others added 13 commits January 21, 2026 12:09
- Introduced new npm scripts for unit testing: `test:unit` and `test:unit:watch`.
- Updated Vitest configuration to include test files located in `src/**/*.test.tsx`.
- Added `NEXT_PUBLIC_IS_TESTING_ENVIRONMENT` variable to `.env.default` for testing environment indication.
- Updated `orval.config.ts` to enable mocking during API calls.
- Modified `layout.tsx` to initialize mocks when in testing environment.
- Removed `has_sensitive_action` properties from `openapi.json` to streamline API schema.
- Implemented `isTestingEnvironment` function in `environment` service for environment checks.
… setup

- Removed `NEXT_PUBLIC_IS_TESTING_ENVIRONMENT` variable from `.env.default` as it is no longer needed.
- Updated Vitest configuration to include a setup file for tests.
- Cleaned up `layout.tsx` by removing the testing environment check and mock initialization.
- Updated `MainMarketplacePage.test.tsx` to use a custom render utility for better test isolation.
- Deleted unused `Badge.test.tsx` file to streamline test suite.
- Added comments in `mocks/index.ts` to clarify usage context for mocks.
- Updated `orval.config.ts` to configure MSW for API mocking with detailed settings.
- Added `happy-dom` as a new dependency for testing environment.
- Modified `vitest.config.mts` to use `happy-dom` for the testing environment.
- Introduced new boolean properties `has_sensitive_action` and `sensitive_action_safe_mode` in `openapi.json` for better control over agent behavior.
- Removed obsolete test files and utility functions to streamline the testing process.
- Updated test setup to improve isolation and configuration.
- Removed `happy-dom` from dependencies in `package.json` and `pnpm-lock.yaml`.
- Re-added `happy-dom` to `devDependencies` in `package.json` and updated its entry in `pnpm-lock.yaml` to ensure proper testing environment setup.
- Modified the `refreshSession` method in the mock Supabase client to return a session object along with the user, improving the accuracy of the mock implementation for testing purposes.
- Deleted AGENTS.md, which contained frontend testing rules and guidelines, as it is no longer relevant to the current testing framework and practices.
- Renamed the existing test job to `e2e_test` for clarity.
- Added a new `integration_test` job that runs on `ubuntu-latest`.
- Configured steps for checking out the repository, setting up Node.js, enabling corepack, restoring dependencies, and running unit tests using pnpm.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 22, 2026

Walkthrough

The pull request introduces a new CI job for running integration tests alongside unit tests in the frontend pipeline. It also renames the existing test job to e2e_test for clarity and adds a unit test for the MainMarketplacePage component.

Changes

Cohort / File(s) Summary
CI Workflow Updates
.github/workflows/platform-frontend-ci.yml
Renamed existing test job to e2e_test. Added new integration_test job that runs on ubuntu-latest with dependency on setup job, performing checkout, Node.js setup, corepack enablement, cache restoration, dependency installation, API client generation, and unit/integration test execution via pnpm test:unit.
Unit Tests
autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/main.test.tsx
New test file for MainMarketplacePage component using Vitest and MSW. Tests mock 422 response handler and verifies "Featured agents" text appears in rendered output.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested reviewers

  • majdyz
  • 0ubbe
  • Swiftyos

Poem

🐰 A test for each path, both e2e and small,
The integration suite hops down the hall,
Marketplace agents now featured with care,
CI pipelines optimized—test jobs everywhere!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes both main changes: renaming the test job to e2e_test and adding a new integration_test job in the CI workflow.
Description check ✅ Passed The description is directly related to the changeset, detailing the CI workflow changes, test file additions, and providing a comprehensive checklist of completed tasks.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added the platform/frontend AutoGPT Platform - Front end label Jan 22, 2026
@Abhi1992002 Abhi1992002 changed the title chore: update CI workflow to include integration tests feat(ci): add integration test job and rename e2e test job Jan 22, 2026
Copy link
Contributor Author

Abhi1992002 commented Jan 22, 2026

@Abhi1992002 Abhi1992002 requested a review from 0ubbe January 22, 2026 07:13
@Abhi1992002 Abhi1992002 marked this pull request as ready for review January 22, 2026 07:13
@Abhi1992002 Abhi1992002 requested review from a team as code owners January 22, 2026 07:13
@Abhi1992002 Abhi1992002 requested review from majdyz and removed request for a team January 22, 2026 07:13
@Abhi1992002 Abhi1992002 marked this pull request as draft January 22, 2026 07:14
- Added a step to generate the API client using `pnpm generate:api:force` in the CI workflow before executing integration tests.
- Modified the CI workflow to use `pnpm generate:api` instead of `pnpm generate:api:force` for generating the API client, streamlining the process before running integration tests.
@Abhi1992002 Abhi1992002 marked this pull request as ready for review January 22, 2026 07:33
0ubbe
0ubbe previously approved these changes Jan 22, 2026
@github-project-automation github-project-automation bot moved this from 🆕 Needs initial review to 👍🏼 Mergeable in AutoGPT development kanban Jan 22, 2026
Base automatically changed from abhi/integration-test-setup to dev January 22, 2026 10:33
@Abhi1992002 Abhi1992002 dismissed 0ubbe’s stale review January 22, 2026 10:33

The base branch was changed.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In
`@autogpt_platform/frontend/src/app/`(platform)/marketplace/components/MainMarketplacePage/__tests__/main.test.tsx:
- Line 3: The test imports/uses the misspelled component name
MainMarkeplacePage—rename the export/import to MainMarketplacePage so the
component symbol matches the folder/file; remove the unrelated mock handler
getDeleteV2DeleteStoreSubmissionMockHandler422 from this featured-agents test
(either replace it with the proper featured-agents mock or delete it), and
simplify the assertion that checks for agent text by removing the redundant
toBeDefined() call or replacing it with toBeInTheDocument() when using getByText
(update references in the test file to MainMarketplacePage and adjust the mock
and assertion accordingly).
🧹 Nitpick comments (4)
autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/main.test.tsx (2)

5-9: Mock handler doesn't match the test purpose.

The test verifies "Featured agents" renders, but the mock handler getDeleteV2DeleteStoreSubmissionMockHandler422 intercepts DELETE requests for store submissions with a 422 error. This mock is unrelated to fetching/displaying featured agents.

Consider using a mock handler for the actual API call that fetches marketplace/featured agents data, or remove the mock if it's not needed for this test.


12-14: Use toBeInTheDocument() for DOM assertions.

The assertion uses toBeDefined() which only checks that the element is not undefined. For testing-library, toBeInTheDocument() from @testing-library/jest-dom is more idiomatic and semantically correct for verifying DOM presence.

♻️ Suggested change
-  expect(
-    await screen.findByText("Featured agents", { exact: false }),
-  ).toBeDefined();
+  expect(
+    await screen.findByText("Featured agents", { exact: false }),
+  ).toBeInTheDocument();
.github/workflows/platform-frontend-ci.yml (2)

262-296: Job naming inconsistency: integration_test runs unit tests.

The job is named integration_test and the step says "Run Integration Tests", but it executes pnpm test:unit. Consider aligning the naming:

  • Rename the job to unit_test if it runs unit tests, or
  • Rename the script to test:integration if these are meant to be integration tests

This will reduce confusion about what the job actually runs.


267-270: Remove submodules: recursive from the integration_test job.

The integration_test job runs unit tests (pnpm test:unit) without Docker Compose, so it has no need for recursive submodules. The e2e_test job (line 141) appropriately retains this setting for Docker Compose builds. Removing this from the integration job will speed up checkout without affecting test functionality.

♻️ Suggested change
      - name: Checkout repository
        uses: actions/checkout@v4
-        with:
-          submodules: recursive
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between b095365 and 53f6e86.

📒 Files selected for processing (2)
  • .github/workflows/platform-frontend-ci.yml
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/main.test.tsx
🧰 Additional context used
📓 Path-based instructions (9)
autogpt_platform/frontend/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

autogpt_platform/frontend/**/*.{ts,tsx}: Always run pnpm install before frontend development, then use pnpm dev to start development server on port 3000
For frontend code formatting and linting, always run pnpm format

If adding protected frontend routes, update frontend/lib/supabase/middleware.ts

autogpt_platform/frontend/**/*.{ts,tsx}: Use generated API hooks from @/app/api/__generated__/endpoints/ for data fetching in frontend
Use function declarations (not arrow functions) for components and handlers in frontend
Only use Phosphor Icons in frontend; never use other icon libraries
Never use src/components/__legacy__/* or deprecated BackendAPI in frontend

Files:

  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/main.test.tsx
autogpt_platform/frontend/**/*.{test,spec}.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

For frontend E2E testing with Playwright, always run pnpm dev first before pnpm test, as Playwright requires a running instance

Run pnpm test or pnpm test-ui for frontend Playwright tests before committing

Files:

  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/main.test.tsx
autogpt_platform/frontend/**/*.{ts,tsx,json}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use Node.js 21+ with pnpm package manager for frontend development

Files:

  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/main.test.tsx
autogpt_platform/frontend/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

autogpt_platform/frontend/src/**/*.{ts,tsx}: Use generated API hooks from @/app/api/__generated__/endpoints/ (generated via Orval from backend OpenAPI spec). Pattern: use{Method}{Version}{OperationName} (e.g., useGetV2ListLibraryAgents). Regenerate with: pnpm generate:api. Never use deprecated BackendAPI or src/lib/autogpt-server-api/*
Use function declarations for components and handlers (not arrow functions). Only arrow functions for small inline lambdas (map, filter, etc.)
Use PascalCase for components, camelCase with use prefix for hooks
No barrel files or index.ts re-exports in frontend
For frontend render errors, use component. For mutation errors, display with toast notifications. For manual exceptions, use Sentry.captureException()
Default to client components (use client). Use server components only for SEO or extreme TTFB needs. Use React Query for server state via generated hooks. Co-locate UI state in components/hooks

Files:

  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/main.test.tsx
autogpt_platform/frontend/**/*.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Format frontend code using pnpm format

Files:

  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/main.test.tsx
autogpt_platform/frontend/**

📄 CodeRabbit inference engine (autogpt_platform/CLAUDE.md)

autogpt_platform/frontend/**: Install frontend dependencies using pnpm i instead of npm
Generate API client from OpenAPI spec using pnpm generate:api
Regenerate API client hooks using pnpm generate:api when OpenAPI spec changes

Files:

  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/main.test.tsx
autogpt_platform/frontend/src/**/*.tsx

📄 CodeRabbit inference engine (autogpt_platform/CLAUDE.md)

Use design system components from src/components/ (atoms, molecules, organisms) in frontend

Files:

  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/main.test.tsx
autogpt_platform/frontend/src/app/**/*.tsx

📄 CodeRabbit inference engine (autogpt_platform/CLAUDE.md)

Create frontend pages in src/app/(platform)/feature-name/page.tsx with corresponding usePageName.ts hook and local components/ subfolder

Files:

  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/main.test.tsx
autogpt_platform/frontend/**/*.{ts,tsx,css}

📄 CodeRabbit inference engine (autogpt_platform/CLAUDE.md)

Use only Tailwind CSS for styling in frontend, with design tokens and Phosphor Icons

Files:

  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/main.test.tsx
🧠 Learnings (5)
📓 Common learnings
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T08:48:55.844Z
Learning: Applies to autogpt_platform/frontend/**/*.{test,spec}.{ts,tsx} : Run `pnpm test` or `pnpm test-ui` for frontend Playwright tests before committing
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/CLAUDE.md:0-0
Timestamp: 2025-11-25T08:49:03.583Z
Learning: Applies to autogpt_platform/frontend/**/*.stories.{ts,tsx} : Add Storybook stories for new frontend components and Playwright E2E tests for features
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T08:48:33.246Z
Learning: Applies to autogpt_platform/frontend/**/*.stories.{ts,tsx} : Add or update Storybook stories for UI components (pnpm storybook). Run Playwright E2E tests with pnpm test
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/CLAUDE.md:0-0
Timestamp: 2025-11-25T08:49:03.583Z
Learning: Applies to autogpt_platform/backend/**/*_test.py : Always review snapshot changes before committing using `git diff` when creating or updating test snapshots
📚 Learning: 2025-11-25T08:48:55.844Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T08:48:55.844Z
Learning: Applies to autogpt_platform/frontend/**/*.{test,spec}.{ts,tsx} : Run `pnpm test` or `pnpm test-ui` for frontend Playwright tests before committing

Applied to files:

  • .github/workflows/platform-frontend-ci.yml
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/main.test.tsx
📚 Learning: 2025-11-25T08:48:33.246Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T08:48:33.246Z
Learning: Applies to autogpt_platform/frontend/**/*.stories.{ts,tsx} : Add or update Storybook stories for UI components (pnpm storybook). Run Playwright E2E tests with pnpm test

Applied to files:

  • .github/workflows/platform-frontend-ci.yml
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/main.test.tsx
📚 Learning: 2025-11-25T08:49:03.583Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/CLAUDE.md:0-0
Timestamp: 2025-11-25T08:49:03.583Z
Learning: Applies to autogpt_platform/frontend/**/*.stories.{ts,tsx} : Add Storybook stories for new frontend components and Playwright E2E tests for features

Applied to files:

  • .github/workflows/platform-frontend-ci.yml
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/main.test.tsx
📚 Learning: 2025-11-25T08:49:03.583Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/CLAUDE.md:0-0
Timestamp: 2025-11-25T08:49:03.583Z
Learning: Applies to autogpt_platform/frontend/src/app/**/*.tsx : Create frontend pages in `src/app/(platform)/feature-name/page.tsx` with corresponding `usePageName.ts` hook and local `components/` subfolder

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/main.test.tsx
🧬 Code graph analysis (1)
autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/main.test.tsx (1)
autogpt_platform/frontend/src/mocks/mock-server.ts (1)
  • server (4-4)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Seer Code Review
  • GitHub Check: types
  • GitHub Check: e2e_test
  • GitHub Check: Check PR Status
🔇 Additional comments (1)
.github/workflows/platform-frontend-ci.yml (1)

131-131: LGTM on renaming test to e2e_test.

Clear naming that distinguishes this job from the new integration/unit test job.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

@Abhi1992002 Abhi1992002 enabled auto-merge January 22, 2026 11:13
@Abhi1992002 Abhi1992002 added this pull request to the merge queue Jan 22, 2026
Merged via the queue into dev with commit fc87ed4 Jan 22, 2026
28 checks passed
@Abhi1992002 Abhi1992002 deleted the abhi/add-integration-tests-in-CI branch January 22, 2026 11:36
@github-project-automation github-project-automation bot moved this from 👍🏼 Mergeable to ✅ Done in AutoGPT development kanban Jan 22, 2026
@github-project-automation github-project-automation bot moved this to Done in Frontend Jan 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

platform/frontend AutoGPT Platform - Front end size/m

Projects

Status: Done
Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants