knapsack_pro 3.8.0 → 7.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +377 -23
- data/.github/dependabot.yml +11 -0
- data/.github/pull_request_template.md +22 -0
- data/.gitignore +4 -0
- data/CHANGELOG.md +325 -1
- data/Gemfile +9 -0
- data/README.md +3 -10
- data/bin/test +15 -0
- data/knapsack_pro.gemspec +7 -6
- data/lib/knapsack_pro/adapters/base_adapter.rb +17 -2
- data/lib/knapsack_pro/adapters/cucumber_adapter.rb +3 -3
- data/lib/knapsack_pro/adapters/minitest_adapter.rb +2 -0
- data/lib/knapsack_pro/adapters/rspec_adapter.rb +88 -49
- data/lib/knapsack_pro/adapters/spinach_adapter.rb +2 -0
- data/lib/knapsack_pro/adapters/test_unit_adapter.rb +2 -0
- data/lib/knapsack_pro/allocator.rb +2 -0
- data/lib/knapsack_pro/allocator_builder.rb +2 -0
- data/lib/knapsack_pro/base_allocator_builder.rb +8 -25
- data/lib/knapsack_pro/build_distribution_fetcher.rb +2 -0
- data/lib/knapsack_pro/client/api/action.rb +2 -0
- data/lib/knapsack_pro/client/api/v1/base.rb +2 -0
- data/lib/knapsack_pro/client/api/v1/build_distributions.rb +5 -0
- data/lib/knapsack_pro/client/api/v1/build_subsets.rb +2 -0
- data/lib/knapsack_pro/client/api/v1/queues.rb +6 -1
- data/lib/knapsack_pro/client/connection.rb +5 -6
- data/lib/knapsack_pro/config/ci/app_veyor.rb +18 -0
- data/lib/knapsack_pro/config/ci/base.rb +27 -0
- data/lib/knapsack_pro/config/ci/buildkite.rb +18 -0
- data/lib/knapsack_pro/config/ci/circle.rb +18 -0
- data/lib/knapsack_pro/config/ci/cirrus_ci.rb +18 -0
- data/lib/knapsack_pro/config/ci/codefresh.rb +18 -0
- data/lib/knapsack_pro/config/ci/codeship.rb +18 -0
- data/lib/knapsack_pro/config/ci/github_actions.rb +26 -0
- data/lib/knapsack_pro/config/ci/gitlab_ci.rb +20 -1
- data/lib/knapsack_pro/config/ci/heroku.rb +18 -0
- data/lib/knapsack_pro/config/ci/semaphore.rb +16 -0
- data/lib/knapsack_pro/config/ci/semaphore2.rb +19 -0
- data/lib/knapsack_pro/config/ci/travis.rb +18 -0
- data/lib/knapsack_pro/config/env.rb +46 -22
- data/lib/knapsack_pro/config/env_generator.rb +2 -0
- data/lib/knapsack_pro/config/temp_files.rb +8 -4
- data/lib/knapsack_pro/crypto/branch_encryptor.rb +2 -0
- data/lib/knapsack_pro/crypto/decryptor.rb +2 -0
- data/lib/knapsack_pro/crypto/digestor.rb +2 -0
- data/lib/knapsack_pro/crypto/encryptor.rb +2 -0
- data/lib/knapsack_pro/extensions/rspec_extension.rb +137 -0
- data/lib/knapsack_pro/formatters/rspec_json_formatter.rb +2 -0
- data/lib/knapsack_pro/formatters/time_tracker.rb +152 -0
- data/lib/knapsack_pro/formatters/time_tracker_fetcher.rb +20 -0
- data/lib/knapsack_pro/hooks/queue.rb +2 -0
- data/lib/knapsack_pro/logger_wrapper.rb +2 -0
- data/lib/knapsack_pro/mask_string.rb +9 -0
- data/lib/knapsack_pro/presenter.rb +6 -3
- data/lib/knapsack_pro/pure/queue/rspec_pure.rb +92 -0
- data/lib/knapsack_pro/queue_allocator.rb +2 -0
- data/lib/knapsack_pro/queue_allocator_builder.rb +2 -0
- data/lib/knapsack_pro/railtie.rb +2 -0
- data/lib/knapsack_pro/report.rb +15 -9
- data/lib/knapsack_pro/repository_adapter_initiator.rb +2 -0
- data/lib/knapsack_pro/repository_adapters/base_adapter.rb +2 -0
- data/lib/knapsack_pro/repository_adapters/env_adapter.rb +2 -0
- data/lib/knapsack_pro/repository_adapters/git_adapter.rb +50 -0
- data/lib/knapsack_pro/runners/base_runner.rb +2 -0
- data/lib/knapsack_pro/runners/cucumber_runner.rb +2 -0
- data/lib/knapsack_pro/runners/minitest_runner.rb +2 -0
- data/lib/knapsack_pro/runners/queue/base_runner.rb +29 -0
- data/lib/knapsack_pro/runners/queue/cucumber_runner.rb +9 -6
- data/lib/knapsack_pro/runners/queue/minitest_runner.rb +13 -6
- data/lib/knapsack_pro/runners/queue/rspec_runner.rb +128 -135
- data/lib/knapsack_pro/runners/rspec_runner.rb +22 -3
- data/lib/knapsack_pro/runners/spinach_runner.rb +2 -0
- data/lib/knapsack_pro/runners/test_unit_runner.rb +2 -0
- data/lib/knapsack_pro/slow_test_file_determiner.rb +2 -0
- data/lib/knapsack_pro/slow_test_file_finder.rb +2 -0
- data/lib/knapsack_pro/task_loader.rb +2 -0
- data/lib/knapsack_pro/test_case_detectors/rspec_test_example_detector.rb +2 -0
- data/lib/knapsack_pro/test_case_mergers/base_merger.rb +2 -0
- data/lib/knapsack_pro/test_case_mergers/rspec_merger.rb +2 -0
- data/lib/knapsack_pro/test_file_cleaner.rb +2 -0
- data/lib/knapsack_pro/test_file_finder.rb +2 -0
- data/lib/knapsack_pro/test_file_pattern.rb +2 -0
- data/lib/knapsack_pro/test_file_presenter.rb +2 -0
- data/lib/knapsack_pro/test_files_with_test_cases_composer.rb +2 -0
- data/lib/knapsack_pro/test_flat_distributor.rb +2 -0
- data/lib/knapsack_pro/tracker.rb +3 -3
- data/lib/knapsack_pro/urls.rb +4 -0
- data/lib/knapsack_pro/utils.rb +2 -0
- data/lib/knapsack_pro/version.rb +3 -1
- data/lib/knapsack_pro.rb +5 -3
- data/lib/tasks/cucumber.rake +2 -0
- data/lib/tasks/encrypted_branch_names.rake +2 -0
- data/lib/tasks/encrypted_test_file_names.rake +2 -0
- data/lib/tasks/minitest.rake +2 -0
- data/lib/tasks/queue/cucumber.rake +13 -0
- data/lib/tasks/queue/minitest.rake +13 -0
- data/lib/tasks/queue/rspec.rake +13 -0
- data/lib/tasks/rspec.rake +5 -0
- data/lib/tasks/salt.rake +2 -0
- data/lib/tasks/spinach.rake +2 -0
- data/lib/tasks/test_unit.rake +2 -0
- data/spec/integration/api/build_distributions_subset_spec.rb +1 -0
- data/spec/integration/runners/queue/rspec_runner.rb +80 -0
- data/spec/integration/runners/queue/rspec_runner_spec.rb +2232 -0
- data/spec/knapsack_pro/adapters/base_adapter_spec.rb +30 -11
- data/spec/knapsack_pro/adapters/cucumber_adapter_spec.rb +2 -5
- data/spec/knapsack_pro/adapters/rspec_adapter_spec.rb +146 -174
- data/spec/knapsack_pro/base_allocator_builder_spec.rb +22 -48
- data/spec/knapsack_pro/client/api/v1/build_distributions_spec.rb +19 -27
- data/spec/knapsack_pro/client/api/v1/queues_spec.rb +23 -43
- data/spec/knapsack_pro/client/connection_spec.rb +59 -7
- data/spec/knapsack_pro/config/ci/app_veyor_spec.rb +22 -8
- data/spec/knapsack_pro/config/ci/base_spec.rb +1 -0
- data/spec/knapsack_pro/config/ci/buildkite_spec.rb +51 -16
- data/spec/knapsack_pro/config/ci/circle_spec.rb +48 -13
- data/spec/knapsack_pro/config/ci/cirrus_ci_spec.rb +12 -12
- data/spec/knapsack_pro/config/ci/codefresh_spec.rb +21 -6
- data/spec/knapsack_pro/config/ci/codeship_spec.rb +20 -6
- data/spec/knapsack_pro/config/ci/github_actions_spec.rb +37 -10
- data/spec/knapsack_pro/config/ci/gitlab_ci_spec.rb +48 -13
- data/spec/knapsack_pro/config/ci/heroku_spec.rb +12 -12
- data/spec/knapsack_pro/config/ci/semaphore2_spec.rb +11 -11
- data/spec/knapsack_pro/config/ci/semaphore_spec.rb +12 -12
- data/spec/knapsack_pro/config/ci/travis_spec.rb +8 -8
- data/spec/knapsack_pro/config/env_spec.rb +204 -124
- data/spec/knapsack_pro/formatters/time_tracker_specs.rb +424 -0
- data/spec/knapsack_pro/hooks/queue_spec.rb +2 -2
- data/spec/knapsack_pro/presenter_spec.rb +1 -1
- data/spec/knapsack_pro/pure/queue/rspec_pure_spec.rb +224 -0
- data/spec/knapsack_pro/repository_adapters/git_adapter_spec.rb +72 -0
- data/spec/knapsack_pro/runners/queue/cucumber_runner_spec.rb +18 -16
- data/spec/knapsack_pro/runners/queue/minitest_runner_spec.rb +17 -14
- data/spec/knapsack_pro/runners/rspec_runner_spec.rb +40 -23
- data/spec/knapsack_pro/test_case_detectors/rspec_test_example_detector_spec.rb +1 -0
- data/spec/knapsack_pro/tracker_spec.rb +0 -4
- data/spec/knapsack_pro_spec.rb +3 -3
- data/spec/spec_helper.rb +0 -1
- metadata +26 -23
- data/lib/knapsack_pro/config/ci/snap_ci.rb +0 -35
- data/lib/knapsack_pro/config/ci/solano_ci.rb +0 -32
- data/lib/knapsack_pro/extensions/time.rb +0 -7
- data/lib/knapsack_pro/formatters/rspec_queue_profile_formatter_extension.rb +0 -56
- data/lib/knapsack_pro/formatters/rspec_queue_summary_formatter.rb +0 -112
- data/spec/knapsack_pro/config/ci/snap_ci_spec.rb +0 -104
- data/spec/knapsack_pro/config/ci/solano_ci_spec.rb +0 -73
- data/spec/knapsack_pro/extensions/time_spec.rb +0 -5
- data/spec/knapsack_pro/runners/queue/rspec_runner_spec.rb +0 -342
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f27ac674f611af638b9d0ea3dd1d3441a9e680e70296738ff5b93d5d18f9741
|
4
|
+
data.tar.gz: 79bdc380a1c882178b4a3cde626de7e2db1d30ae64ae1a301f023a5ff5d71623
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75bf722c575fce515b8a1a79f7e05ad5ed8ce6f69c05f4ff7cff8fdd570e5eb3e170cbf83765c66b2d1a187a5c076235637188ef9e7bd9d3d703fa37d1bf989c
|
7
|
+
data.tar.gz: 1a355724b69bd0d62b23dd32b6e995dbdd882d0fcb0299d5cddb42c3b4c0635a588839c7194cfb2af83504d91ba4db192a68cc393a8380713450b44971c682bf
|
data/.circleci/config.yml
CHANGED
@@ -1,38 +1,392 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
version: 2.1
|
2
|
+
|
3
|
+
commands:
|
4
|
+
setup_knapsack_pro_ruby:
|
5
|
+
steps:
|
6
|
+
- checkout
|
7
|
+
- restore_cache:
|
8
|
+
keys:
|
9
|
+
- v1-bundler-ruby-{{ checksum "knapsack_pro.gemspec" }}
|
10
|
+
- v1-bundler-ruby-
|
11
|
+
- run:
|
12
|
+
command: |
|
13
|
+
bundle config set --local path './vendor/bundle'
|
14
|
+
bundle install --jobs=4 --retry=3
|
15
|
+
- save_cache:
|
16
|
+
paths:
|
17
|
+
- ./vendor/bundle
|
18
|
+
key: v1-bundler-ruby-{{ checksum "knapsack_pro.gemspec" }}
|
19
|
+
|
20
|
+
setup_rails_app_with_knapsack_pro:
|
21
|
+
parameters:
|
22
|
+
path:
|
23
|
+
type: string
|
24
|
+
ruby:
|
25
|
+
type: string
|
26
|
+
rspec:
|
27
|
+
type: string
|
28
|
+
default: ""
|
29
|
+
steps:
|
30
|
+
- run:
|
31
|
+
working_directory: << parameters.path >>
|
32
|
+
command: |
|
33
|
+
git clone --depth 1 --branch $CIRCLE_BRANCH --single-branch git@github.com:KnapsackPro/rails-app-with-knapsack_pro.git ./ || git clone --depth 1 git@github.com:KnapsackPro/rails-app-with-knapsack_pro.git ./
|
34
|
+
if [[ "<< parameters.rspec >>" != "" ]]; then
|
35
|
+
sed -i 's/.*gem.*rspec-core.*/gem "rspec-core", "<< parameters.rspec >>"/g' ./Gemfile
|
36
|
+
echo "Updated RSpec version in Gemfile"
|
37
|
+
fi
|
38
|
+
- restore_cache:
|
39
|
+
keys:
|
40
|
+
- v1-bundler-rails-{{ checksum "Gemfile.lock" }}-ruby-<< parameters.ruby >>-rspec-<< parameters.rspec >>
|
41
|
+
- v1-bundler-rails-{{ checksum "Gemfile.lock" }}-ruby-<< parameters.ruby >>-
|
42
|
+
- v1-bundler-rails-{{ checksum "Gemfile.lock" }}-
|
43
|
+
- v1-bundler-rails-
|
44
|
+
- run:
|
45
|
+
working_directory: << parameters.path >>
|
46
|
+
command: |
|
47
|
+
bundle config set --local path './vendor/bundle'
|
48
|
+
bundle install --jobs=4 --retry=3
|
49
|
+
- save_cache:
|
50
|
+
paths:
|
51
|
+
- << parameters.path >>/vendor/bundle
|
52
|
+
key: v1-bundler-rails-{{ checksum "Gemfile.lock" }}-ruby-<< parameters.ruby >>-rspec-<< parameters.rspec >>
|
53
|
+
|
6
54
|
jobs:
|
7
|
-
|
55
|
+
unit:
|
8
56
|
parallelism: 1
|
57
|
+
working_directory: ~/knapsack_pro-ruby
|
58
|
+
resource_class: small
|
9
59
|
docker:
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
60
|
+
- image: cimg/ruby:3.3
|
61
|
+
steps:
|
62
|
+
- setup_knapsack_pro_ruby
|
63
|
+
- run: gem install rubocop
|
64
|
+
- run: rubocop --fail-level A --only Style/FrozenStringLiteralComment,Layout/EmptyLineAfterMagicComment lib/
|
65
|
+
- run: bundle exec rspec spec
|
66
|
+
- run: bundle exec ruby spec/knapsack_pro/formatters/time_tracker_specs.rb
|
14
67
|
|
68
|
+
integration-rspec:
|
69
|
+
parallelism: 1
|
15
70
|
working_directory: ~/knapsack_pro-ruby
|
16
|
-
|
71
|
+
resource_class: small
|
72
|
+
parameters:
|
73
|
+
ruby:
|
74
|
+
type: string
|
75
|
+
rspec:
|
76
|
+
type: string
|
77
|
+
docker:
|
78
|
+
- image: cimg/ruby:<< parameters.ruby >>
|
17
79
|
steps:
|
18
80
|
- checkout
|
19
|
-
|
20
|
-
|
81
|
+
- run:
|
82
|
+
command: |
|
83
|
+
if [[ "<< parameters.rspec >>" != "" ]]; then
|
84
|
+
sed -i 's/.*gem.*rspec-core.*/gem "rspec-core", "<< parameters.rspec >>"/g' ./Gemfile
|
85
|
+
echo "Updated RSpec version in Gemfile"
|
86
|
+
fi
|
21
87
|
- restore_cache:
|
22
88
|
keys:
|
23
|
-
-
|
24
|
-
|
25
|
-
-
|
26
|
-
|
89
|
+
- v1-bundler-gem-{{ checksum "knapsack_pro.gemspec" }}-ruby-<< parameters.ruby >>-rspec-<< parameters.rspec >>
|
90
|
+
- v1-bundler-gem-{{ checksum "knapsack_pro.gemspec" }}-ruby-<< parameters.ruby >>-
|
91
|
+
- v1-bundler-gem-{{ checksum "knapsack_pro.gemspec" }}-
|
92
|
+
- v1-bundler-gem-
|
27
93
|
- run:
|
28
|
-
name: install ruby dependencies
|
29
94
|
command: |
|
30
|
-
bundle
|
31
|
-
|
95
|
+
bundle config set --local path './vendor/bundle'
|
96
|
+
bundle install --jobs=4 --retry=3
|
32
97
|
- save_cache:
|
33
98
|
paths:
|
34
99
|
- ./vendor/bundle
|
35
|
-
key:
|
100
|
+
key: v1-bundler-gem-{{ checksum "knapsack_pro.gemspec" }}-ruby-<< parameters.ruby >>-rspec-<< parameters.rspec >>
|
101
|
+
- run:
|
102
|
+
command: |
|
103
|
+
ruby --version
|
104
|
+
bundle exec rspec --version
|
105
|
+
RSPEC=$(bundle exec rspec --version | grep rspec-core | head -n1 | cut -d " " -f5)
|
106
|
+
[ $RSPEC != << parameters.rspec >> ] && exit 1 || echo "Correct version of RSpec installed: $RSPEC"
|
107
|
+
- run: bundle exec rspec spec/integration/runners/queue/rspec_runner_spec.rb
|
36
108
|
|
37
|
-
|
38
|
-
|
109
|
+
e2e-regular-rspec:
|
110
|
+
parallelism: 2
|
111
|
+
working_directory: ~/knapsack_pro-ruby
|
112
|
+
resource_class: small
|
113
|
+
parameters:
|
114
|
+
ruby:
|
115
|
+
type: string
|
116
|
+
rspec:
|
117
|
+
type: string
|
118
|
+
docker:
|
119
|
+
- image: cimg/ruby:<< parameters.ruby >>-browsers
|
120
|
+
environment:
|
121
|
+
PGHOST: 127.0.0.1
|
122
|
+
PGUSER: rails-app-with-knapsack_pro
|
123
|
+
RAILS_ENV: test
|
124
|
+
RACK_ENV: test
|
125
|
+
KNAPSACK_PRO_ENDPOINT: https://api-staging.knapsackpro.com
|
126
|
+
KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC: $KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC
|
127
|
+
EXTRA_TEST_FILES_DELAY: 10
|
128
|
+
- image: cimg/postgres:14.7
|
129
|
+
environment:
|
130
|
+
POSTGRES_DB: rails-app-with-knapsack_pro_test
|
131
|
+
POSTGRES_PASSWORD: password
|
132
|
+
POSTGRES_USER: rails-app-with-knapsack_pro
|
133
|
+
steps:
|
134
|
+
- setup_knapsack_pro_ruby
|
135
|
+
- setup_rails_app_with_knapsack_pro:
|
136
|
+
path: ~/rails-app-with-knapsack_pro
|
137
|
+
ruby: << parameters.ruby >>
|
138
|
+
rspec: << parameters.rspec >>
|
139
|
+
- run: dockerize -wait tcp://localhost:5432 -timeout 1m
|
140
|
+
- run:
|
141
|
+
working_directory: ~/rails-app-with-knapsack_pro
|
142
|
+
command: |
|
143
|
+
ruby --version
|
144
|
+
bundle exec rspec --version
|
145
|
+
RSPEC=$(bundle exec rspec --version | grep rspec-core | head -n1 | cut -d " " -f5)
|
146
|
+
[ $RSPEC != << parameters.rspec >> ] && exit 1 || echo "Correct version of RSpec installed: $RSPEC"
|
147
|
+
- run:
|
148
|
+
working_directory: ~/rails-app-with-knapsack_pro
|
149
|
+
command: bin/rails db:setup
|
150
|
+
- run:
|
151
|
+
working_directory: ~/rails-app-with-knapsack_pro
|
152
|
+
command: |
|
153
|
+
export KNAPSACK_PRO_BRANCH="$CIRCLE_BRANCH--$CIRCLE_BUILD_NUM--regular"
|
154
|
+
bundle exec rake knapsack_pro:rspec
|
155
|
+
- run:
|
156
|
+
working_directory: ~/rails-app-with-knapsack_pro
|
157
|
+
command: |
|
158
|
+
# fallback ||
|
159
|
+
export KNAPSACK_PRO_ENDPOINT=https://api-fake.knapsackpro.com
|
160
|
+
export KNAPSACK_PRO_MAX_REQUEST_RETRIES=1
|
161
|
+
bundle exec rake knapsack_pro:rspec
|
162
|
+
- run:
|
163
|
+
working_directory: ~/rails-app-with-knapsack_pro
|
164
|
+
command: |
|
165
|
+
# split by test examples ||
|
166
|
+
export KNAPSACK_PRO_BRANCH="$CIRCLE_BRANCH--$CIRCLE_BUILD_NUM--regular--split"
|
167
|
+
export KNAPSACK_PRO_RSPEC_SPLIT_BY_TEST_EXAMPLES=true
|
168
|
+
bundle exec rake knapsack_pro:rspec
|
169
|
+
- run:
|
170
|
+
working_directory: ~/rails-app-with-knapsack_pro
|
171
|
+
command: |
|
172
|
+
# split custom files by test examples ||
|
173
|
+
export KNAPSACK_PRO_BRANCH="$CIRCLE_BRANCH--$CIRCLE_BUILD_NUM--regular--split-custom-files"
|
174
|
+
export KNAPSACK_PRO_RSPEC_SPLIT_BY_TEST_EXAMPLES=true
|
175
|
+
export KNAPSACK_PRO_SLOW_TEST_FILE_PATTERN="spec/features/calculator_spec.rb"
|
176
|
+
bundle exec rake knapsack_pro:rspec
|
177
|
+
|
178
|
+
e2e-queue-rspec:
|
179
|
+
parameters:
|
180
|
+
ruby:
|
181
|
+
type: string
|
182
|
+
rspec:
|
183
|
+
type: string
|
184
|
+
parallelism: 2
|
185
|
+
working_directory: ~/knapsack_pro-ruby
|
186
|
+
resource_class: small
|
187
|
+
docker:
|
188
|
+
- image: cimg/ruby:<< parameters.ruby >>-browsers
|
189
|
+
environment:
|
190
|
+
PGHOST: 127.0.0.1
|
191
|
+
PGUSER: rails-app-with-knapsack_pro
|
192
|
+
RAILS_ENV: test
|
193
|
+
RACK_ENV: test
|
194
|
+
KNAPSACK_PRO_ENDPOINT: https://api-staging.knapsackpro.com
|
195
|
+
KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC: $KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC
|
196
|
+
EXTRA_TEST_FILES_DELAY: 10
|
197
|
+
- image: cimg/postgres:14.7
|
198
|
+
environment:
|
199
|
+
POSTGRES_DB: rails-app-with-knapsack_pro_test
|
200
|
+
POSTGRES_PASSWORD: password
|
201
|
+
POSTGRES_USER: rails-app-with-knapsack_pro
|
202
|
+
steps:
|
203
|
+
- setup_knapsack_pro_ruby
|
204
|
+
- setup_rails_app_with_knapsack_pro:
|
205
|
+
path: ~/rails-app-with-knapsack_pro
|
206
|
+
ruby: << parameters.ruby >>
|
207
|
+
rspec: << parameters.rspec >>
|
208
|
+
- run: dockerize -wait tcp://localhost:5432 -timeout 1m
|
209
|
+
- run:
|
210
|
+
working_directory: ~/rails-app-with-knapsack_pro
|
211
|
+
command: |
|
212
|
+
ruby --version
|
213
|
+
bundle exec rspec --version
|
214
|
+
RSPEC=$(bundle exec rspec --version | grep rspec-core | head -n1 | cut -d " " -f5)
|
215
|
+
[ $RSPEC != << parameters.rspec >> ] && exit 1 || echo "Correct version of RSpec installed: $RSPEC"
|
216
|
+
- run:
|
217
|
+
working_directory: ~/rails-app-with-knapsack_pro
|
218
|
+
command: bin/rails db:setup
|
219
|
+
- run:
|
220
|
+
working_directory: ~/rails-app-with-knapsack_pro
|
221
|
+
command: |
|
222
|
+
export KNAPSACK_PRO_BRANCH="$CIRCLE_BRANCH--$CIRCLE_BUILD_NUM--queue"
|
223
|
+
bundle exec rake knapsack_pro:queue:rspec
|
224
|
+
- run:
|
225
|
+
working_directory: ~/rails-app-with-knapsack_pro
|
226
|
+
command: |
|
227
|
+
# run 0 tests as queue is consumed ||
|
228
|
+
export KNAPSACK_PRO_BRANCH="$CIRCLE_BRANCH--$CIRCLE_BUILD_NUM--queue"
|
229
|
+
export KNAPSACK_PRO_FIXED_QUEUE_SPLIT=false
|
230
|
+
bundle exec rake knapsack_pro:queue:rspec
|
231
|
+
- run:
|
232
|
+
working_directory: ~/rails-app-with-knapsack_pro
|
233
|
+
command: |
|
234
|
+
# retry the same split ||
|
235
|
+
export KNAPSACK_PRO_BRANCH="$CIRCLE_BRANCH--$CIRCLE_BUILD_NUM--queue"
|
236
|
+
export KNAPSACK_PRO_FIXED_QUEUE_SPLIT=true
|
237
|
+
bundle exec rake knapsack_pro:queue:rspec
|
238
|
+
- run:
|
239
|
+
working_directory: ~/rails-app-with-knapsack_pro
|
240
|
+
command: |
|
241
|
+
# fallback ||
|
242
|
+
export KNAPSACK_PRO_ENDPOINT=https://api-fake.knapsackpro.com
|
243
|
+
export KNAPSACK_PRO_MAX_REQUEST_RETRIES=1
|
244
|
+
bundle exec rake knapsack_pro:queue:rspec
|
245
|
+
- run:
|
246
|
+
working_directory: ~/rails-app-with-knapsack_pro
|
247
|
+
command: |
|
248
|
+
# split by test examples ||
|
249
|
+
export KNAPSACK_PRO_BRANCH="$CIRCLE_BRANCH--$CIRCLE_BUILD_NUM--queue--split"
|
250
|
+
export KNAPSACK_PRO_FIXED_QUEUE_SPLIT=true
|
251
|
+
export KNAPSACK_PRO_RSPEC_SPLIT_BY_TEST_EXAMPLES=true
|
252
|
+
bundle exec rake knapsack_pro:queue:rspec
|
253
|
+
- run:
|
254
|
+
working_directory: ~/rails-app-with-knapsack_pro
|
255
|
+
command: |
|
256
|
+
# turnip ||
|
257
|
+
export KNAPSACK_PRO_BRANCH="$CIRCLE_BRANCH--$CIRCLE_BUILD_NUM--queue--turnip"
|
258
|
+
export KNAPSACK_PRO_FIXED_QUEUE_SPLIT=true
|
259
|
+
export KNAPSACK_PRO_TEST_DIR=turnip
|
260
|
+
export KNAPSACK_PRO_TEST_FILE_PATTERN="turnip/**/*.feature"
|
261
|
+
bundle exec rake "knapsack_pro:queue:rspec[-r turnip/rspec]"
|
262
|
+
- run:
|
263
|
+
working_directory: ~/rails-app-with-knapsack_pro
|
264
|
+
command: |
|
265
|
+
# turnip retry ||
|
266
|
+
export KNAPSACK_PRO_BRANCH="$CIRCLE_BRANCH--$CIRCLE_BUILD_NUM--queue--turnip"
|
267
|
+
export KNAPSACK_PRO_FIXED_QUEUE_SPLIT=true
|
268
|
+
export KNAPSACK_PRO_TEST_DIR=turnip
|
269
|
+
export KNAPSACK_PRO_TEST_FILE_PATTERN="turnip/**/*.feature"
|
270
|
+
bundle exec rake "knapsack_pro:queue:rspec[-r turnip/rspec]"
|
271
|
+
|
272
|
+
e2e-regular-minitest:
|
273
|
+
parallelism: 2
|
274
|
+
working_directory: ~/knapsack_pro-ruby
|
275
|
+
resource_class: small
|
276
|
+
parameters:
|
277
|
+
ruby:
|
278
|
+
type: string
|
279
|
+
docker:
|
280
|
+
- image: cimg/ruby:<< parameters.ruby >>-browsers
|
281
|
+
environment:
|
282
|
+
PGHOST: 127.0.0.1
|
283
|
+
PGUSER: rails-app-with-knapsack_pro
|
284
|
+
RAILS_ENV: test
|
285
|
+
RACK_ENV: test
|
286
|
+
KNAPSACK_PRO_ENDPOINT: https://api-staging.knapsackpro.com
|
287
|
+
KNAPSACK_PRO_TEST_SUITE_TOKEN_MINITEST: $KNAPSACK_PRO_TEST_SUITE_TOKEN_MINITEST
|
288
|
+
EXTRA_TEST_FILES_DELAY: 10
|
289
|
+
- image: cimg/postgres:14.7
|
290
|
+
environment:
|
291
|
+
POSTGRES_DB: rails-app-with-knapsack_pro_test
|
292
|
+
POSTGRES_PASSWORD: password
|
293
|
+
POSTGRES_USER: rails-app-with-knapsack_pro
|
294
|
+
steps:
|
295
|
+
- setup_knapsack_pro_ruby
|
296
|
+
- setup_rails_app_with_knapsack_pro:
|
297
|
+
path: ~/rails-app-with-knapsack_pro
|
298
|
+
ruby: << parameters.ruby >>
|
299
|
+
- run: dockerize -wait tcp://localhost:5432 -timeout 1m
|
300
|
+
- run:
|
301
|
+
working_directory: ~/rails-app-with-knapsack_pro
|
302
|
+
command: ruby --version
|
303
|
+
- run:
|
304
|
+
working_directory: ~/rails-app-with-knapsack_pro
|
305
|
+
command: bin/rails db:setup
|
306
|
+
- run:
|
307
|
+
working_directory: ~/rails-app-with-knapsack_pro
|
308
|
+
command: |
|
309
|
+
export KNAPSACK_PRO_BRANCH="$CIRCLE_BRANCH--$CIRCLE_BUILD_NUM--regular"
|
310
|
+
bundle exec rake knapsack_pro:minitest[--verbose]
|
311
|
+
|
312
|
+
e2e-queue-minitest:
|
313
|
+
parameters:
|
314
|
+
ruby:
|
315
|
+
type: string
|
316
|
+
parallelism: 2
|
317
|
+
working_directory: ~/knapsack_pro-ruby
|
318
|
+
resource_class: small
|
319
|
+
docker:
|
320
|
+
- image: cimg/ruby:<< parameters.ruby >>-browsers
|
321
|
+
environment:
|
322
|
+
PGHOST: 127.0.0.1
|
323
|
+
PGUSER: rails-app-with-knapsack_pro
|
324
|
+
RAILS_ENV: test
|
325
|
+
RACK_ENV: test
|
326
|
+
KNAPSACK_PRO_ENDPOINT: https://api-staging.knapsackpro.com
|
327
|
+
KNAPSACK_PRO_TEST_SUITE_TOKEN_MINITEST: $KNAPSACK_PRO_TEST_SUITE_TOKEN_MINITEST
|
328
|
+
EXTRA_TEST_FILES_DELAY: 10
|
329
|
+
- image: cimg/postgres:14.7
|
330
|
+
environment:
|
331
|
+
POSTGRES_DB: rails-app-with-knapsack_pro_test
|
332
|
+
POSTGRES_PASSWORD: password
|
333
|
+
POSTGRES_USER: rails-app-with-knapsack_pro
|
334
|
+
steps:
|
335
|
+
- setup_knapsack_pro_ruby
|
336
|
+
- setup_rails_app_with_knapsack_pro:
|
337
|
+
path: ~/rails-app-with-knapsack_pro
|
338
|
+
ruby: << parameters.ruby >>
|
339
|
+
- run: dockerize -wait tcp://localhost:5432 -timeout 1m
|
340
|
+
- run:
|
341
|
+
working_directory: ~/rails-app-with-knapsack_pro
|
342
|
+
command: ruby --version
|
343
|
+
- run:
|
344
|
+
working_directory: ~/rails-app-with-knapsack_pro
|
345
|
+
command: bin/rails db:setup
|
346
|
+
- run:
|
347
|
+
working_directory: ~/rails-app-with-knapsack_pro
|
348
|
+
command: |
|
349
|
+
# minitest ||
|
350
|
+
export KNAPSACK_PRO_BRANCH="$CIRCLE_BRANCH--$CIRCLE_BUILD_NUM--queue--minitest"
|
351
|
+
export KNAPSACK_PRO_FIXED_QUEUE_SPLIT=true
|
352
|
+
bundle exec rake knapsack_pro:queue:minitest[--verbose]
|
353
|
+
- run:
|
354
|
+
working_directory: ~/rails-app-with-knapsack_pro
|
355
|
+
command: |
|
356
|
+
# minitest retry ||
|
357
|
+
export KNAPSACK_PRO_BRANCH="$CIRCLE_BRANCH--$CIRCLE_BUILD_NUM--queue--minitest"
|
358
|
+
export KNAPSACK_PRO_FIXED_QUEUE_SPLIT=true
|
359
|
+
bundle exec rake knapsack_pro:queue:minitest[--verbose]
|
360
|
+
|
361
|
+
workflows:
|
362
|
+
tests:
|
363
|
+
jobs:
|
364
|
+
- unit
|
365
|
+
- integration-rspec:
|
366
|
+
name: integration__ruby-<< matrix.ruby >>__rspec-<< matrix.rspec >>
|
367
|
+
matrix:
|
368
|
+
parameters:
|
369
|
+
ruby: ["3.0", "3.1", "3.2", "3.3"]
|
370
|
+
rspec: ["3.10.2", "3.11.0", "3.12.2"]
|
371
|
+
- e2e-regular-rspec:
|
372
|
+
name: e2e-regular__ruby-<< matrix.ruby >>__rspec-<< matrix.rspec >>
|
373
|
+
matrix:
|
374
|
+
parameters:
|
375
|
+
ruby: ["3.0", "3.1", "3.2", "3.3"]
|
376
|
+
rspec: ["3.10.2", "3.11.0", "3.12.2"]
|
377
|
+
- e2e-queue-rspec:
|
378
|
+
name: e2e-queue__ruby-<< matrix.ruby >>__rspec-<< matrix.rspec >>
|
379
|
+
matrix:
|
380
|
+
parameters:
|
381
|
+
ruby: ["3.0", "3.1", "3.2", "3.3"]
|
382
|
+
rspec: ["3.10.2", "3.11.0", "3.12.2"]
|
383
|
+
- e2e-regular-minitest:
|
384
|
+
name: e2e-regular__ruby-<< matrix.ruby >>__minitest
|
385
|
+
matrix:
|
386
|
+
parameters:
|
387
|
+
ruby: ["3.0", "3.1", "3.2", "3.3"]
|
388
|
+
- e2e-queue-minitest:
|
389
|
+
name: e2e-queue__ruby-<< matrix.ruby >>__minitest
|
390
|
+
matrix:
|
391
|
+
parameters:
|
392
|
+
ruby: ["3.0", "3.1", "3.2", "3.3"]
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# To get started with Dependabot version updates, you'll need to specify which
|
2
|
+
# package ecosystems to update and where the package manifests are located.
|
3
|
+
# Please see the documentation for all configuration options:
|
4
|
+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
5
|
+
|
6
|
+
version: 2
|
7
|
+
updates:
|
8
|
+
- package-ecosystem: "bundler"
|
9
|
+
directory: "/"
|
10
|
+
schedule:
|
11
|
+
interval: "weekly"
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# Story
|
2
|
+
|
3
|
+
TODO: link to the internal story
|
4
|
+
|
5
|
+
## Related
|
6
|
+
|
7
|
+
TODO: links to related PRs or issues
|
8
|
+
|
9
|
+
# Description
|
10
|
+
|
11
|
+
TODO
|
12
|
+
|
13
|
+
# Changes
|
14
|
+
|
15
|
+
TODO: changes introduced by this PR
|
16
|
+
|
17
|
+
# Checklist reminder
|
18
|
+
|
19
|
+
- [ ] You follow the architecture outlined below for RSpec in Queue Mode, which is a work in progress (feel free to propose changes):
|
20
|
+
- Pure: `lib/knapsack_pro/pure/queue/rspec_pure.rb` contains pure functions that are unit tested.
|
21
|
+
- Extension: `lib/knapsack_pro/extensions/rspec_extension.rb` encapsulates calls to RSpec internals and is integration and e2e tested.
|
22
|
+
- Runner: `lib/knapsack_pro/runners/queue/rspec_runner.rb` invokes the pure code and the extension to produce side effects, which are integration and e2e tested.
|