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

Run all tests in gemspec #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ekohl
Copy link
Contributor

@ekohl ekohl commented Sep 28, 2024

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

@georgehansper
Copy link
Member

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

@ekohl
Copy link
Contributor Author

ekohl commented Sep 29, 2024

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.

@georgehansper
Copy link
Member

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

@ekohl
Copy link
Contributor Author

ekohl commented Sep 30, 2024

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.

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

Running `ruby tests/tc_*.rb` doesn't run all tests so it's converted to
using rake test.
@georgehansper
Copy link
Member

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

@ekohl
Copy link
Contributor Author

ekohl commented Oct 2, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants