Skip to content

Commit 42cdad1

Browse files
committed
test/rdoc/test_rdoc_generator_json_index.rb: pend in test_generate in ppc64le.
We observed that this test randomly fails in the ruby/ruby Travis ppc64le case. This commit is to pend the test_generate if the assertion for the generated file's modified time fails in a ppc64le environment. Note that I didn't use the word "Travis CI" or Travis CI specific environment variables such as `TRAVIS` and `TRAVIS_CPU_ARCH`[1] in the code. Because I wanted to prioritize the rdoc's independence from the ruby/ruby. [1] https://docs.travis-ci.com/user/environment-variables/#default-environment-variables
1 parent c9ce452 commit 42cdad1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/rdoc/test_rdoc_generator_json_index.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,18 @@ def test_generate
104104
orig_file = Pathname(File.join srcdir, 'generator/template/json_index/js/navigation.js')
105105
generated_file = Pathname(File.join @tmpdir, 'js/navigation.js')
106106

107+
# The following assertion for the generated file's modified time randomly
108+
# fails in a ppc64le environment.
109+
# https://github.com/ruby/rdoc/issues/1048
110+
if orig_file.mtime.inspect != generated_file.mtime.inspect &&
111+
RUBY_PLATFORM =~ /powerpc64le/
112+
pend <<~EOC
113+
Unstable test in ppc64le.
114+
<#{orig_file.mtime.inspect}> expected but was
115+
<#{generated_file.mtime.inspect}>.
116+
EOC
117+
end
118+
107119
# This is dirty hack on JRuby
108120
assert_equal orig_file.mtime.inspect, generated_file.mtime.inspect,
109121
'.js files should be the same timestamp of original'

0 commit comments

Comments
 (0)