Overview
Spur integrates with GitLab CI/CD to run your Test Plans automatically on merge requests. The setup follows the same pattern as the GitHub integration — connect GitLab from Spur, configure your Test Plans, and add the generated pipeline files to your repository.What you get
Automated test execution
Test Plans run automatically on every merge request without manual intervention.
MR status checks
Pass/fail results appear directly on your merge requests.
Deployment quality gate
Tests run right before deployment, catching issues before they reach production.
Branch protection
Block merge requests with failing tests using GitLab’s protected branch rules.
Setup
1
Go to integrations
Open the Integrations page in your Spur dashboard and connect GitLab.
2
Configure your integration
Once connected, select which Test Plans should run as part of your CI/CD pipeline and configure your settings.
3
Add pipeline files to your repository
Download the generated pipeline configuration and add it to your repository’s
.gitlab-ci.yml file. The Spur team helps you finish this configuration — see the note below.The generated trigger-spur-webhook job contains your API key in the line SPUR_GITLAB_KEY="…". Before you commit the file, delete that line and store the key as a masked GitLab CI/CD variable named SPUR_GITLAB_KEY.4
Save changes
Click Save Changes to finalize your integration. From this point, Spur will run your selected Test Plans automatically on every merge request.
Contact the Spur team to finish configuring your
.gitlab-ci.yml file.Running on pipelines without a merge request
The generatedtrigger-spur-webhook job runs only on merge request pipelines:
main, change or extend this rule:
main with your target branch. This example adds pushes to that branch; it does not add scheduled pipelines. See GitLab job rules for other pipeline types.
Spur runs your mapped Test Plans when a commit triggers the webhook, even when no merge request contains the commit. Spur posts the status comment only when the commit belongs to a merge request.
If a GitLab request fails, such as a token refresh or merge request lookup, Spur still starts the run but can’t post the comment. The webhook response includes a warning field explaining why, and the CI job log prints it. If you expect merge request comments and see this warning, reconnect GitLab from the Integrations page.
Testing deploy previews
The GitLab trigger runs every mapped Test Plan against the URLs saved in your Environments. It does not accept Override URLs or thetest_plan_ids filter. Of the CI/CD triggers, only the GitHub webhook endpoint supports them.