diff options
author | Rémy Coutable <remy@rymai.me> | 2017-05-10 18:31:50 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-05-18 14:04:50 +0300 |
commit | 7e56ac8f434a327282401796ffd43a46eb08e94c (patch) | |
tree | 2347566de434932fff3dd75bd74ed8301cc21395 /spec/factories/projects.rb | |
parent | 628cc84891228895daa19d7b1300fc032cb26910 (diff) |
If TestEnv#set_repo_refs fails, clean test repos and retry
Sometimes, new references are not retrieved when a `git fetch` is called
in a bare repos. The easiest solution is to cleanup the test repos and
retry in this case. This only happens when a new ref is added to
TestEnv::BRANCH_SHA or TestEnv::FORKED_BRANCH_SHA.
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'spec/factories/projects.rb')
-rw-r--r-- | spec/factories/projects.rb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/spec/factories/projects.rb b/spec/factories/projects.rb index 357ea6b3f7f..7a76f5f8afc 100644 --- a/spec/factories/projects.rb +++ b/spec/factories/projects.rb @@ -60,7 +60,9 @@ FactoryGirl.define do trait :test_repo do after :create do |project| - TestEnv.copy_repo(project) + TestEnv.copy_repo(project, + bare_repo: TestEnv.factory_repo_path_bare, + refs: TestEnv::BRANCH_SHA) end end @@ -139,7 +141,9 @@ FactoryGirl.define do end after :create do |project, evaluator| - TestEnv.copy_repo(project) + TestEnv.copy_repo(project, + bare_repo: TestEnv.factory_repo_path_bare, + refs: TestEnv::BRANCH_SHA) if evaluator.create_template args = evaluator.create_template @@ -172,7 +176,9 @@ FactoryGirl.define do path { 'forked-gitlabhq' } after :create do |project| - TestEnv.copy_repo(project, copy_fork: true) + TestEnv.copy_repo(project, + bare_repo: TestEnv.forked_repo_path_bare, + refs: TestEnv::FORKED_BRANCH_SHA) end end |