Skip to content

Commit 51f87f9

Browse files
committed
Do not run the spec for interop methods in GraalVM's CI
* Otherwise it would prevent adding new interop messages.
1 parent 7d902fb commit 51f87f9

File tree

1 file changed

+21
-18
lines changed

1 file changed

+21
-18
lines changed

spec/truffle/interop/methods_spec.rb

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,28 @@
1111
require_relative '../../ruby/spec_helper'
1212

1313
describe "Truffle::Interop" do
14-
it "has a method for each InteropLibrary message" do
15-
all_methods = Primitive.interop_library_all_methods
16-
expected = all_methods.map do |name|
17-
name = name.gsub(/([a-z])([A-Z])/) { "#{$1}_#{$2.downcase}" }
18-
if name.start_with?('is_', 'has_', 'fits_')
19-
name += '?'
20-
end
21-
if name.start_with?('is_')
22-
name = name[3..-1]
23-
elsif name.start_with?('get_')
24-
name = name[4..-1]
25-
end
26-
name.to_sym
27-
end.sort
14+
# Run locally and in TruffleRuby's CI but not in GraalVM's CI to not prevent adding new interop messages
15+
guard -> { !ENV.key?('BUILD_URL') or ENV.key?('TRUFFLERUBY_CI') } do
16+
it "has a method for each InteropLibrary message" do
17+
all_methods = Primitive.interop_library_all_methods
18+
expected = all_methods.map do |name|
19+
name = name.gsub(/([a-z])([A-Z])/) { "#{$1}_#{$2.downcase}" }
20+
if name.start_with?('is_', 'has_', 'fits_')
21+
name += '?'
22+
end
23+
if name.start_with?('is_')
24+
name = name[3..-1]
25+
elsif name.start_with?('get_')
26+
name = name[4..-1]
27+
end
28+
name.to_sym
29+
end.sort
2830

29-
actual = Truffle::Interop.methods.sort
31+
actual = Truffle::Interop.methods.sort
3032

31-
# pp expected
32-
# pp actual
33-
(expected - actual).should == []
33+
# pp expected
34+
# pp actual
35+
(expected - actual).should == []
36+
end
3437
end
3538
end

0 commit comments

Comments
 (0)