Commit 7d525992 authored by Mark Lapierre's avatar Mark Lapierre

Push gitlab-ci.yml only once in mwps test

parent a01669c3
...@@ -31,6 +31,26 @@ module QA ...@@ -31,6 +31,26 @@ module QA
it 'merges after pipeline succeeds' do it 'merges after pipeline succeeds' do
transient_test = repeat > 1 transient_test = repeat > 1
# Push a new pipeline config file
Resource::Repository::Commit.fabricate_via_api! do |commit|
commit.project = project
commit.commit_message = 'Add .gitlab-ci.yml'
commit.add_files(
[
{
file_path: '.gitlab-ci.yml',
content: <<~EOF
test:
tags: ["runner-for-#{project.name}"]
script: sleep 20
only:
- merge_requests
EOF
}
]
)
end
repeat.times do |i| repeat.times do |i|
QA::Runtime::Logger.info("Transient bug test - Trial #{i}") if transient_test QA::Runtime::Logger.info("Transient bug test - Trial #{i}") if transient_test
...@@ -55,22 +75,16 @@ module QA ...@@ -55,22 +75,16 @@ module QA
# start it. # start it.
merge_request.visit! merge_request.visit!
# Push a new pipeline config file # Push a new file to trigger a new pipeline
Resource::Repository::Commit.fabricate_via_api! do |commit| Resource::Repository::Commit.fabricate_via_api! do |commit|
commit.project = project commit.project = project
commit.commit_message = 'Add .gitlab-ci.yml' commit.commit_message = 'Add new file'
commit.branch = branch_name commit.branch = branch_name
commit.add_files( commit.add_files(
[ [
{ {
file_path: '.gitlab-ci.yml', file_path: "#{branch_name}-file.md",
content: <<~EOF content: "file content"
test:
tags: ["runner-for-#{project.name}"]
script: sleep 20
only:
- merge_requests
EOF
} }
] ]
) )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment