diff --git a/test/factories/repositories.rb b/test/factories/repositories.rb index 00923b2481..77ff80bcbb 100644 --- a/test/factories/repositories.rb +++ b/test/factories/repositories.rb @@ -18,7 +18,11 @@ factory :repository do name { Faker::Lorem.word + Faker::Number.unique.number(digits: 8).to_s } remote { "git@github.com:dodona-edu/#{name}.git" } - association :judge, factory: %i[judge git_stubbed] + judge { Judge.find(1) } # load python judge fixture + + trait :generated_judge do + association :judge, factory: %i[judge git_stubbed] + end trait :git_stubbed do path { "#{name}.git" } diff --git a/test/runners/submission_runner_test.rb b/test/runners/submission_runner_test.rb index b5025fc591..a53451b3c4 100644 --- a/test/runners/submission_runner_test.rb +++ b/test/runners/submission_runner_test.rb @@ -4,7 +4,7 @@ class SubmissionRunnerTest < ActiveSupport::TestCase setup do - @repository = create :repository, :git_stubbed + @repository = create :repository, :git_stubbed, :generated_judge @judge = @repository.judge @course = create :course @user = create :user, courses: [@course] diff --git a/test/test_helper.rb b/test/test_helper.rb index 4ee600aaed..6593f900d6 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -38,6 +38,8 @@ class ActiveSupport::TestCase include RemoteHelper include SeriesZipHelper + fixtures :all + # Run tests in parallel with specified workers parallelize(workers: :number_of_processors)