Mailinglist Archive: yast-devel (144 mails)

< Previous Next >
Re: [yast-devel] unit tests for yast modules written in ruby
  • From: Vladimir Moravec <vmoravec@xxxxxxxx>
  • Date: Mon, 12 Aug 2013 15:52:39 +0200
  • Message-id: <5208E8A7.70203@suse.com>
Dne 12.8.2013 14:47, Ladislav Slezak napsal(a):
...
I do not have any strong preference, I only know the test-unit + mocha which
we already use in Webyast and SLMS. (SLMS in addition to this uses
factory_girl,
but Yast does not need any DB mocking so it's irrelevant here...)

but before we dive into a massive flamewar re: which one is the best,

I don't think there will be a flamewar as Yast developers do not know any of
them,
and the legacy Yast testing framework (expects + dejagnu) works completely
differently (and looks weird from Ruby perspective)...

there's another topic to chew on: do we need to standardize this at all?

Having a common standard in all Yast packages should be preferred. Yast
maintainers change quite often, some modules are moved or changed between
maintainers
etc..

This is the for me the strongest argument to use a single test framework.



More frameworks also mean more maintenance effort
(to package them to RPMS).

Yep, and do not forget the dependencies and support accross several sles
and opensuse releases.

I would prefer to use the potential of ruby standard library and vote
for test/unit but it lacks support for mocking and stubbing which brings
additional dependency on another library, e.g. [1].

On the other hand there are rspec and minitest that have built-in
mocking support and a nice testing DSL; and both libs have good
maintainers and tons of extensions (if needed). The advantage of using
minitest is that it provides the test/unit style of writing unit tests.

Mayge we might have to make the effort to try them out on some
translated yast code before we make the final decision and rewrite the
tests afterwards when the experience proves unsatisfactory.

vlado

[1] https://github.com/freerange/mocha


< Previous Next >
Follow Ups