Skip to content

Commit

Permalink
Add fixture for a default judge
Browse files Browse the repository at this point in the history
Total judge creations went from 1535 to 73

[TEST PROF INFO] Factories usage

 Total: 8599
 Total top-level: 4270
 Total time: 03:54.862 (out of 06:43.941)
 Total uniq factories: 37

   total   top-level     total time      time per call      top-level time               name

    1473         109       24.3592s            0.0165s            11.2835s         repository
    1458         435       12.0872s            0.0083s             3.8035s               user
    1283         262       73.5874s            0.0574s            13.7818s           exercise
     806         806       71.1712s            0.0883s            71.1712s         submission
     592         155       83.8848s            0.1417s            19.8428s correct_submission
     543         325       22.0437s            0.0406s            17.8401s             course
     496         496        3.3731s            0.0068s             3.3731s            student
     384         269       61.0696s            0.1590s            42.7817s             series
     381         381        2.5946s            0.0068s             2.5946s              staff
     280         280        2.1584s            0.0077s             2.1584s               zeus
     157          54        0.4005s            0.0026s             0.1364s        institution
      97          97        1.0500s            0.0108s             1.0500s           question
      90          90        1.5166s            0.0169s             1.5166s         score_item
      73          56        1.0448s            0.0143s             0.7232s              judge
      60          60       31.9354s            0.5323s            31.9354s         evaluation
      59          59        0.9784s            0.0166s             0.9784s              score
      48          48        5.7290s            0.1194s             5.7290s   wrong_submission
      42          15        0.8719s            0.0208s             0.3302s       content_page
      33          33        1.4321s            0.0434s             1.4321s activity_read_state
      33          33        0.1128s            0.0034s             0.1128s           identity
      32          32        0.1947s            0.0061s             0.1947s           provider
      26          26        0.2237s            0.0086s             0.2237s         annotation
      18          18        0.1316s            0.0073s             0.1316s       lti_provider
      16          16        0.1104s            0.0069s             0.1104s smartschool_provider
      16          16        0.1182s            0.0074s             0.1182s office365_provider
      15          15        0.1127s            0.0075s             0.1127s          api_token
      15          15        0.1908s            0.0127s             0.1908s    gsuite_provider
      13          13        0.0995s            0.0077s             0.0995s      saml_provider
      11          11        0.0212s            0.0019s             0.0212s              label
      11          11        0.0399s            0.0036s             0.0399s programming_language
       9           9        0.2052s            0.0228s             0.2052s     rights_request
       7           7        0.5774s            0.0825s             0.5774s  course_submission
       6           6        0.0429s            0.0072s             0.0429s     temporary_user
       5           5        0.1066s            0.0213s             0.1066s evaluation_exercise
       5           1        0.0730s            0.0146s             0.0175s             export
       4           4        0.0827s            0.0207s             0.0827s       notification
       2           2        0.0127s            0.0064s             0.0127s    activity_status
  • Loading branch information
bmesuere committed Aug 31, 2021
1 parent f1aba5d commit 8c6635f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion test/factories/repositories.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
factory :repository do
name { Faker::Lorem.word + Faker::Number.unique.number(digits: 8).to_s }
remote { "[email protected]: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" }
Expand Down
2 changes: 1 addition & 1 deletion test/runners/submission_runner_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 2 additions & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 8c6635f

Please sign in to comment.