Set up test uploads
MCP tool reference: setup-trunk-uploads
Overview
The setup-trunk-uploads
tool helps configure test result uploads to Trunk for flaky test detection and enhanced CI Autopilot analysis. This tool provides step-by-step instructions tailored to your specific test framework and CI provider combination.
The tool guides you through a 4-step process:
Return Type: Structured setup plan to generate test reports and upload to Trunk. Structure: project analysis and setup plan
Parameters
This agent needs to be called once per test framework used in your repository. If your repository uses multiple test frameworks (e.g., Jest for frontend, pytest for backend), call this tool once for each framework with the same ci_provider
.
Required Parameters
testFramework
string
The test framework used in your repository (e.g., jest
, pytest
, mocha
)
ciProvider
string
Your CI provider (e.g., github
, circleci
)
orgSlug
string
Your organization slug. If not provided and you belong to multiple organizations, you'll be prompted to specify one.
Supported Values
Test Frameworks
android
- Android testing frameworkbazel
- Bazel test runnercypress
- Cypress end-to-end testinggotestsum
- Go testing with gotestsumjasmine
- Jasmine testing frameworkjest
- Jest testing frameworkkarma
- Karma test runnermaven
- Maven Surefire/Failsafe testingminitest
- Ruby minitest frameworkmocha
- Mocha testing frameworkphpunit
- PHPUnit testing frameworkplaywright
- Playwright testing frameworkpytest
- Python pytest frameworkrspec
- Ruby RSpec testing frameworkrust
- Rust testing with cargo testswift-testing
- Swift Testing frameworkvitest
- Vitest testing frameworkxctest
- Xcode XCTest framework
CI Providers
buildkite
- Buildkite pipelinescircleci
- CircleCI pipelinesdrone
- Drone CIgithub
- GitHub Actionsgitlab
- GitLab CI/CDsemaphore
- Semaphore CItravis
- Travis CIother
- Other CI providers (manual configuration)
Usage Examples
Basic Setup
Use the setup-trunk-uploads tool with testFramework="jest" and ciProvider="github"
With Organization Slug
Use the setup-trunk-uploads tool with testFramework="pytest", ciProvider="circleci", and orgSlug="my-company"
Multiple Test Frameworks
Use the setup-trunk-uploads tool with testFramework="jest" and ciProvider="github"
Use the setup-trunk-uploads tool with testFramework="playwright" and ciProvider="github"
Sample Response
The tool returns detailed setup instructions as plain text:
Project Analysis
- Test Framework: Vitest (detected from package.json and vitest.config.mts)
- CI Provider: GitHub Actions (detected from repository URL)
- Repository: agraebe/ci-autopilot-sample
Setup Plan
To enable flaky test uploads to Trunk, you'll need to complete these 4 steps:
1. Configure Vitest to output JUnit reports
Update your vitest.config.mts to include the JUnit reporter that will generate XML test reports.
2. Run tests with the new configuration
Execute your tests to generate the JUnit XML report.
3. Send a test upload to Trunk
Run a command to upload your first test results to Trunk using your API token.
4. Configure GitHub Actions
Add a step to your GitHub Actions workflow to automatically upload test results on every CI run.
Error Handling
Test framework is required
testFramework
parameter missing
Provide a supported test framework from the list above
CI provider is required
ciProvider
parameter missing
Provide a supported CI provider from the list above
User is not authenticated
Missing or invalid authentication
Ensure you're properly authenticated with Trunk
User is not a member of any organization
No organization access
Create or join a Trunk organization
No organizations found
No accessible organizations
Create an organization in the Trunk app
Multiple organizations note
User belongs to multiple orgs, none specified
Provide explicit orgSlug
parameter
Last updated