From 01fe901e47895df923235b66d7e8ce0f2341ee2b Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Mon, 5 Oct 2015 09:59:02 -0700 Subject: Fixes GDK issue where repos would not be imported properly Seed-Fu runs this entire fixture in a transaction, so the `after_commit` hook won't run until after the fixture is loaded. That is too late since the Sidekiq::Testing block has already exited. Force clearing the `after_commit` queue to ensure the job is run now. See: gitlab-org/gitlab-development-kit#58 --- db/fixtures/development/04_project.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/db/fixtures/development/04_project.rb b/db/fixtures/development/04_project.rb index 8f71198e47f..973b3f278f9 100644 --- a/db/fixtures/development/04_project.rb +++ b/db/fixtures/development/04_project.rb @@ -73,6 +73,11 @@ Sidekiq::Testing.inline! do } project = Projects::CreateService.new(User.first, params).execute + # Seed-Fu runs this entire fixture in a transaction, so the `after_commit` + # hook won't run until after the fixture is loaded. That is too late + # since the Sidekiq::Testing block has already exited. Force clearing + # the `after_commit` queue to ensure the job is run now. + project.send(:_run_after_commit_queue) if project.valid? print '.' -- cgit v1.2.1 From 9ccd8e2617e9d6e8b5f2ef02e46b5ac8457807aa Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Tue, 6 Oct 2015 11:21:45 -0700 Subject: Verify repository is valid --- db/fixtures/development/04_project.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/fixtures/development/04_project.rb b/db/fixtures/development/04_project.rb index 973b3f278f9..b4639999967 100644 --- a/db/fixtures/development/04_project.rb +++ b/db/fixtures/development/04_project.rb @@ -79,7 +79,7 @@ Sidekiq::Testing.inline! do # the `after_commit` queue to ensure the job is run now. project.send(:_run_after_commit_queue) - if project.valid? + if project.valid? && project.valid_repo? print '.' else puts project.errors.full_messages -- cgit v1.2.1