Prompt

How do I set up CI/CD so every merge request runs unit tests, integration tests, and a smoke test after deploy?

Technology / CI/CD & DevOps2 observationsLast seen Nov 9, 2026

Latest observation

Nov 9, 2026OpenAI APIWeb search: off

A good way to do this is to split your pipeline into:

  1. Merge request pipeline
    Runs on every MR:

    • unit tests
    • integration tests
    • build/package
    • deploy to a temporary review/staging environment
    • smoke test against that deployed app
  2. Main branch pipeline
    Runs on merge to main:

    • same test/build steps if you want
    • deploy to production
    • optional post-deploy smoke test

A common pattern is:

  • MR: validate code, deploy to ephemeral environment, smoke test
  • main: deploy to staging/prod, smoke test again

Example: GitLab CI/CD

If you’re using GitLab, this structure is typical:

stages:
  - test
  - build
  - deploy
  - smoke

unit_tests:
  stage: test
  script:
    - npm ci
    - npm test -- --runInBand
  rules:
    - if: $CI_PIPELINE_SOURCE == "merge_request_event"

integration_tests:
  stage: test
  script:
    - npm ci
    - npm run test:integration
  rules:
    - if: $CI_PIPELINE_SOURCE == "merge_request_event"

build:
  stage: build
  script:
    - npm ci
    - npm run build
  artifacts:
    paths:
      - dist/
  rules:
    - if: $CI_PIPELINE_SOURCE == "merge_request_event"

deploy_review:
  stage: deploy
  script:
    - ./deploy.sh review-$CI_MERGE_REQUEST_IID
  environment:
    name: review/$CI_MERGE_REQUEST_IID
    url: https://review-$CI_MERGE_REQUEST_IID.example.com
  rules:
    - if: $CI_PIPELINE_SOURCE == "merge_request_event"

smoke_test:
  stage: smoke
  script:
    - ./smoke-test.sh https://review-$CI_MERGE_REQUEST_IID.example.com
  rules:
    - if: $CI_PIPELINE_SOURCE == "merge_request_event"

Example: GitHub Actions

If you’re using GitHub Actions, you can do it with separate jobs and a deploy-to-preview step:

name: CI

on:
  pull_request:

jobs:
  unit-tests:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
      - run: npm ci
      - run: npm test -- --runInBand

  integration-tests:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
      - run: npm ci
      - run: npm run test:integration

  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
      - run: npm ci
      - run: npm run build

  deploy-and-smoke:
    runs-on: ubuntu-latest
    needs: [unit-tests, integration-tests, build]
    steps:
      - uses: actions/checkout@v4
      - run: ./deploy.sh preview
      - run: ./smoke-test.sh https://preview.example.com

Best practices

  • Run unit and integration tests before deploy
  • Make smoke tests fast and focused on critical paths
  • Use ephemeral preview environments for merge requests if possible
  • Fail fast: don’t deploy if tests fail
  • Cache dependencies to speed up pipelines
  • Separate test types so failures are easier to diagnose
  • Require pipeline success before merge

Recommended flow

  1. Developer opens MR
  2. Pipeline runs unit tests
  3. Pipeline runs integration tests
  4. Pipeline builds artifact
  5. Pipeline deploys to preview/review environment
  6. Pipeline runs smoke test
  7. If all pass, MR can be merged

If you tell me which CI system you use (GitLab, GitHub Actions, Jenkins, CircleCI, Azure DevOps, etc.), I can give you an exact config file tailored to it.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (2 observations 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.