Commit c53a8610 authored by Andrejs Cunskis's avatar Andrejs Cunskis

Merge branch 'acunskis-generic-json-importers' into 'master'

Update large gh import spec test data json

See merge request gitlab-org/gitlab!84258
parents b92d0d94 95f0684d
...@@ -21,11 +21,11 @@ module QA ...@@ -21,11 +21,11 @@ module QA
end end
end end
let(:github_repo) { ENV['QA_LARGE_GH_IMPORT_REPO'] || 'rspec/rspec-core' } let(:github_repo) { ENV['QA_LARGE_IMPORT_REPO'] || 'rspec/rspec-core' }
let(:import_max_duration) { ENV['QA_LARGE_GH_IMPORT_DURATION'] ? ENV['QA_LARGE_GH_IMPORT_DURATION'].to_i : 7200 } let(:import_max_duration) { ENV['QA_LARGE_IMPORT_DURATION'] ? ENV['QA_LARGE_IMPORT_DURATION'].to_i : 7200 }
let(:github_client) do let(:github_client) do
Octokit::Client.new( Octokit::Client.new(
access_token: ENV['QA_LARGE_GH_IMPORT_GH_TOKEN'] || Runtime::Env.github_access_token, access_token: ENV['QA_LARGE_IMPORT_GH_TOKEN'] || Runtime::Env.github_access_token,
auto_paginate: true auto_paginate: true
) )
end end
...@@ -106,6 +106,7 @@ module QA ...@@ -106,6 +106,7 @@ module QA
end end
end end
# rubocop:disable RSpec/InstanceVariable
after do |example| after do |example|
user.remove_via_api! unless example.exception user.remove_via_api! unless example.exception
next unless defined?(@import_time) next unless defined?(@import_time)
...@@ -114,20 +115,23 @@ module QA ...@@ -114,20 +115,23 @@ module QA
save_json( save_json(
"data", "data",
{ {
importer: :github,
import_time: @import_time, import_time: @import_time,
reported_stats: @stats, reported_stats: @stats,
github: { source: {
name: "GitHub",
project_name: github_repo, project_name: github_repo,
branches: gh_branches.length, branches: gh_branches.length,
commits: gh_commits.length, commits: gh_commits.length,
labels: gh_labels.length, labels: gh_labels.length,
milestones: gh_milestones.length, milestones: gh_milestones.length,
prs: gh_prs.length, mrs: gh_prs.length,
pr_comments: gh_prs.sum { |_k, v| v[:comments].length }, mr_comments: gh_prs.sum { |_k, v| v[:comments].length },
issues: gh_issues.length, issues: gh_issues.length,
issue_comments: gh_issues.sum { |_k, v| v[:comments].length } issue_comments: gh_issues.sum { |_k, v| v[:comments].length }
}, },
gitlab: { target: {
name: "GitLab",
project_name: imported_project.path_with_namespace, project_name: imported_project.path_with_namespace,
branches: gl_branches.length, branches: gl_branches.length,
commits: gl_commits.length, commits: gl_commits.length,
...@@ -145,6 +149,7 @@ module QA ...@@ -145,6 +149,7 @@ module QA
} }
) )
end end
# rubocop:enable RSpec/InstanceVariable
it( it(
'imports large Github repo via api', 'imports large Github repo via api',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment