Commit 703b1973 authored by Georges Racinet's avatar Georges Racinet 🦑
Browse files

RSpec tests: parallel launch with Knapsack

Knapsack is the sharding tool also used by upstream GitLab.
To balance the shards, it uses a time table (the report file).
Our main difference with upstream is that we have a checked in
report file instead of maintaining it from the CI in a S3 bucket.

Updates will have to be done manually. There is a companion
`heptapod-rspec-parallel` script in the HDK (for lack of a better
place) that can leverage knapsack to run the tests
across several entire HDK workspaces.

--HG--
branch : heptapod-stable
parent f724d7805e7b
This directory holds knapsack reports.
knapsack is a system for balanced tests sharding.
It relies on pre-generated "report" files that list the
time needed for each test file, in order to achieve balancing.
These files are mandatory, even if one does not care so much
about balancing.
{
"spec/helpers/application_settings_helper_spec.rb": 3.420536,
"spec/helpers/vcs_type_helper_spec.rb": 0.015230,
"spec/lib/gitlab/build_access_spec.rb": 0.735082,
"spec/lib/gitlab/ci_access_spec.rb": 0.003541,
"spec/lib/gitlab/cross_project_access_spec.rb": 0.011619,
"spec/lib/gitlab/git/attributes_at_ref_parser_spec.rb": 0.761250,
"spec/lib/gitlab/git/attributes_parser_spec.rb": 0.038397,
"spec/lib/gitlab/git/base_error_spec.rb": 0.010658,
"spec/lib/gitlab/git/blame_spec.rb": 0.048718,
"spec/lib/gitlab/git/blob_spec.rb": 9.665832,
"spec/lib/gitlab/git/branch_spec.rb": 1.810208,
"spec/lib/gitlab/git/bundle_file_spec.rb": 0.002991,
"spec/lib/gitlab/git/changes_spec.rb": 0.016697,
"spec/lib/gitlab/git/commit_spec.rb": 1.059822,
"spec/lib/gitlab/git/compare_spec.rb": 0.322407,
"spec/lib/gitlab/git/cross_repo_comparer_spec.rb": 3.232121,
"spec/lib/gitlab/git/diff_collection_spec.rb": 0.576913,
"spec/lib/gitlab/git/diff_spec.rb": 0.573924,
"spec/lib/gitlab/git/diff_stats_collection_spec.rb": 0.008139,
"spec/lib/gitlab/git/gitmodules_parser_spec.rb": 0.001580,
"spec/lib/gitlab/git/hook_env_spec.rb": 0.123032,
"spec/lib/gitlab/git/keep_around_spec.rb": 1.182760,
"spec/lib/gitlab/git/lfs_changes_spec.rb": 0.057396,
"spec/lib/gitlab/git/lfs_pointer_file_spec.rb": 0.008269,
"spec/lib/gitlab/git/merge_base_spec.rb": 0.148415,
"spec/lib/gitlab/git/object_pool_spec.rb": 5.694974,
"spec/lib/gitlab/git/pre_receive_error_spec.rb": 0.035186,
"spec/lib/gitlab/git/push_spec.rb": 0.241563,
"spec/lib/gitlab/git/raw_diff_change_spec.rb": 0.008636,
"spec/lib/gitlab/git/remote_mirror_spec.rb": 0.481099,
"spec/lib/gitlab/git/remote_repository_spec.rb": 0.188688,
"spec/lib/gitlab/git/repository_cleaner_spec.rb": 0.373568,
"spec/lib/gitlab/git/repository_spec.rb": 22.324063,
"spec/lib/gitlab/git/tag_spec.rb": 2.704617,
"spec/lib/gitlab/git/tree_spec.rb": 0.494723,
"spec/lib/gitlab/git/user_spec.rb": 0.028075,
"spec/lib/gitlab/git/util_spec.rb": 0.006868,
"spec/lib/gitlab/git/wiki_spec.rb": 7.294624,
"spec/lib/gitlab/git/wraps_gitaly_errors_spec.rb": 0.006764,
"spec/lib/gitlab/git_access_design_spec.rb": 0.014600,
"spec/lib/gitlab/git_access_project_spec.rb": 1.972361,
"spec/lib/gitlab/git_access_snippet_spec.rb": 16.528636,
"spec/lib/gitlab/git_access_spec.rb": 99.720437,
"spec/lib/gitlab/git_access_wiki_spec.rb": 0.390284,
"spec/lib/gitlab/hg_access_main_spec.rb": 153.706134,
"spec/lib/gitlab/hg_access_protected_branches_spec.rb": 291.131276,
"spec/lib/gitlab/mercurial/hg_git_repository_spec.rb": 85.332174,
"spec/lib/gitlab/mercurial/hgitaly_client_spec.rb": 3.881960,
"spec/lib/gitlab/mercurial/hgitaly_repository_spec.rb": 222.594542,
"spec/lib/gitlab/user_access_snippet_spec.rb": 1.558270,
"spec/lib/gitlab/user_access_spec.rb": 19.428001,
"spec/lib/gitlab_spec.rb": 0.109080,
"spec/mailers/emails/pipelines_spec.rb": 3.756551,
"spec/models/ci/job_artifact_spec.rb": 51.806456,
"spec/models/ci/job_variable_spec.rb": 2.216094,
"spec/models/ci/pipeline_artifact_spec.rb": 2.861438,
"spec/models/ci/pipeline_config_spec.rb": 0.014650,
"spec/models/ci/pipeline_message_spec.rb": 0.980447,
"spec/models/ci/pipeline_schedule_spec.rb": 7.407743,
"spec/models/ci/pipeline_schedule_variable_spec.rb": 1.165911,
"spec/models/ci/pipeline_spec.rb": 103.112268,
"spec/models/ci/pipeline_variable_spec.rb": 1.725846,
"spec/models/commit_collection_spec.rb": 5.450583,
"spec/models/commit_range_spec.rb": 4.765426,
"spec/models/commit_status_spec.rb": 9.822903,
"spec/models/commit_with_pipeline_spec.rb": 2.371279,
"spec/models/compare_spec.rb": 3.393206,
"spec/models/merge_request_assignee_spec.rb": 2.425250,
"spec/models/merge_request_context_commit_diff_file_spec.rb": 0.020940,
"spec/models/merge_request_context_commit_spec.rb": 1.020070,
"spec/models/merge_request_diff_commit_spec.rb": 15.875874,
"spec/models/merge_request_diff_file_spec.rb": 14.699201,
"spec/models/merge_request_diff_spec.rb": 92.419155,
"spec/models/merge_request_reviewer_spec.rb": 1.099232,
"spec/models/project_wiki_spec.rb": 16.675641,
"spec/models/user_spec.rb": 113.056185,
"spec/models/wiki_directory_spec.rb": 0.708761,
"spec/models/wiki_page_spec.rb": 44.254186,
"spec/models/wiki_spec.rb": 0.010347,
"spec/services/projects/create_service_spec.rb": 105.052845,
"spec/services/projects/update_remote_mirror_service_spec.rb": 7.628911
}
#!/bin/sh
# this script has to be run from the root of the Rails application
# set these environment variables to something relevant for your run
#export CI_NODE_TOTAL=2
#export CI_NODE_INDEX=0
export KNAPSACK_TEST_FILE_PATTERN="spec/{lib/gitlab,lib/gitlab/mercurial/*,lib/gitlab/*_access*,lib/gitlab/git/*,mailers/emails/pipelines,models/user,models/merge_request_*,models/compare,models/commit_*,models/ci/job_*,models/ci/pipeline*,models/*wiki*,services/projects/update_remote_mirror_service,services/projects/create_service,helpers/application_settings_helper,helpers/vcs_type_helper}_spec.rb"
export KNAPSACK_REPORT_PATH="knapsack/rspec.json"
knapsack rspec "-Ispec --color --format d"
#!/bin/sh
# This script has to be run from the root of the Rails application
# use this to generate the knapsack report (times of individual test files)
#export KNAPSACK_GENERATE_REPORT=true
export KNAPSACK_REPORT_PATH="knapsack/rspec.json"
bin/rspec \
spec/lib/gitlab_spec.rb \
spec/lib/gitlab/mercurial_spec.rb \
......
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