Skip to content

Commit 2ce8d0d

Browse files
committed
ZJIT: Test against bundled gems on CI
1 parent c05ea92 commit 2ce8d0d

3 files changed

Lines changed: 22 additions & 4 deletions

File tree

.github/workflows/zjit-macos.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,6 @@ jobs:
101101
- name: Run configure
102102
run: ../src/configure -C --disable-install-doc ${{ matrix.configure }}
103103

104-
- run: make prepare-gems
105-
if: ${{ matrix.test_task == 'test-bundled-gems' }}
106-
107104
- run: make
108105

109106
- name: Verify that --zjit-dump-disasm works

.github/workflows/zjit-ubuntu.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ jobs:
7272
configure: '--enable-zjit=dev --with-gcc=clang-14'
7373
libclang_path: '/usr/lib/llvm-14/lib/libclang.so.1'
7474

75+
- test_task: 'test-bundled-gems'
76+
configure: '--enable-zjit=dev'
77+
run_opts: '--zjit-call-threshold=1'
78+
7579
env:
7680
GITPULLOPTIONS: --no-tags origin ${{ github.ref }}
7781
RUN_OPTS: ${{ matrix.run_opts }}
@@ -173,8 +177,18 @@ jobs:
173177
ZJIT_BINDGEN_DIFF_OPTS: '--exit-code'
174178
LIBCLANG_PATH: ${{ matrix.libclang_path }}
175179
TESTS: ${{ matrix.test_all_opts }}
180+
if: ${{ matrix.test_task != 'test-bundled-gems' }}
176181
continue-on-error: ${{ matrix.continue-on-test_task || false }}
177182

183+
- name: make test-bundled-gems
184+
run: |
185+
set -x
186+
make -s test-bundled-gems
187+
env:
188+
# This env is specifically added to tool/test-bundled-gems.rb as a way to pass options to Rake tasks
189+
TEST_BUNDLED_GEMS_RUBYOPT: ${{ matrix.run_opts }}
190+
if: ${{ matrix.test_task == 'test-bundled-gems' }}
191+
178192
- name: Dump crash logs
179193
if: ${{ failure() }}
180194
continue-on-error: true

tool/test-bundled-gems.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,14 @@
100100
group = :pgroup
101101
pg = "-"
102102
end
103-
pid = Process.spawn(test_command, group => true)
103+
if rubyopt = ENV["TEST_BUNDLED_GEMS_RUBYOPT"]
104+
env = ENV.to_h
105+
env["RUBYOPT"] = rubyopt
106+
pid = Process.spawn(env, test_command, group => true)
107+
else
108+
pid = Process.spawn(test_command, group => true)
109+
end
110+
104111
timeouts.each do |sig, sec|
105112
if sig
106113
puts "Sending #{sig} signal"

0 commit comments

Comments
 (0)