Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 694340 - ebuild ... test no longer magically enables USE=test ?
Summary: ebuild ... test no longer magically enables USE=test ?
Status: CONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Portage team
URL:
Whiteboard:
Keywords: TESTFAILURE
: 694342 (view as bug list)
Depends on:
Blocks: 912975
  Show dependency tree
 
Reported: 2019-09-14 08:20 UTC by Jeroen Roovers (RETIRED)
Modified: 2023-08-24 20:27 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeroen Roovers (RETIRED) gentoo-dev 2019-09-14 08:20:56 UTC
>>> Test phase: net-libs/ngtcp2-0_pre20190912
 * abi_x86_32.x86: running multilib-minimal_abi_src_test
>>> Working in BUILD_DIR: "/home/jer/portage/net-libs/ngtcp2-0_pre20190912/work/ngtcp2-5122d9e5e1e91c718ebc3933252ee42522c6e942-abi_x86_32.x86"
make -j10 VERBOSE=1 check
make: *** No rule to make target 'check'.  Stop.
 * ERROR: net-libs/ngtcp2-0_pre20190912::gentoo failed (test phase):
 *   emake failed

When I replace check with test:


--- a/net-libs/ngtcp2/ngtcp2-0_pre20190912.ebuild
+++ b/net-libs/ngtcp2/ngtcp2-0_pre20190912.ebuild
@@ -38,5 +38,5 @@ multilib_src_configure() {
 }

 multilib_src_test() {
-       cmake-utils_src_make check
+       cmake-utils_src_make test
 }

the build system fails more gracefully:

>>> Working in BUILD_DIR: "/home/jer/portage/net-libs/ngtcp2-0_pre20190912/work/ngtcp2-5122d9e5e1e91c718ebc3933252ee42522c6e942-abi_x86_32.x86"
make -j10 VERBOSE=1 test
Running tests...
/usr/bin/ctest --force-new-ctest-process
Test project /home/jer/portage/net-libs/ngtcp2-0_pre20190912/work/ngtcp2-5122d9e5e1e91c718ebc3933252ee42522c6e942-abi_x86_32.x86
No tests were found!!!
 * abi_x86_64.amd64: running multilib-minimal_abi_src_test
>>> Working in BUILD_DIR: "/home/jer/portage/net-libs/ngtcp2-0_pre20190912/work/ngtcp2-5122d9e5e1e91c718ebc3933252ee42522c6e942-abi_x86_64.amd64"
make -j10 VERBOSE=1 test
Running tests...
/usr/bin/ctest --force-new-ctest-process
Test project /home/jer/portage/net-libs/ngtcp2-0_pre20190912/work/ngtcp2-5122d9e5e1e91c718ebc3933252ee42522c6e942-abi_x86_64.amd64
No tests were found!!!
>>> Completed testing net-libs/ngtcp2-0_pre20190912

But perhaps the default definition works as well.
Comment 1 Craig Andrews gentoo-dev 2019-09-15 01:31:17 UTC
Can you please post the full build log?

Also, do you have >=dev-util/cunit-2.1[${MULTILIB_USEDEP}]? I can reproduce this if I don't have cunit, but I cannot reproduce it if cunit is installed.
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2019-09-15 08:25:53 UTC
Looks like something weird is going on with ebuild(1). Now when I run `ebuild ... test`, it seems USE=test is not magically enabled any longer, so `-DCMAKE_DISABLE_FIND_PACKAGE_CUnit=$(usex !test)` in src_configure does not work as intended and the check target is not added to the Makefile.
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2019-09-15 08:26:24 UTC
*** Bug 694342 has been marked as a duplicate of this bug. ***
Comment 4 Larry the Git Cow gentoo-dev 2019-09-15 13:33:18 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5df35cf0779ec8f882000a2016830cb3e0c2ab7e

commit 5df35cf0779ec8f882000a2016830cb3e0c2ab7e
Author:     Craig Andrews <candrews@gentoo.org>
AuthorDate: 2019-09-15 13:14:10 +0000
Commit:     Craig Andrews <candrews@gentoo.org>
CommitDate: 2019-09-15 13:33:08 +0000

    net-libs/ngtcp2: Disable test phase when test USE flag is disabled
    
    Bug: https://bugs.gentoo.org/show_bug.cgi?id=694340
    Package-Manager: Portage-2.3.76, Repoman-2.3.17
    Signed-off-by: Craig Andrews <candrews@gentoo.org>

 net-libs/ngtcp2/ngtcp2-0_pre20190912.ebuild | 1 +
 net-libs/ngtcp2/ngtcp2-9999.ebuild          | 1 +
 2 files changed, 2 insertions(+)
Comment 5 Mike Gilbert gentoo-dev 2019-09-15 14:37:56 UTC
ebuild/emerge still automatically enables USE=test by default when FEATURES=test is enabled or you run ebuild ... test.

However, if you have USE="-test" set in make.conf or the environment, this now takes precedence. This was changed last year [1].

ebuilds should set RESTRICT="!test? ( test )" if they need to prevent the test phase from running when USE="-test" [2]. This also works for USE flags other than 'test'.

As an end user, if you want to avoid this issue, just make sure you don't have USE="-test" set in make.conf.

See also:

[1] https://github.com/gentoo/portage/pull/347
[2] https://bugs.gentoo.org/663278
Comment 6 Zac Medico gentoo-dev 2019-09-17 21:29:56 UTC
I'm pretty sure I've experience a bug where USE=test is not enabled automatically, possibly only in certain cases such as after it generates a Manifest. I noticed it for packages where I had set RESTRICT="test? ( network-sandbox )" since network-sandbox triggered failures even though it should have been disabled.