2020-01-01 13:55:28 +05:30
|
|
|
require './spec/support/sidekiq_middleware'
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2020-10-24 23:57:45 +05:30
|
|
|
SNIPPET_REPO_URL = "https://gitlab.com/gitlab-org/gitlab-snippet-test.git"
|
2015-04-26 12:48:37 +05:30
|
|
|
|
2020-10-24 23:57:45 +05:30
|
|
|
Gitlab::Seeder.quiet do
|
|
|
|
20.times do |i|
|
2019-12-26 22:10:19 +05:30
|
|
|
user = User.not_mass_generated.sample
|
2014-09-02 18:07:02 +05:30
|
|
|
|
2020-10-24 23:57:45 +05:30
|
|
|
user.snippets.create({
|
|
|
|
type: 'PersonalSnippet',
|
2015-09-11 14:41:01 +05:30
|
|
|
title: FFaker::Lorem.sentence(3),
|
2020-10-24 23:57:45 +05:30
|
|
|
file_name: 'file.rb',
|
2015-04-26 12:48:37 +05:30
|
|
|
visibility_level: Gitlab::VisibilityLevel.values.sample,
|
2020-10-24 23:57:45 +05:30
|
|
|
content: 'foo'
|
|
|
|
}).tap do |snippet|
|
|
|
|
unless snippet.repository_exists?
|
|
|
|
snippet.repository.import_repository(SNIPPET_REPO_URL)
|
|
|
|
end
|
|
|
|
|
|
|
|
snippet.track_snippet_repository(snippet.repository.storage)
|
|
|
|
snippet.statistics.refresh!
|
|
|
|
end
|
2015-04-26 12:48:37 +05:30
|
|
|
|
2014-09-02 18:07:02 +05:30
|
|
|
print('.')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|