New issue
Advanced search Search tips

Issue 812990 link

Starred by 1 user

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

Conditional IUSE_TESTS does not work.

Project Member Reported by hidehiko@chromium.org, Feb 16 2018

Issue description

Now we have conditional IUSE_TESTS.

E.g. autotest-tests has:

X86_IUSE_TESTS="
	+tests_security_SMMLocked
	+tests_xfsFilesystemTestSuite
"

CLIENT_IUSE_TESTS="
	x86? ( ${X86_IUSE_TESTS} )
	amd64? ( ${X86_IUSE_TESTS} )
...
"
...
IUSE_TESTS="${IUSE_TESTS}
	${CLIENT_IUSE_TESTS}
"

IUSE="${IUSE} ${IUSE_TESTS}"

Then, querying use shows:

equery-$BOARD u autotest-tests
[ Legend : U - final flag setting for installation]
[        : I - package is installed with flag     ]
[ Colors : set, unset                             ]
 * Found these USE flags for chromeos-base/autotest-tests-0.0.4-r8562:
 U I
 - - !chromeless_tests?                              : <unknown>
 - - !chromeless_tty?                                : <unknown>
 - - (                                               : <unknown>
 - - )                                               : <unknown>
 - - amd64?                                          : <unknown>
 - - arc-camera3                                     : <unknown>
 - - arc-camera3?                                    : <unknown>
 + - autotest                                        : <unknown>
...


Looks like it does not work as expected.

Assuming there's unconditional tests in IUSE_TESTS, the problematic use in autotest.eclass should be copying files,
https://chromium.git.corp.google.com/chromiumos/overlays/chromiumos-overlay/+/fb968d3353baf835ecf6e71ed110b03fbf9bc4a5/eclass/autotest.eclass#201
and IUSE containing mysterious variables, like '(' etc.

I couldn't figure out how huge the real impact of this bug is, TBH.
At the moment, if the only problematic thing is copying unnecessary files, then, it _looks_ not very much serious, assuming we don't use mysterious USE flags.
If you know other, please speak up :-).

 
Note: I found IUSE_TESTS is also used in tools, like;
https://chromium.git.corp.google.com/chromiumos/chromite/+/20a77192d9333cbc94d60ae2deb7f5534a44cd24/lib/portage_util.py#58

It needs to be taken care on fix.

Comment 2 by vapier@chromium.org, Feb 16 2018

generally speaking, we know it's not correct, but that hasn't been the point of this logic.  the conditional IUSE is respected by autotest.eclass:get_test_list which has been "good enough" for the monster that autotest is now.
Re #2:

get_test_list also returns unexpected result, IIUC, right?
If it is "good enough", how about just listing +test_... directly without any conditions?

Comment 4 by vapier@chromium.org, Feb 16 2018

get_test_list returns the expected result.  look at how it's using portageq to do the USE expansion as one expects (even if the PM/portage isn't parsing IUSE as ebuilds normally expect).

if we listed +test_xxx all the time, it would break the conditional nesting we have now that is working.
Components: Tests

Sign in to add a comment