agentsclimarketplace

Run e2e tests

Skill codescene-oss/codescene-mcp-server/.agents/skills/run-e2e-tests

Run the end-to-end integration test suite for the CodeScene MCP Server. Use when you need to verify that all MCP tools work correctly against the real CLI and server infrastructure.From its SKILL.md

Install
npx -y skills add codescene-oss/codescene-mcp-server --skill run-e2e-tests

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

SKILL.md

4.9 KB, as published. Nobody here has run it

Purpose

Use this skill when you need to run the full e2e test suite to verify MCP server behavior end-to-end. These tests launch the compiled MCP server binary, communicate over JSON-RPC stdio, and exercise real tool calls against the CodeScene API.

Prerequisites

  • Rust toolchain (cargo)
  • CS_ACCESS_TOKEN environment variable set with a valid CodeScene access token
  • git available in PATH
  • Docker (only for Docker backend)

How to Run

Full suite (default — static/Cargo backend)

cargo test --test e2e

This builds the release binary (or uses CS_MCP_EXECUTABLE if set) and runs all registered test modules.

Run a specific test

cargo test --test e2e test_business_case_basic_response

Run all tests matching a pattern

cargo test --test e2e test_analytics

Include ignored tests (e.g., stress tests)

cargo test --test e2e -- --ignored

Run with a specific backend

# Static/Cargo backend (default)
CS_MCP_BACKEND=static cargo test --test e2e

# Docker backend
CS_MCP_BACKEND=docker cargo test --test e2e

# npm backend
CS_MCP_BACKEND=npm cargo test --test e2e

Use a pre-built executable (skip build)

CS_MCP_EXECUTABLE=target/release/cs-mcp cargo test --test e2e

Test Modules

ModuleWhat it tests
analyze_change_setanalyze_change_set tool
analytics_environment_overrideCS_ENVIRONMENT override
analytics_trackingAnalytics event sending and enrichment
bundled_docsexplain_code_health and explain_code_health_productivity tools
business_casecode_health_refactoring_business_case tool
cloudfront_headersCloudFront API client headers
configureget_config and set_config tools
enabled_toolsTool filtering via CS_ENABLED_TOOLS
error_loggingError telemetry redaction and file logging
git_subtreeGit subtree repository support
git_worktreeGit worktree repository support
oauth_loginMCP OAuth contract via fake CLI (CS_CLI_PATH)
oauth_login_flowReal CLI Authorization Code flow against mock OAuth server (host-only; skips Docker)
platform_specificPath handling (absolute, relative, symlinks, spaces, unicode)
relative_pathsRelative path resolution
require_access_tokenAccess token validation
shutdown_during_handshakeGraceful shutdown (stdin close + SIGTERM)
skill_resourcesSkill resources, listing, reading, and syncing
ssl_api_ca_bundleSSL CA bundle configuration for API calls
ssl_cli_truststoreSSL truststore args for CLI
standalone_licenseStandalone license tool filtering
stress_code_health_reviewStress test (250 iterations, #[ignore])
version_checkVersion check tool and background fetch

All modules are declared in tests/e2e/tests/mod.rs and wrappers are in tests/e2e/main.rs.

Infrastructure

FileRole
tests/e2e/main.rsEntry point, #[test] wrappers, setup(), find_or_build_executable(), make_client()
tests/e2e/tests/mod.rsModule declarations and infrastructure re-exports
tests/e2e/mcp_client.rsMCPClient — JSON-RPC over stdio
tests/e2e/server_backends.rsServerBackend trait + 3 backend implementations
tests/e2e/file_utils.rscreate_git_repo(), create_temp_dir()
tests/e2e/response_parsers.rsextract_result_text(), extract_code_health_score()
tests/e2e/fixtures.rsSample code with known Code Health characteristics
tests/e2e/tests/fake_http_server.rsFakeHttpServer for intercepting API calls
tests/e2e/tests/fake_https_server.rsFakeHttpsServer for SSL tests

Interpreting Results

Standard cargo test output with pass/fail per test:

test test_business_case_basic_response ... ok
test test_analytics_events_are_sent ... ok
test test_platform_symlinks ... ignored  (Docker)

Exit code is 0 if all pass, non-zero otherwise.

Troubleshooting

  • CS_ACCESS_TOKEN not set: Export it before running. Some tests intentionally use invalid tokens but the env var must exist.
  • Build failures: Run cargo build --release separately to isolate build errors.
  • Timeout on tool calls: Default timeout is 60s per tool call. CodeScene API latency may cause timeouts — not a code bug.
  • Docker tests fail: Ensure Docker is running and host.docker.internal resolves.
  • Tests marked ignored: Stress tests are #[ignore] by default. Run with --ignored to include them.
  • Platform-specific tests skip in Docker: Tests using skip_if_docker() print a message and return early — this is expected.

Keep looking

Skills are one crate of 616,096. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.