browser_ui/4_verify/pipeline_for_project_mirror_github_spec.rb | Verify Pipeline for project mirrors Github user commits to GitHub triggers CI pipeline
Focused testcase for integrating external repositories
Related epic: gitlab-org&1669
Environment configure
Rails query
Plan.find_by(name: ‘gold’).actual_limits.update!(pull_mirror_interval_seconds: 0)
Must set to 0 seconds to allow test to complete, related docs https://docs.gitlab.com/ee/user/project/repository/repository_mirroring.html#forcing-an-update
Automated test location
./qa/specs/features/ee/browser_ui/6_release/pipelines_for_github_imported_project_spec.rb
Steps
- Login as premium user
- Go to Project click 'New Project'
- Select tab 'CI/CD for external repo'
- Select 'GitHub' option
- Input Github Personal Access Token - Click 'Authenticate' - need to figure out where to set this as new environment variable for pipeline or at least create a new environment variable
- Select project to import (in this case 'test-project') - This project should already have a
.gitlab-ci.yml
file to trigger pipeline run on every commit. - Wait for import to finish - Go to project
- Go to Settings/Repository - expand 'Mirroring Project' - if 'Pull' mirror direction is not set, set it.
- Go to project in GitHub, commit a change to a file. (Need to figure out how to do this via their API)
- Go back to Settings/Repository/Mirroring Project click 'Update Now'
- Verify flash message 'The repository is being updated...'
- Check back in GitLab project a new pipeline is triggered and succeeds
- Verify pipeline commit message is the same as Github commit message (this message should have a unique timestamp every time the commit is made)
Edited by GitLab QA Bot