`test_plugin.py`: use absolute paths for plugin path comparison
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Mon, 15 Jul 2019 21:50:11 +0000 (17:50 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 7 Aug 2019 18:05:18 +0000 (14:05 -0400)
commita85355e78ee7fcba26f6cebc9f31434f14c54c8a
treeee14843dc2732fd6315b1bc9be82c9aa0be9d001
parent1d88d4ae7ae688f92735b837d78c21e755b84774
`test_plugin.py`: use absolute paths for plugin path comparison

Under a MinGW 64 test environment, the `BABELTRACE_PLUGIN_PATH`
environment variable gets translated to NT path by MinGW since the
passed paths fit the translation criteria. The relative part of the
paths also get thrown away and the relative paths are replaced by their
absolute equivalent.

Performing absolute path conversion on both test paths ensure
consistency across platforms of this test.

The error was:

    error: PASS: bindings/python/bt2/test_python_bt2 6513 - test_name (test_plugin.PluginTestCase)
     c:/users/joraj/babeltrace/src/plugins/ctf/babeltrace-plugin-ctf.la
     c:/users/joraj/babeltrace/tests/../src/plugins
     not ok 6514 - test_path (test_plugin.PluginTestCase)
     FAIL: bindings/python/bt2/test_python_bt2 6514 - test_path (test_plugin.PluginTestCase)
       Traceback (most recent call last):
       bindings/python/bt2/test_python_bt2: Traceback (most recent call last):
         File "C:/msys64/mingw64/lib/python3.7\unittest\case.py", line 59, in testPartExecutor
       bindings/python/bt2/test_python_bt2: File "C:/msys64/mingw64/lib/python3.7\unittest\case.py", line 59, in testPartExecutor
           yield
       bindings/python/bt2/test_python_bt2: yield
         File "C:/msys64/mingw64/lib/python3.7\unittest\case.py", line 628, in run
       bindings/python/bt2/test_python_bt2: File "C:/msys64/mingw64/lib/python3.7\unittest\case.py", line 628, in run
           testMethod()
       bindings/python/bt2/test_python_bt2: testMethod()
         File "C:/Users/joraj/babeltrace/tests/bindings/python/bt2\test_plugin.py", line 96, in test_path
       bindings/python/bt2/test_python_bt2: File "C:/Users/joraj/babeltrace/tests/bindings/python/bt2\test_plugin.py", line 96, in test_path
           self.assertTrue(plugin_path.startswith(plugin_path_env))
       bindings/python/bt2/test_python_bt2: self.assertTrue(plugin_path.startswith(plugin_path_env))
         File "C:/msys64/mingw64/lib/python3.7\unittest\case.py", line 705, in assertTrue
       bindings/python/bt2/test_python_bt2: File "C:/msys64/mingw64/lib/python3.7\unittest\case.py", line 705, in assertTrue
           raise self.failureException(msg)
       bindings/python/bt2/test_python_bt2: raise self.failureException(msg)
       AssertionError: False is not true
       bindings/python/bt2/test_python_bt2: AssertionError: False is not true

Change-Id: I4b3dc1c52a13dff5be88e417a9d1a877c81f66da
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1709
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
tests/bindings/python/bt2/test_plugin.py
This page took 0.024759 seconds and 4 git commands to generate.