ruby-augeas icon indicating copy to clipboard operation
ruby-augeas copied to clipboard

Run all tests in gemspec

Open ekohl opened this issue 1 year ago • 6 comments

While updating the ruby-augeas spec in Fedora I noticed that a new test was added. This makes sure all the tests run.

ekohl avatar Sep 28 '24 14:09 ekohl

Hi Ewoud,

Thanks for spotting this. There are indeed additional tests which are not included in the spec file.

The existing %check command covers 21 tests:

> ruby tests/tc_augeas.rb 
Loaded suite tests/tc_augeas
Started
Finished in 10.278106927 seconds.
---------------------------------------------------------------------------------------------------------------------------------------------
21 tests, 79 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
---------------------------------------------------------------------------------------------------------------------------------------------
2.04 tests/s, 7.69 assertions/s

There are a further 58 tests in tc_facade.rb

> ruby tests/tc_facade.rb 
Loaded suite tests/tc_facade
Started
Finished in 28.813341245 seconds.
---------------------------------------------------------------------------------------------------------------------------------------------
58 tests, 129 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
---------------------------------------------------------------------------------------------------------------------------------------------
2.01 tests/s, 4.48 assertions/s

But the command ruby tests/tc_*.rb does not run any more tests than the existing ruby tests/tc_augeas.rb

Can I suggest we make the %check section run rake test instead, as this seems to include all the required *.rb files

> rake test
Loaded suite /usr/share/gems/gems/rake-13.0.6/lib/rake/rake_test_loader
Started
Finished in 39.750812877 seconds.
---------------------------------------------------------------------------------------------------------------------------------------------
79 tests, 208 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
---------------------------------------------------------------------------------------------------------------------------------------------
1.99 tests/s, 5.23 assertions/s

Regards, George

georgehansper avatar Sep 29 '24 03:09 georgehansper

But the command ruby tests/tc_*.rb does not run any more tests than the existing ruby tests/tc_augeas.rb

Interesting, I didn't count the tests. I'll take a further look

Can I suggest we make the %check section run rake test instead, as this seems to include all the required *.rb files

That does add another build dependency. Probably not a big deal, but worth considering.

ekohl avatar Sep 29 '24 16:09 ekohl

Which build dependency is added by introducing rake test to the spec file? rake is already used to build the package.

georgehansper avatar Sep 30 '24 09:09 georgehansper

Oh right, you copied the spec file before I rewrote it. In Fedora it's now a pure gem install because the tarballs aren't published to http://download.augeas.net/ruby/ anymore. There I no longer depend on rake.

ekohl avatar Sep 30 '24 10:09 ekohl

There is no existing https version of download.augeas.net, so I have started putting the tarballs on github instead https://github.com/hercules-team/ruby-augeas/releases

georgehansper avatar Oct 01 '24 21:10 georgehansper

Good to know, but at this point I don't see a lot of benefit of treating it as anything else than a regular gem in Fedora.

ekohl avatar Oct 02 '24 13:10 ekohl