`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)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Sat, 20 Jul 2019 13:37:47 +0000 (09:37 -0400)
commit824cfbd81e2eb6594a6c83e4dd25f53aff36f759
tree0eecad3ffaf7b0fa4babaa2b27f5b2f341178c1b
parentf2bad367743dbcfae25a8b05141ab84b042a6904
`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.025158 seconds and 4 git commands to generate.