Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add compile task in Development section #80

Merged
merged 1 commit into from
May 29, 2024
Merged

Conversation

genya0407
Copy link
Contributor

@genya0407 genya0407 commented May 22, 2024

When I followed the instructions in the Development section, I found some tests failing with Ruby 3.3.1 and older Rubies:

failure log
$ rake test
Loaded suite /Users/sangenya/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/rake_test_loader
Started
P
===================================================================================================================================================================================================================================================================================================================
Pending: test_gunzip_no_memory_leak(TestZlib): pended.
/Users/sangenya/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/test-unit-ruby-core-1.0.5/lib/core_assertions.rb:192:in `rescue in assert_no_memory_leak'
/Users/sangenya/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/test-unit-ruby-core-1.0.5/lib/core_assertions.rb:150:in `assert_no_memory_leak'
/Users/sangenya/dev/zlib/test/zlib/test_zlib.rb:1528:in `test_gunzip_no_memory_leak'
     1525:     end
     1526: 
     1527:     def test_gunzip_no_memory_leak
  => 1528:       assert_no_memory_leak(%[-rzlib], "#{<<~"{#"}", "#{<<~'};'}")
     1529:       d = Zlib.gzip("data")
     1530:       {#
     1531:         10_000.times {Zlib.gunzip(d)}
===================================================================================================================================================================================================================================================================================================================
E
===================================================================================================================================================================================================================================================================================================================
Error: test_gzfile_read_size_boundary(TestZlibGzipReader): EOFError: end of file reached
/Users/sangenya/dev/zlib/test/zlib/test_zlib.rb:1249:in `readpartial'
/Users/sangenya/dev/zlib/test/zlib/test_zlib.rb:1249:in `block (2 levels) in test_gzfile_read_size_boundary'
     1246:         end
     1247: 
     1248:         Zlib::GzipReader.open(t.path) do |f|
  => 1249:           f.readpartial(1024) until f.eof?
     1250:           assert_raise(EOFError) { f.readpartial(1) }
     1251:         end
     1252: 
/Users/sangenya/dev/zlib/test/zlib/test_zlib.rb:1248:in `open'
/Users/sangenya/dev/zlib/test/zlib/test_zlib.rb:1248:in `block in test_gzfile_read_size_boundary'
/Users/sangenya/.rbenv/versions/3.3.0/lib/ruby/3.3.0/tempfile.rb:447:in `create'
/Users/sangenya/dev/zlib/test/zlib/test_zlib.rb:1237:in `test_gzfile_read_size_boundary'
===================================================================================================================================================================================================================================================================================================================
E
===================================================================================================================================================================================================================================================================================================================
Error: test_read(TestZlibGzipReader): ArgumentError: wrong number of arguments (given 2, expected 0..1)
/Users/sangenya/dev/zlib/test/zlib/test_zlib.rb:1000:in `read'
/Users/sangenya/dev/zlib/test/zlib/test_zlib.rb:1000:in `block (2 levels) in test_read'
      997: 
      998:           assert_raise(ArgumentError) { f.read(-1, s) }
      999: 
  => 1000:           assert_same s, f.read(1, s)
     1001:           assert_equal "\xE3".b, s
     1002: 
     1003:           assert_same s, f.read(2, s)
/Users/sangenya/dev/zlib/test/zlib/test_zlib.rb:995:in `open'
/Users/sangenya/dev/zlib/test/zlib/test_zlib.rb:995:in `block in test_read'
/Users/sangenya/.rbenv/versions/3.3.0/lib/ruby/3.3.0/tempfile.rb:447:in `create'
/Users/sangenya/dev/zlib/test/zlib/test_zlib.rb:985:in `test_read'
===================================================================================================================================================================================================================================================================================================================
Finished in 0.74951 seconds.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
95 tests, 520 assertions, 0 failures, 2 errors, 1 pendings, 0 omissions, 0 notifications
96.8421% passed
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
126.75 tests/s, 693.79 assertions/s
rake aborted!
Command failed with status (1)
/Users/sangenya/dev/zlib/Rakefile:10:in `block in <top (required)>'
Tasks: TOP => test_internal
(See full trace by running task with --trace)

It turned out that this was because I had not executed the rake compile before running rake test.
We should have compile task in the Development section so that new contributors don't stumble.

FYI: CI runs rake compile test.

run: bundle exec rake compile test

@hsbt hsbt merged commit cd378a0 into ruby:master May 29, 2024
1 check passed
@hsbt
Copy link
Member

hsbt commented May 29, 2024

👍

@genya0407 genya0407 deleted the patch-1 branch May 29, 2024 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants