[libvirt PATCH] tests: Don't advertise VIR_TEST_EXPENSIVE to users

Andrea Bolognani posted 1 patch 3 years, 6 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20200922131849.156111-1-abologna@redhat.com
docs/advanced-tests.rst | 8 +-------
meson_options.txt       | 2 +-
tests/test-lib.sh       | 2 +-
3 files changed, 3 insertions(+), 9 deletions(-)
[libvirt PATCH] tests: Don't advertise VIR_TEST_EXPENSIVE to users
Posted by Andrea Bolognani 3 years, 6 months ago
Right now, the logic that takes care of deciding whether expensive
tests should be run or not is not working correctly: more
specifically, it's not possible to use something like

  $ VIR_TEST_EXPENSIVE=1 ninja test

to override the default choice, because in meson.build we always
pass an explicit value that overrides whatever is present in the
environment.

We could implement logic to make this work properly, but that
would require some refactoring of our test infrastructure and is
arguably of little value given that running

  $ meson build -Dexpensive_tests=enabled

is very fast, so let's just stop telling users about the variable
instead and call it a day.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
 docs/advanced-tests.rst | 8 +-------
 meson_options.txt       | 2 +-
 tests/test-lib.sh       | 2 +-
 3 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/docs/advanced-tests.rst b/docs/advanced-tests.rst
index 772fe1dd16..f17d8b0031 100644
--- a/docs/advanced-tests.rst
+++ b/docs/advanced-tests.rst
@@ -26,13 +26,7 @@ Some tests are skipped by default in a development environment,
 based on the time they take in comparison to the likelihood
 that those tests will turn up problems during incremental
 builds. These tests default to being run when building from a
-tarball or with the configure option -Dexpensive_tests=enabled;
-you can also force a one-time toggle of these tests by setting
-VIR_TEST_EXPENSIVE to 0 or 1 at make time, as in:
-
-::
-
-  $ VIR_TEST_EXPENSIVE=1 ninja test
+tarball or with the configure option -Dexpensive_tests=enabled.
 
 If you encounter any failing tests, the VIR_TEST_DEBUG
 environment variable may provide extra information to debug the
diff --git a/meson_options.txt b/meson_options.txt
index f92c80553c..74de064384 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -3,7 +3,7 @@ option('packager', type: 'string', value: '', description: 'Extra packager name'
 option('packager_version', type: 'string', value: '', description: 'Extra packager version')
 option('system', type: 'boolean', value: false, description: 'Set install paths to system ones')
 option('runstatedir', type: 'string', value: '', description: 'State directory for temporary sockets, pid files, etc')
-option('expensive_tests', type: 'feature', value: 'auto', description: 'set the default for enabling expensive tests (long timeouts), use VIR_TEST_EXPENSIVE to override')
+option('expensive_tests', type: 'feature', value: 'auto', description: 'set the default for enabling expensive tests (long timeouts)')
 option('test_coverage', type: 'boolean', value: false, description: 'turn on code coverage instrumentation')
 option('git_werror', type: 'feature', value: 'auto', description: 'use -Werror if building from GIT')
 option('rpath', type: 'feature', value: 'auto', description: 'whether to include rpath information in installed binaries and libraries')
diff --git a/tests/test-lib.sh b/tests/test-lib.sh
index cc3924c07a..67065a9362 100644
--- a/tests/test-lib.sh
+++ b/tests/test-lib.sh
@@ -200,7 +200,7 @@ test_expensive()
   if test "$VIR_TEST_EXPENSIVE" != 1; then
     skip_test_ '
 This test is very expensive, so it is disabled by default.
-To run it anyway, rerun: VIR_TEST_EXPENSIVE=1 ninja test
+To change the default, configure with: meson -Dexpensive_tests=enabled
 '
   fi
 }
-- 
2.26.2

Re: [libvirt PATCH] tests: Don't advertise VIR_TEST_EXPENSIVE to users
Posted by Pavel Hrdina 3 years, 6 months ago
On Tue, Sep 22, 2020 at 03:18:49PM +0200, Andrea Bolognani wrote:
> Right now, the logic that takes care of deciding whether expensive
> tests should be run or not is not working correctly: more
> specifically, it's not possible to use something like
> 
>   $ VIR_TEST_EXPENSIVE=1 ninja test
> 
> to override the default choice, because in meson.build we always
> pass an explicit value that overrides whatever is present in the
> environment.
> 
> We could implement logic to make this work properly, but that
> would require some refactoring of our test infrastructure and is
> arguably of little value given that running
> 
>   $ meson build -Dexpensive_tests=enabled
> 
> is very fast, so let's just stop telling users about the variable
> instead and call it a day.
> 
> Signed-off-by: Andrea Bolognani <abologna@redhat.com>
> ---
>  docs/advanced-tests.rst | 8 +-------
>  meson_options.txt       | 2 +-
>  tests/test-lib.sh       | 2 +-
>  3 files changed, 3 insertions(+), 9 deletions(-)

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>