Skip to content

Commit

Permalink
Create projects test data with multiple packages multiple times
Browse files Browse the repository at this point in the history
  • Loading branch information
ncounter committed Oct 7, 2024
1 parent 4be2ec8 commit 4c58c48
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/api/lib/tasks/dev.rake
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,21 @@ namespace :dev do
args.with_defaults(repetitions: 1)
repetitions = args.repetitions.to_i

require 'factory_bot'
include FactoryBot::Syntax::Methods

admin = User.default_admin
User.session = admin

# Create n project with n packages each
repetitions.times do |repetition|
new_project_name = "#{Faker::Lorem.words.join(':')}_#{repetition}"
new_project = create(:project, name: new_project_name, commit_user: admin)
repetitions.times do |repetition_package|
create(:package_with_file, name: "#{Faker::Lorem.words.join('_')}_#{repetition_package}", project: new_project, file_content: 'some content')
end
end

Rake::Task['dev:requests:multiple_actions_request'].invoke(repetitions)
Rake::Task['dev:requests:request_with_multiple_submit_actions_builds_and_diffs'].invoke(repetitions)

Expand Down

0 comments on commit 4c58c48

Please sign in to comment.