Prompt

How do I run integration tests as part of CI?

Technology / CI/CD & DevOps1 observationLast seen Oct 19, 2026

Latest observation

Oct 19, 2026OpenAI APIWeb search: off

To run integration tests in CI, the usual pattern is:

  1. Make integration tests a separate test suite

    • Keep them distinct from unit tests.
    • Common names:
      • integration/
      • tests/integration/
      • *IT, *IntegrationTest, etc.
  2. Ensure CI has the required dependencies Integration tests often need:

    • a database
    • Redis
    • message broker
    • external service mock/stub
    • environment variables / secrets

    In CI, you usually provide these via:

    • Docker Compose
    • service containers
    • testcontainers
    • mocked APIs
  3. Run them in a dedicated CI job or stage Typical pipeline structure:

    • lint
    • unit tests
    • build
    • integration tests
    • deploy
  4. Use a clean, repeatable environment Integration tests should start from a known state:

    • create fresh test DB
    • reset fixtures between runs
    • seed data as needed
    • run migrations automatically
  5. Fail the pipeline if they fail Integration tests should block merge/deploy, just like unit tests.


Example CI patterns

GitHub Actions

name: CI

on: [push, pull_request]

jobs:
  unit-tests:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Run unit tests
        run: ./gradlew test

  integration-tests:
    runs-on: ubuntu-latest
    services:
      postgres:
        image: postgres:16
        env:
          POSTGRES_USER: test
          POSTGRES_PASSWORD: test
          POSTGRES_DB: app_test
        ports:
          - 5432:5432
        options: >-
          --health-cmd="pg_isready -U test -d app_test"
          --health-interval=10s
          --health-timeout=5s
          --health-retries=5
    steps:
      - uses: actions/checkout@v4
      - name: Run integration tests
        env:
          DB_HOST: localhost
          DB_PORT: 5432
          DB_USER: test
          DB_PASSWORD: test
        run: ./gradlew integrationTest

GitLab CI

stages:
  - test

integration_tests:
  stage: test
  image: gradle:8-jdk17
  services:
    - postgres:16
  variables:
    POSTGRES_DB: app_test
    POSTGRES_USER: test
    POSTGRES_PASSWORD: test
  script:
    - ./gradlew integrationTest

Docker Compose approach

services:
  app:
    build: .
    depends_on:
      - db
  db:
    image: postgres:16
    environment:
      POSTGRES_DB: app_test
      POSTGRES_USER: test
      POSTGRES_PASSWORD: test

Then CI runs:

docker compose up -d db
./gradlew integrationTest
docker compose down -v

Good practices

  • Separate unit vs integration test commands
  • Keep integration tests deterministic
  • Use timeouts/retries for slow startup dependencies
  • Avoid hitting real third-party APIs in CI unless explicitly required
  • Parallelize carefully if tests share the same DB or state
  • Collect logs/artifacts when integration tests fail

If you want the best setup

A strong modern approach is:

  • unit tests run on every PR
  • integration tests run on every PR too, but in a separate job
  • end-to-end tests run only on main/release branches or nightly

If you tell me your stack (for example: Node/Jest, Python/pytest, Java/Maven/Gradle, .NET, Go, etc.) and CI system (GitHub Actions, GitLab, Jenkins, Azure DevOps), I can give you an exact working config.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.