GitHub Integration
Connect your GitHub repositories to TMS to link commits to test cases, show test results as PR status checks, and run TMS-integrated tests in GitHub Actions.
What You Can Do
- Link commits to test cases -- Include
[TMS-123]in commit messages to auto-link - PR status checks -- See test results directly on pull requests
- GitHub Actions -- Run your test suite with TMS reporting in CI
- Repository sync -- Browse code coverage and test case mappings from TMS
Connect GitHub to TMS
Step 1: Open Integration Settings
- In TMS, go to Settings > Integrations
- Find GitHub and click Connect
Step 2: Authorize TMS
- You'll be redirected to GitHub's authorization page
- Select the organization and repositories to grant access to
- Click Authorize
Step 3: Select Repositories
After authorizing, choose which repositories to link:
- Select the repositories that contain your test code
- Map each repository to a TMS project
- Click Save
Link Commits to Test Cases
Include [TMS-123] anywhere in your commit message to automatically link the commit to TMS test case 123:
git commit -m "Fix login validation [TMS-101] [TMS-102]"
This creates a link visible in both places:
- In TMS: The test case shows the commit under "Related Commits"
- In GitHub: The commit links back to the TMS test case
Multiple test cases in one commit
git commit -m "Refactor auth module [TMS-101] [TMS-102] [TMS-103]"
In pull request descriptions
You can also reference test cases in PR descriptions:
## Changes
- Fixed login validation logic
- Updated error messages
## Test Cases
- [TMS-101] Login with valid credentials
- [TMS-102] Login with invalid password
PR Status Checks
When TMS is connected to GitHub, test results appear as status checks on pull requests.
How it works
- A developer opens a PR
- GitHub Actions (or your CI) runs tests with the TMS reporter
- TMS receives the results and updates the PR status check
- The PR shows a green check (all passed) or red X (failures)
Setup
- Go to Settings > Integrations > GitHub
- Under Status Checks, toggle Enable PR status checks
- Select which test runs should report to PRs:
- All test runs triggered from the repository
- Only CI test runs (triggered via GitHub Actions)
- Specific test plans only
What the check shows
The status check includes:
- Total tests run
- Pass/fail/skip counts
- Link to the full test run in TMS
- Failed test names (in the details)
GitHub Actions
Run your tests with TMS reporting in GitHub Actions. Here's a complete workflow example:
Playwright Example
.github/workflows/tests.yml
name: Run Tests
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
env:
TMS_API_URL: ${{ secrets.TMS_API_URL }}
TMS_API_KEY: ${{ secrets.TMS_API_KEY }}
TMS_ORGANIZATION_ID: ${{ secrets.TMS_ORGANIZATION_ID }}
TMS_PROJECT_ID: ${{ secrets.TMS_PROJECT_ID }}
TMS_ENVIRONMENT: ci
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Install Playwright browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npx playwright test
- name: Upload test report
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
Jest Example
.github/workflows/tests.yml
name: Run Tests
on:
push:
branches: [main]
pull_request:
env:
TMS_API_URL: ${{ secrets.TMS_API_URL }}
TMS_API_KEY: ${{ secrets.TMS_API_KEY }}
TMS_ORGANIZATION_ID: ${{ secrets.TMS_ORGANIZATION_ID }}
TMS_PROJECT_ID: ${{ secrets.TMS_PROJECT_ID }}
TMS_ENVIRONMENT: ci
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- run: npx jest --ci
pytest Example
.github/workflows/tests.yml
name: Run Tests
on:
push:
branches: [main]
pull_request:
env:
TMS_API_URL: ${{ secrets.TMS_API_URL }}
TMS_API_KEY: ${{ secrets.TMS_API_KEY }}
TMS_ORGANIZATION_ID: ${{ secrets.TMS_ORGANIZATION_ID }}
TMS_PROJECT_ID: ${{ secrets.TMS_PROJECT_ID }}
# The pytest plugin reads TMS_BASE_URL (defaults to https://tms.provalab.io)
TMS_BASE_URL: ${{ secrets.TMS_API_URL }}
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- run: pip install -r requirements.txt
- run: pip install https://plugins.provalab.io/packages/pytest_tms_plugin-1.0.13-py3-none-any.whl
# Reporting is on by default once TMS_* is set (there is no --tms-enable).
# The pytest plugin has no environment flag; name the run instead.
- run: pytest --tms-test-run-name="ci #${{ github.run_number }}"
Setting up GitHub Secrets
- Go to your GitHub repository
- Click Settings > Secrets and variables > Actions
- Add these secrets:
| Secret | Value |
|---|---|
TMS_API_URL | https://tms.provalab.io (or your self-hosted URL) |
TMS_API_KEY | Your API key from auth.provalab.io/api-keys |
TMS_ORGANIZATION_ID | Your organization ID |
TMS_PROJECT_ID | Your project ID |
Use organization-level secrets
If you have multiple repositories, add TMS secrets at the GitHub organization level so all repos can use them.
Verify It Works
- Connect GitHub from Settings > Integrations
- Add TMS secrets to your GitHub repository
- Create a commit with
[TMS-1]in the message - Push and verify the link appears in TMS
- Open a PR and verify the status check appears
Common issues
- Status check not appearing: Make sure PR status checks are enabled in TMS integration settings
- Commit links not working: Verify the format is
[TMS-123](with brackets and dash) - GitHub Actions failing: Check that all four TMS secrets are configured in your repository settings