]> www.infradead.org Git - users/sagi/libnvme.git/commitdiff
Fix python unit tests when run as a subproject of another project (#91)
authorMartin Belanger <nitram_67@hotmail.com>
Wed, 3 Nov 2021 09:03:24 +0000 (05:03 -0400)
committerGitHub <noreply@github.com>
Wed, 3 Nov 2021 09:03:24 +0000 (10:03 +0100)
* Fix python unit tests when run as a subproject of another
project, i.e. nvme-cli.

Signed-off-by: Martin Belanger <martin.belanger@dell.com>
.github/workflows/meson.yml
libnvme/meson.build

index 533a3e45ddf1052b7118f6c1e520c747003a6fab..e1fbdbd11386490d40d0be7eca2ce00535a1b5c5 100644 (file)
@@ -20,3 +20,10 @@ jobs:
       - uses: BSFishy/meson-build@v1.0.3
         with:
           action: test
+          options: --verbose
+      # Preserve meson's log file on failure
+      - uses: actions/upload-artifact@v1
+        if: failure()
+        with:
+          name: Linux_Meson_Testlog
+          path: build/meson-logs/testlog.txt
index 554d4e3e37025bfd171c80b83f35ffd7e8eb6153..76797cc78acf8fbaee4ae1267a73c64324ddd9d8 100644 (file)
@@ -54,7 +54,7 @@ if have_python_support
     # tests directly from the build directory.
     test_env = environment()
     test_env.append('MALLOC_PERTURB_', '0')
-    test_env.append('PYTHONPATH', meson.build_root())
+    test_env.append('PYTHONPATH', join_paths(meson.current_build_dir(), '..'))
 
     # Test section
     test('[Python] import libnvme', python3, args: ['-c', 'from libnvme import nvme'], env: test_env)