Mailinglist Archive: yast-devel (100 mails)

< Previous Next >
Re: [yast-devel] Change in yast-rake and fragile tests
On Fri, 16 Jan 2015 09:43:27 +0100
Ladislav Slezak <lslezak@xxxxxxx> wrote:

Dne 15.1.2015 v 17:53 Ancor Gonzalez Sosa napsal(a):
This change introduced in our test:unit task has caused the tests in
yast-yast2 to break.
https://github.com/yast/yast-rake/commit/b00ca0e8c8208b05698675b0cb4752552de710c9

That commit runs all tests in a single process, the advantages are:

- faster run (almost by factor 10!)

- proper code coverage (before the change every run rewrote the
previous code coverage statistics, at the end the report contained
only the coverage from the last run)

See https://github.com/yast/yast-rake/issues/11 for details.

Yep, that was reason for change.


It's actually not a fault of the change in the task. The problem is
that the tests are fragile because they pollute the global
namespace in several ways.

Ouch, I didn't realize this side effect...

Well, usually it do not break as you share one helper, so only
constants can be redefined, but it is just warning. Problem in yast2 is
that it have multiple locations which contain tests, so there can be
bigger collision as even helpers are not shared.


[...]

The weird thing is that I needed to introduce the line marked with a
FIXME, which means that closing the default SCR is not as secure as
all our tests assume. Looking at the yast2-core source code I'd say
that the line is actually needed and we need to update quite some
tests and the documentation. But it's the core, so of course I
could be wrong.

I have checked the code, and yes, after closing the current SCR you
need to set the current one as no default SCR is set:

https://github.com/yast/yast-core/blob/master/wfm/src/Y2WFMComponent.cc#L301

But I'm not much familiar with that part of Yast...

you are right. I remember it wrongly as there was some handling in
past, but I removed it and it actually do not fix SCR instance number -
https://github.com/yast/yast-core/commit/26d7ae4fbc0d68e5fe38d44bddfa9c7bc263bc3d#diff-980808f9bd5a55b4f32a7f730f54877bL311

What we can do is:
1) fix usage
2) behave smarter and select any remaining SCR instance when default is
closed as usual use case is one system SCR and one additional ( /mnt
one in installation or relative in case of tests ).

What do you think?

Josef
--
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: yast-devel+owner@xxxxxxxxxxxx

< Previous Next >