惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
T
Tailwind CSS Blog
J
Java Code Geeks
Microsoft Azure Blog
Microsoft Azure Blog
GbyAI
GbyAI
爱范儿
爱范儿
量子位
Martin Fowler
Martin Fowler
V
V2EX
博客园 - 三生石上(FineUI控件)
I
InfoQ
MongoDB | Blog
MongoDB | Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
N
Netflix TechBlog - Medium
D
DataBreaches.Net
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Last Week in AI
Last Week in AI
U
Unit 42
Apple Machine Learning Research
Apple Machine Learning Research
H
Help Net Security
T
The Blog of Author Tim Ferriss
Hugging Face - Blog
Hugging Face - Blog
美团技术团队
Engineering at Meta
Engineering at Meta

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Supercharging Your CI/CD: Integrating TestSprite AI Testi...
ExecuteAutom · 2026-04-23 · via DEV Community

In the evolving landscape of software quality assurance, AI-driven testing is no longer a luxury—it’s a necessity for speed and scale. TestSprite, an AI-powered testing platform, offers a way to generate and execute end-to-end tests using agentic workflows. However, the real power of these tools is unlocked when they are integrated directly into your CI/CD pipeline.

In this article, I will demonstrate how to bridge the gap between containerized applications and cloud-based AI testing agents which is TestSprite in our case and using it with GitHub Actions.

The Challenge: Testing Private Containers from the Cloud

When your application runs in a managed environment like Vercel or Netlify, integration is straightforward. But what if your app is running in a local Docker container or a private GitHub runner?

Because the TestSprite cloud needs to "see" your application to test it, you face a networking hurdle. You cannot simply point the AI to localhost. To solve this, the video introduces a three-tier architecture: Build, Tunnel, and Execute.

Phase 1: The Build

The process starts with a standard GitHub Actions runner. Using Docker Compose, the workflow spins up both the front-end (e.g., Vite) and the back-end (e.g., Node/Express) services. This ensures the environment is a perfect replica of your production stack.

Phase 2: The Tunnel (The Secret Sauce)

To make the private container accessible to TestSprite without exposing it permanently to the internet, the tutorial utilizes the Cloudflare Tunneling library (cloudflared).

  1. Temporary URL: The tunnel creates a random, dynamic URL (e.g., *.trycloudflare.com).

  2. Dynamic Routing: This URL is passed to the TestSprite agent, serving as the BASE_URL for all test execution.

  3. Security: The tunnel is temporary and only exists for the duration of the test execution phase.

Phase 3: Integration and Execution

To trigger the tests, you need to configure your GitHub repository with a few essential pieces:

  1. API Key: Securely store your TestSprite API key in GitHub Repository Secrets as TESTSPRITE_API_KEY.

  2. Workflow YAML: Define a .github/workflows/ci.yml file that calls the test-sprite/run-action@v1.

Once pushed, the pipeline automatically triggers on every Pull Request.

GitHub Action YAML file

Here is how the GH Action Pipeline will look like

name: CI

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main

jobs:
  build-and-test:
    runs-on: ubuntu-latest
    permissions:
      pull-requests: write
      issues: write
      contents: read
    steps:
      - uses: actions/checkout@v4

      - name: Build and start app containers
        run: docker compose up -d --build

      - name: Wait for frontend to be ready
        run: |
          echo "Waiting for frontend on port 5173..."
          timeout 60 bash -c 'until curl -s http://127.0.0.1:5173 > /dev/null 2>&1; do sleep 2; done'
          echo "Frontend is up!"

      - name: Wait for backend to be ready
        run: |
          echo "Waiting for backend on port 4000..."
          timeout 60 bash -c 'until curl -s http://127.0.0.1:4000/employees > /dev/null 2>&1; do sleep 2; done'
          echo "Backend is up!"

      - name: Install and start Cloudflare Tunnel
        run: |
          # Install cloudflared
          curl -sL https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb -o cloudflared.deb
          sudo dpkg -i cloudflared.deb

          # Start tunnel for frontend and capture the public URL
          cloudflared tunnel --url http://127.0.0.1:5173 --no-autoupdate > /tmp/cloudflared.log 2>&1 &
          sleep 10

          # Extract the tunnel URL from the logs
          TUNNEL_URL=$(grep -o 'https://.*\.trycloudflare\.com' /tmp/cloudflared.log | head -1)
          echo "Tunnel URL: $TUNNEL_URL"
          echo "TUNNEL_URL=$TUNNEL_URL" >> $GITHUB_ENV

      - name: Verify tunnel is working
        run: |
          echo "Testing tunnel URL: $TUNNEL_URL"
          curl -sI "$TUNNEL_URL" | head -5

      - name: Rewrite hardcoded URLs in test scripts
        run: |
          echo "Replacing http://127.0.0.1:5173 with $TUNNEL_URL in test files..."
          find testsprite_tests -name '*.py' -exec sed -i "s|http://127.0.0.1:5173|$TUNNEL_URL|g" {} +
          echo "Replacing http://localhost:5173 with $TUNNEL_URL in test files..."
          find testsprite_tests -name '*.py' -exec sed -i "s|http://localhost:5173|$TUNNEL_URL|g" {} +
          # Show a sample to verify
          grep -r 'trycloudflare' testsprite_tests/*.py | head -3 || echo "No replacements found - check URL pattern"

      - name: Run Testsprite Action
        uses: TestSprite/run-action@v1
        with:
          testsprite-api-key: ${{ secrets.TESTSPRITE_API_KEY }}
          github-token: ${{ secrets.GITHUB_TOKEN }}
          base_url: ${{ env.TUNNEL_URL }}
          blocking: 'true'

Enter fullscreen mode Exit fullscreen mode

Real-World Results: AI-Powered PR Reports

The most impressive part of this integration is the feedback loop. Once the tests are complete:

  1. PR Blocking: If tests fail, the Pull Request is automatically blocked from merging, ensuring code quality.

  2. Comprehensive Dashboards: TestSprite provides a detailed dashboard within the PR, showing exactly which cases passed or failed.

  3. Video Evidence: Perhaps most helpfully, the platform provides video recordings of the AI agent interacting with the browser, making it incredibly easy to debug failures.

The most impressive part of this integration is the feedback loop. Once the tests are complete:

PR Blocking: If tests fail, the Pull Request is automatically blocked from merging, ensuring code quality.

Comprehensive Dashboards: TestSprite provides a detailed dashboard within the PR, showing exactly which cases passed or failed.

Video Evidence: Perhaps most helpfully, the platform provides video recordings of the AI agent interacting with the browser, making it incredibly easy to debug failures.

Conclusion

Integrating AI testing into GitHub Actions transforms QA from a bottleneck into a seamless part of the development cycle. By combining Docker, Cloudflare tunneling, and TestSprite, teams can achieve high-confidence deployments with minimal manual intervention.

For a detailed walkthrough of the code and configuration, check out the full video by Execute Automation: