Token导航 LogoToken导航TokenDH.com
开发敏感数据github未标认证来源可访问许可证需确认审计通过

running-integration-tests运行集成测试

Agent Skill

用于辅助测试设计、自动化测试、用例整理和回归验证。它适合让 Agent 编写单元测试、端到端测试、测试计划或根据失败日志定位问题。使用时需要确认项目测试框架、运行命令和夹具数据,避免为了通过测试而改坏真实逻辑;涉及浏览器或外部服务时,应区分本地模拟、测试环境和生产环境。

总安装

699

周安装

28

GitHub Stars

2,110

下载量

226
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:running-integration-tests(运行集成测试)
来源仓库:https://github.com/jeremylongshore/claude-code-plugins-plus-skills
仓库路径:skills/running-integration-tests
安装命令:
npx skills add https://github.com/jeremylongshore/claude-code-plugins-plus-skills --skill running-integration-tests
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/jeremylongshore/claude-code-plugins-plus-skills --skill running-integration-tests

简介

用于辅助测试设计、自动化测试、用例整理和回归验证。

  • 适合编写单元测试、端到端测试或根据失败日志定位问题。
  • 需确认项目测试框架、运行命令和夹具数据后使用。
  • 涉及浏览器或外部服务时,应区分本地模拟与生产环境。
  • running-integration-tests 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Integration Test Runner

Overview

Execute integration tests that validate interactions between multiple components, services, and external systems. Tests real database queries, API calls between services, message queue publishing/consuming, and file system operations without mocking the integration boundary.

Prerequisites

  • Integration test framework installed (Jest + Supertest, pytest, JUnit 5, or Go testing)
  • External services running (database, cache, message queue) via Docker Compose or Testcontainers
  • Database migrations applied and seed data loaded
  • Test configuration with connection strings pointing to test instances (not production)
  • Sufficient timeout settings (integration tests are slower than unit tests)

Instructions

  1. Identify integration boundaries to test:

- API routes with database queries (controller-to-repository flow). - Service-to-service HTTP communication. - Message queue producers and consumers. - File upload/download with storage services. - Cache read/write operations (Redis, Memcached).

  1. Set up test infrastructure:

- Start required services using docker-compose -f docker-compose.test.yml up -d. - Or use Testcontainers to programmatically start/stop containers per test suite. - Run database migrations against the test database. - Seed baseline data required by the test suite.

  1. Write integration tests following these patterns:

- API integration: Send HTTP requests via Supertest and assert responses including headers, status, and body. - Database integration: Execute the service method and verify database state with direct queries. - Event integration: Publish a message and verify the consumer processes it correctly. - Use real implementations, not mocks, at the integration boundary.

  1. Manage test data isolation:

- Wrap each test in a database transaction and roll back after assertion. - Or truncate tables in beforeEach and re-seed minimum required data. - Use unique identifiers per test to avoid collisions in shared databases.

  1. Handle asynchronous operations:

- Poll for expected state changes with timeout (e.g., wait for queue consumer to process). - Use event listeners or callbacks to signal completion. - Set generous timeouts (10-30 seconds) for external service interactions.

  1. Run integration tests separately from unit tests:

- Tag with @integration or place in a separate directory (tests/integration/). - Configure CI to run integration tests in a dedicated job with service containers.

  1. Generate test results in JUnit XML format for CI reporting.

Output

  • Integration test files in tests/integration/ organized by feature
  • Docker Compose test configuration for service dependencies
  • Database seed and teardown scripts
  • JUnit XML test results for CI consumption
  • Integration test coverage report showing tested integration points

Error Handling

ErrorCauseSolution
Connection refused to databaseDatabase container not yet readyAdd wait-for-it.sh or health check polling before running tests; increase startup timeout
Foreign key constraint violationTest data inserted in wrong order or cleanup incompleteSeed data in dependency order; use cascading deletes in teardown; wrap in transactions
Flaky test due to race conditionAsync consumer has not processed the message yetUse polling with timeout instead of fixed sleep; add event completion callbacks
Test passes locally, fails in CICI uses different service versions or network configPin Docker image versions; verify environment variables match; check CI service container logs
Slow test suite (>5 minutes)Too many integration tests or insufficient parallelizationRun independent test suites in parallel CI jobs; use Testcontainers reuse mode; limit seed data

Examples

Supertest API integration test:

import request from 'supertest';
import { app } from '../src/app';
import { db } from '../src/database';

describe('POST /api/users', () => {
  beforeEach(async () => { await db.query('DELETE FROM users'); });
  afterAll(async () => { await db.end(); });

  it('creates a user and persists to database', async () => {
    const response = await request(app)
      .post('/api/users')
      .send({ name: 'Alice', email: 'alice@example.com' })
      .expect(201);  # HTTP 201 Created

    expect(response.body).toMatchObject({ name: 'Alice' });
    const row = await db.query('SELECT * FROM users WHERE email = $1', ['alice@example.com']);
    expect(row.rows).toHaveLength(1);
  });
});

pytest with database transaction rollback:

import pytest
from myapp.services import UserService

@pytest.fixture
def db_session(test_database):
    session = test_database.begin_nested()
    yield session
    session.rollback()

def test_create_user_persists_to_db(db_session):
    service = UserService(db_session)
    user = service.create(name="Alice", email="alice@test.com")
    assert user.id is not None
    found = db_session.query(User).filter_by(email="alice@test.com").one()
    assert found.name == "Alice"

Resources

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

32.73%
按下载量换算74

Claude

32.5%
按下载量换算73

Cursor

16.57%
按下载量换算37

Gemini CLI

9.49%
按下载量换算21

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills