Skip to content

Commit

Permalink
[ruby/rdoc] test/rdoc/test_rdoc_generator_json_index.rb: pend in test…
Browse files Browse the repository at this point in the history
…_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

ruby/rdoc@42cdad1cf2
  • Loading branch information
junaruga authored and matzbot committed Nov 3, 2023
1 parent dcb9ded commit 1f1b9b0
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/rdoc/test_rdoc_generator_json_index.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,18 @@ def test_generate
orig_file = Pathname(File.join srcdir, 'generator/template/json_index/js/navigation.js')
generated_file = Pathname(File.join @tmpdir, 'js/navigation.js')

# The following assertion for the generated file's modified time randomly
# fails in a ppc64le environment.
# https://github.com/ruby/rdoc/issues/1048
if orig_file.mtime.inspect != generated_file.mtime.inspect &&
RUBY_PLATFORM =~ /powerpc64le/
pend <<~EOC
Unstable test in ppc64le.
<#{orig_file.mtime.inspect}> expected but was
<#{generated_file.mtime.inspect}>.
EOC
end

# This is dirty hack on JRuby
assert_equal orig_file.mtime.inspect, generated_file.mtime.inspect,
'.js files should be the same timestamp of original'
Expand Down

0 comments on commit 1f1b9b0

Please sign in to comment.