As exposed by bug 1272 [1], there are some tests in
test_trace_collection_message_iterator.py that depend on Python plugins
being enabled. Running the tests with `--enable-python-bindings` and
`--disable-python-plugins` therefore leads to these tests failing.
Fix it by skipping them if the support for Python plugins is not
enabled.
[1] https://bugs.lttng.org/issues/1272
Change-Id: I4881a3b0a336b9078715837cb7f8f423bbc2b982
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/3621
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
CI-Build: Michael Jeanson <mjeanson@efficios.com>
[AC_DEFINE([BT_BUILT_IN_PYTHON_PLUGIN_SUPPORT], [1], [Define to 1 to register plug-in attributes in static executable sections])]
)
[AC_DEFINE([BT_BUILT_IN_PYTHON_PLUGIN_SUPPORT], [1], [Define to 1 to register plug-in attributes in static executable sections])]
)
+AE_IF_FEATURE_ENABLED([python-plugins], [ENABLE_PYTHON_PLUGINS=1], [ENABLE_PYTHON_PLUGINS=0])
+AC_SUBST([ENABLE_PYTHON_PLUGINS])
+
AE_IF_FEATURE_ENABLED([debug-info], [ENABLE_DEBUG_INFO_VAL=1], [ENABLE_DEBUG_INFO_VAL=0])
AC_SUBST([ENABLE_DEBUG_INFO_VAL])
AE_IF_FEATURE_ENABLED([debug-info], [ENABLE_DEBUG_INFO_VAL=1], [ENABLE_DEBUG_INFO_VAL=0])
AC_SUBST([ENABLE_DEBUG_INFO_VAL])
_METADATA_SYNTAX_ERROR_TRACE_PATH = os.path.join(
_BT_CTF_TRACES_PATH, "fail", "metadata-syntax-error"
)
_METADATA_SYNTAX_ERROR_TRACE_PATH = os.path.join(
_BT_CTF_TRACES_PATH, "fail", "metadata-syntax-error"
)
+_BT_ENABLE_PYTHON_PLUGINS = os.environ["BT_TESTS_ENABLE_PYTHON_PLUGINS"] == "1"
os.environ["BABELTRACE_PLUGIN_PATH"] = self._saved_babeltrace_plugin_path
os.environ["BABELTRACE_PLUGIN_PATH"] = self._saved_babeltrace_plugin_path
+@unittest.skipUnless(
+ _BT_ENABLE_PYTHON_PLUGINS,
+ "Support for Python plugins is disabled",
+)
class TestAutoDiscoverSourceComponentSpecsGrouping(
_TestAutoDiscoverSourceComponentSpecs
):
class TestAutoDiscoverSourceComponentSpecsGrouping(
_TestAutoDiscoverSourceComponentSpecs
):
self.assertEqual(msgs[7].stream.name, "TestSourceSomeDir: some-dir")
self.assertEqual(msgs[7].stream.name, "TestSourceSomeDir: some-dir")
+@unittest.skipUnless(
+ _BT_ENABLE_PYTHON_PLUGINS,
+ "Support for Python plugins is disabled",
+)
class TestAutoDiscoverSourceComponentSpecsParamsObjLogLevel(
_TestAutoDiscoverSourceComponentSpecs
):
class TestAutoDiscoverSourceComponentSpecsParamsObjLogLevel(
_TestAutoDiscoverSourceComponentSpecs
):
trace_dir="$temp_output_dir/the-trace"
trace_dir="$temp_output_dir/the-trace"
+if [ "$BT_TESTS_ENABLE_PYTHON_PLUGINS" != "1" ]; then
+ plan_skip_all "This test requires the Python plugin provider"
+ exit
+fi
+
plan_tests 7
bt_cli "$temp_stdout" "$temp_stderr" \
plan_tests 7
bt_cli "$temp_stdout" "$temp_stderr" \
temp_output_dir=$(mktemp -d)
trace_dir="$temp_output_dir/trace"
temp_output_dir=$(mktemp -d)
trace_dir="$temp_output_dir/trace"
+if [ "$BT_TESTS_ENABLE_PYTHON_PLUGINS" != "1" ]; then
+ plan_skip_all "This test requires the Python plugin provider"
+ exit
+fi
+
plan_tests 9
bt_cli "$temp_stdout" "$temp_stderr" \
plan_tests 9
bt_cli "$temp_stdout" "$temp_stderr" \
BT_TESTS_ENABLE_ASAN="@ENABLE_ASAN@"
fi
export BT_TESTS_ENABLE_ASAN
BT_TESTS_ENABLE_ASAN="@ENABLE_ASAN@"
fi
export BT_TESTS_ENABLE_ASAN
+
+# Define to 1 to enable tests that depend on the Python plugins support
+if [ -z "${BT_TESTS_ENABLE_PYTHON_PLUGINS:-}" ]; then
+ BT_TESTS_ENABLE_PYTHON_PLUGINS="@ENABLE_PYTHON_PLUGINS@"
+fi
+export BT_TESTS_ENABLE_PYTHON_PLUGINS