Skip to content

Commit e3c0833

Browse files
authored
Stable gemset for integration testing (#1470)
1 parent 352ae0e commit e3c0833

File tree

388 files changed

+64956
-28
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

388 files changed

+64956
-28
lines changed

.circleci/config.yml

+209-2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ test_containers:
2525
description: Resource class to use
2626
type: string
2727
default: medium
28+
edge:
29+
description: Use latest version of dependencies during testing
30+
type: boolean
31+
default: false
2832
- &container_base_environment
2933
BUNDLE_GEMFILE: /app/Gemfile
3034
JRUBY_OPTS: --dev # Faster JVM startup: https://github.com/jruby/jruby/wiki/Improving-startup-time#use-the---dev-flag
@@ -97,8 +101,27 @@ step_appraisal_install: &step_appraisal_install
97101
run:
98102
name: Install Appraisal gems
99103
command: |
100-
bundle exec appraisal clean # Ensure we fetch the latest version of dependencies
101104
bundle exec appraisal install
105+
step_appraisal_update: &step_appraisal_update
106+
run:
107+
name: Update Appraisal gems
108+
command: | # Remove all generated gemfiles and lockfiles, resolve, and install dependencies again
109+
bundle exec appraisal update
110+
ensure_lockfile_committed: &ensure_lockfile_committed
111+
run:
112+
name: Ensure Gem lock files are commited
113+
command: |
114+
CHANGED_FILES=$(git status gemfiles/ --porcelain)
115+
if [[ $CHANGED_FILES ]]
116+
then
117+
>&2 echo "Gem lock files were modified or new lock files were created during"
118+
>&2 echo "'bundle install' and 'bundle appraisal install' installation in CI."
119+
>&2 echo "You need to check in those changes in your branch."
120+
>&2 echo "Affected files:"
121+
>&2 echo $CHANGED_FILES
122+
>&2 GIT_PAGER=cat git diff HEAD
123+
exit 1
124+
fi
102125
step_compute_bundle_checksum: &step_compute_bundle_checksum
103126
run:
104127
name: Compute bundle checksum
@@ -154,7 +177,18 @@ orbs:
154177
keys:
155178
- '{{ .Environment.CIRCLE_CACHE_VERSION }}-bundle-<<parameters.ruby_version>>-{{ checksum ".circleci/bundle_checksum" }}'
156179
- *step_bundle_install
157-
- *step_appraisal_install
180+
- when:
181+
condition:
182+
equal: [ << parameters.edge >>, true ]
183+
steps:
184+
- *step_appraisal_update # Run on latest version of all gems we integrate with
185+
- when:
186+
condition:
187+
not:
188+
equal: [ << parameters.edge >>, true ]
189+
steps:
190+
- *step_appraisal_install # Run on a stable set of gems we integrate with
191+
- *ensure_lockfile_committed
158192
- *step_compute_bundle_checksum
159193
- save_cache:
160194
key: '{{ .Environment.CIRCLE_CACHE_VERSION }}-bundled-repo-<<parameters.ruby_version>>-{{ .Environment.CIRCLE_SHA1 }}'
@@ -685,3 +719,176 @@ workflows:
685719
- test-jruby-9.2.0.0
686720
- test-jruby-9.2-latest
687721
# soon™️ - test-truffleruby-21.0.0
722+
# This workflow runs the same `build` and `test` jobs as above on a schedule.
723+
# Tasks related to housekeeping (e.g. prerelease) are not relevant
724+
# to this daily check, as they are not expected to be impacted here.
725+
edge:
726+
triggers:
727+
- schedule:
728+
cron: "0 0 * * 1-5" # Every weekday
729+
filters:
730+
branches:
731+
only:
732+
- master
733+
jobs:
734+
# Integration
735+
- orb/build_and_test_integration:
736+
name: build_and_test_integration-2.0
737+
integration_apps: 'ruby rack'
738+
ruby_version: '2.0'
739+
<<: *filters_all_branches_and_tags
740+
- orb/build_and_test_integration:
741+
name: build_and_test_integration-2.1
742+
integration_apps: 'ruby rack'
743+
ruby_version: '2.1'
744+
<<: *filters_all_branches_and_tags
745+
- orb/build_and_test_integration:
746+
name: build_and_test_integration-2.2
747+
integration_apps: 'ruby rack'
748+
ruby_version: '2.2'
749+
<<: *filters_all_branches_and_tags
750+
- orb/build_and_test_integration:
751+
name: build_and_test_integration-2.3
752+
integration_apps: 'ruby rack rails-five'
753+
ruby_version: '2.3'
754+
<<: *filters_all_branches_and_tags
755+
- orb/build_and_test_integration:
756+
name: build_and_test_integration-2.4
757+
integration_apps: 'ruby rack rails-five'
758+
ruby_version: '2.4'
759+
<<: *filters_all_branches_and_tags
760+
- orb/build_and_test_integration:
761+
name: build_and_test_integration-2.5
762+
integration_apps: 'ruby rack rails-five'
763+
ruby_version: '2.5'
764+
<<: *filters_all_branches_and_tags
765+
- orb/build_and_test_integration:
766+
name: build_and_test_integration-2.6
767+
integration_apps: 'ruby rack rails-five'
768+
ruby_version: '2.6'
769+
<<: *filters_all_branches_and_tags
770+
- orb/build_and_test_integration:
771+
name: build_and_test_integration-2.7
772+
integration_apps: 'ruby rack rails-five'
773+
ruby_version: '2.7'
774+
<<: *filters_all_branches_and_tags
775+
- orb/build_and_test_integration:
776+
name: build_and_test_integration-3.0
777+
# TODO: Get Rack & Rails apps working with Ruby 3.0
778+
integration_apps: 'ruby'
779+
ruby_version: '3.0'
780+
<<: *filters_all_branches_and_tags
781+
# MRI
782+
- orb/build:
783+
<<: *config-2_0
784+
name: build-2.0
785+
edge: true
786+
- orb/test:
787+
<<: *config-2_0
788+
name: test-2.0
789+
requires:
790+
- build-2.0
791+
- orb/build:
792+
<<: *config-2_1
793+
name: build-2.1
794+
- orb/test:
795+
<<: *config-2_1
796+
name: test-2.1
797+
requires:
798+
- build-2.1
799+
- orb/build:
800+
<<: *config-2_2
801+
name: build-2.2
802+
- orb/test:
803+
<<: *config-2_2
804+
name: test-2.2
805+
requires:
806+
- build-2.2
807+
- orb/build:
808+
<<: *config-2_3
809+
name: build-2.3
810+
- orb/test:
811+
<<: *config-2_3
812+
name: test-2.3
813+
requires:
814+
- build-2.3
815+
- orb/benchmark:
816+
<<: *config-2_3
817+
name: benchmark-2.3
818+
requires:
819+
- build-2.3
820+
- orb/build:
821+
<<: *config-2_4
822+
name: build-2.4
823+
- orb/test:
824+
<<: *config-2_4
825+
name: test-2.4
826+
requires:
827+
- build-2.4
828+
- orb/build:
829+
<<: *config-2_5
830+
name: build-2.5
831+
- orb/test:
832+
<<: *config-2_5
833+
name: test-2.5
834+
requires:
835+
- build-2.5
836+
- orb/build:
837+
<<: *config-2_6
838+
name: build-2.6
839+
- orb/test:
840+
<<: *config-2_6
841+
name: test-2.6
842+
requires:
843+
- build-2.6
844+
- orb/build:
845+
<<: *config-2_7
846+
name: build-2.7
847+
- orb/test:
848+
<<: *config-2_7
849+
name: test-2.7
850+
requires:
851+
- build-2.7
852+
- orb/build:
853+
<<: *config-3_0
854+
name: build-3.0
855+
- orb/test:
856+
<<: *config-3_0
857+
name: test-3.0
858+
requires:
859+
- build-3.0
860+
- orb/build:
861+
<<: *config-3_0-jit
862+
name: build-3.0-jit
863+
- orb/test:
864+
<<: *config-3_0-jit
865+
name: test-3.0-jit
866+
requires:
867+
- build-3.0-jit
868+
# JRuby
869+
- orb/build:
870+
<<: *config-jruby-9_2_0_0
871+
name: build-jruby-9.2.0.0
872+
- orb/test:
873+
<<: *config-jruby-9_2_0_0
874+
name: test-jruby-9.2.0.0
875+
requires:
876+
- build-jruby-9.2.0.0
877+
- orb/build:
878+
<<: *config-jruby-9_2-latest
879+
name: build-jruby-9.2-latest
880+
- orb/test:
881+
<<: *config-jruby-9_2-latest
882+
name: test-jruby-9.2-latest
883+
requires:
884+
- build-jruby-9.2-latest
885+
# TruffleRuby
886+
# soon™️
887+
# - orb/build:
888+
# <<: *config-truffleruby-21_0_0
889+
# name: build-truffleruby-21.0.0
890+
# - orb/test:
891+
# <<: *config-truffleruby-21_0_0
892+
# name: test-truffleruby-21.0.0
893+
# requires:
894+
# - build-truffleruby-21.0.0

.dockerignore

-1
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
gemfiles/*

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ build-iPhoneSimulator/
5555

5656
# lock files
5757
Gemfile.lock
58-
gemfiles/*
5958

6059
# bundle config
6160
gemfiles/.bundle

Appraisals

+10
Original file line numberDiff line numberDiff line change
@@ -1417,3 +1417,13 @@ elsif Gem::Version.new('3.0.0') <= Gem::Version.new(RUBY_VERSION)
14171417
gem 'dogstatsd-ruby', '~> 4'
14181418
end
14191419
end
1420+
1421+
ruby_runtime = if defined?(RUBY_ENGINE_VERSION)
1422+
"#{RUBY_ENGINE}-#{RUBY_ENGINE_VERSION}"
1423+
else
1424+
"#{RUBY_ENGINE}-#{RUBY_VERSION}" # For Ruby < 2.3
1425+
end
1426+
1427+
appraisals.each do |appraisal|
1428+
appraisal.name.prepend("#{ruby_runtime}-")
1429+
end

Rakefile

+8
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,14 @@ def declare(*args)
193193
total_executors = ENV.key?('CIRCLE_NODE_TOTAL') ? ENV['CIRCLE_NODE_TOTAL'].to_i : nil
194194
current_executor = ENV.key?('CIRCLE_NODE_INDEX') ? ENV['CIRCLE_NODE_INDEX'].to_i : nil
195195

196+
ruby_runtime = if defined?(RUBY_ENGINE_VERSION)
197+
"#{RUBY_ENGINE}-#{RUBY_ENGINE_VERSION}"
198+
else
199+
"#{RUBY_ENGINE}-#{RUBY_VERSION}" # For Ruby < 2.3
200+
end
201+
202+
args[0].sub!(/^bundle exec appraisal /, "bundle exec appraisal #{ruby_runtime}-")
203+
196204
if total_executors && current_executor && total_executors > 1
197205
@execution_count ||= 0
198206
@execution_count += 1

docker-compose.yml

-24
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ services:
3030
volumes:
3131
- .:/app
3232
- bundle-2.0:/usr/local/bundle
33-
- gemfiles-2.0:/app/gemfiles
3433
tracer-2.1:
3534
image: palazzem/docker-library:ddtrace_rb_2_1_10
3635
command: /bin/bash
@@ -61,7 +60,6 @@ services:
6160
volumes:
6261
- .:/app
6362
- bundle-2.1:/usr/local/bundle
64-
- gemfiles-2.1:/app/gemfiles
6563
tracer-2.2:
6664
image: palazzem/docker-library:ddtrace_rb_2_2_10
6765
command: /bin/bash
@@ -92,7 +90,6 @@ services:
9290
volumes:
9391
- .:/app
9492
- bundle-2.2:/usr/local/bundle
95-
- gemfiles-2.2:/app/gemfiles
9693
tracer-2.3:
9794
image: palazzem/docker-library:ddtrace_rb_2_3_8
9895
command: /bin/bash
@@ -123,7 +120,6 @@ services:
123120
volumes:
124121
- .:/app
125122
- bundle-2.3:/usr/local/bundle
126-
- gemfiles-2.3:/app/gemfiles
127123
tracer-2.4:
128124
image: palazzem/docker-library:ddtrace_rb_2_4_6
129125
command: /bin/bash
@@ -154,7 +150,6 @@ services:
154150
volumes:
155151
- .:/app
156152
- bundle-2.4:/usr/local/bundle
157-
- gemfiles-2.4:/app/gemfiles
158153
tracer-2.5:
159154
image: marcotc/docker-library:ddtrace_rb_2_5_6
160155
command: /bin/bash
@@ -185,7 +180,6 @@ services:
185180
volumes:
186181
- .:/app
187182
- bundle-2.5:/usr/local/bundle
188-
- gemfiles-2.5:/app/gemfiles
189183
tracer-2.6:
190184
image: marcotc/docker-library:ddtrace_rb_2_6_4
191185
command: /bin/bash
@@ -216,7 +210,6 @@ services:
216210
volumes:
217211
- .:/app
218212
- bundle-2.6:/usr/local/bundle
219-
- gemfiles-2.6:/app/gemfiles
220213
tracer-2.7:
221214
image: marcotc/docker-library:ddtrace_rb_2_7_0
222215
command: /bin/bash
@@ -247,7 +240,6 @@ services:
247240
volumes:
248241
- .:/app
249242
- bundle-2.7:/usr/local/bundle
250-
- gemfiles-2.7:/app/gemfiles
251243
tracer-3.0:
252244
image: marcotc/docker-library:ddtrace_rb_3.0.0
253245
command: /bin/bash
@@ -275,7 +267,6 @@ services:
275267
volumes:
276268
- .:/app
277269
- bundle-3.0:/usr/local/bundle
278-
- gemfiles-3.0:/app/gemfiles
279270
# JRuby
280271
tracer-jruby-9.2.0.0:
281272
image: marcotc/docker-library:ddtrace_rb_jruby_9_2_0_0
@@ -307,7 +298,6 @@ services:
307298
volumes:
308299
- .:/app
309300
- bundle-jruby-9.2.0.0:/usr/local/bundle
310-
- gemfiles-jruby-9.2.0.0:/app/gemfiles
311301
tracer-jruby-9.2-latest:
312302
image: marcotc/docker-library:ddtrace_rb_jruby_9_2_11_1
313303
command: /bin/bash
@@ -338,7 +328,6 @@ services:
338328
volumes:
339329
- .:/app
340330
- bundle-jruby-9.2-latest:/usr/local/bundle
341-
- gemfiles-jruby-9.2-latest:/app/gemfiles
342331
# TruffleRuby
343332
tracer-truffleruby-21.0.0:
344333
image: ivoanjo/docker-library:ddtrace_rb_truffleruby_21_0_0
@@ -370,7 +359,6 @@ services:
370359
volumes:
371360
- .:/app
372361
- bundle-truffleruby-21.0.0:/usr/local/bundle
373-
- gemfiles-truffleruby-21.0.0:/app/gemfiles
374362
ddagent:
375363
image: datadog/agent
376364
environment:
@@ -454,15 +442,3 @@ volumes:
454442
bundle-jruby-9.2.0.0:
455443
bundle-jruby-9.2-latest:
456444
bundle-truffleruby-21.0.0:
457-
gemfiles-2.0:
458-
gemfiles-2.1:
459-
gemfiles-2.2:
460-
gemfiles-2.3:
461-
gemfiles-2.4:
462-
gemfiles-2.5:
463-
gemfiles-2.6:
464-
gemfiles-2.7:
465-
gemfiles-3.0:
466-
gemfiles-jruby-9.2.0.0:
467-
gemfiles-jruby-9.2-latest:
468-
gemfiles-truffleruby-21.0.0:

0 commit comments

Comments
 (0)