Bug 243624

Summary: yast2-testsuite - When running YaST testsuite, Mode::testsuite() returns false
Product: [openSUSE] openSUSE 10.3 Reporter: Lukas Ocilka <locilka>
Component: YaST2Assignee: Martin Vidner <mvidner>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Normal    
Priority: P3 - Medium CC: jsrain, jsuchome, msvec, mvidner
Version: unspecified   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: mode-testsuite.diff
y2modetest.diff

Description Lukas Ocilka 2007-02-08 16:57:05 UTC
IMAO, Mode::testsuite() should return true when running YaST testsuite (make check) :)
Comment 1 Martin Vidner 2007-02-09 12:58:55 UTC
Created attachment 118289 [details]
mode-testsuite.diff

Please test this patch.
Comment 2 Lukas Ocilka 2007-02-09 13:41:41 UTC
Yes, it seems to work correctly.
Comment 3 Martin Vidner 2007-02-12 09:49:35 UTC
Please release it, thanks for the help.
Comment 4 Lukas Ocilka 2007-02-12 09:51:17 UTC
Ah, sorry, I forgot to close the bug -- already in STABLE :)
Comment 5 Michal Svec 2008-02-13 13:36:41 UTC
The fix breaks usage of Mode::test() in command-line mode (UI is always
initialized). Any chance of having a different check for "testsuite" mode,
other than an UI:: call?
Comment 6 Martin Vidner 2009-06-25 11:25:13 UTC
See also bug 374259.

Now this is causing problems with WebYaST: there is no UI so Mode::testsuite is set. I think the UI check should be reverted.
Comment 7 Lukas Ocilka 2009-06-25 11:43:17 UTC
If you think so ...
Comment 8 Jiří Suchomel 2009-09-11 13:34:26 UTC
Any news? Should I explicitely set mode to commandline in YaPI or is proper solution near?
Comment 9 Jiří Suchomel 2010-02-26 15:23:34 UTC
poinggggg!
Comment 10 Martin Vidner 2010-02-26 15:43:39 UTC
The proper solution is to deprecate Mode::test().

If you need it for WebYaST, then it is probably too risky for SP1 to revert the patch from comment 1.

Consider making your code independent of Mode::test, or indeed resetting the mode in a webyast yapi call to have another hack join the party.
Comment 11 Jiří Suchomel 2010-03-02 14:51:22 UTC
*** Bug 582578 has been marked as a duplicate of this bug. ***
Comment 12 Jiří Suchomel 2010-03-08 11:09:45 UTC
(In reply to comment #10)

> Consider making your code independent of Mode::test,

Seems to be risky for SP1 as well, if I'd not want to remove most of testsuites.

> or indeed resetting the
> mode in a webyast yapi call to have another hack join the party.

One more hack, and making YaPI untestable...
Comment 13 Martin Vidner 2010-03-09 08:11:15 UTC
Created attachment 347263 [details]
y2modetest.diff

Actually the current situation (where Mode::test continues to exist) can be fixed by checking an environment variable that is set in the test harness, such as Y2ALLGLOBAL.

Please try it out.
Comment 14 Jiří Suchomel 2010-03-09 08:37:10 UTC
(In reply to comment #13)
> Created an attachment (id=347263) [details]
> y2modetest.diff
> 
> Actually the current situation (where Mode::test continues to exist) can be
> fixed by checking an environment variable that is set in the test harness, such
> as Y2ALLGLOBAL.
> 
> Please try it out.

Testsuite works (tested: users, firewall) = mode testsuite set correctly

YaPI works (for users) = mode testsuite not set
Comment 15 Martin Vidner 2010-03-10 15:34:49 UTC
SP1:
  http://svn.opensuse.org/viewvc/yast?view=revision&revision=61234
  osc -A https://api.suse.de rq show 5250
11.2:
  http://svn.opensuse.org/viewvc/yast?view=revision&revision=61235
  2.18.31 submitted to YaST:Web:11.2
Comment 16 Martin Vidner 2010-03-10 15:40:26 UTC
trunk:
 http://svn.opensuse.org/viewvc/yast?view=revision&revision=61235
 (no Factory submission yet)