From 6dce08c8388b4313470bc7f05d23656e98d35718 Mon Sep 17 00:00:00 2001 From: Georgy Moshkin <gmoshkin@picodata.io> Date: Fri, 5 Aug 2022 18:09:23 +0300 Subject: [PATCH] chore(test): support custom cargo target directories Some users may change their "target-dir" cargo setting for example to make it shared between all projects (may speed up some builds). It that case our integration tests should be looking for the executable in the right place. --- test/conftest.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/conftest.py b/test/conftest.py index 6dd2bf4a6d..d7b98bf8ba 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -1,4 +1,5 @@ import io +import json import os import re import sys @@ -533,7 +534,9 @@ def compile() -> None: @pytest.fixture(scope="session") def binary_path(compile, pytestconfig) -> str: - return os.path.realpath(pytestconfig.rootpath / "target/debug/picodata") + metadata = subprocess.check_output(["cargo", "metadata", "--format-version=1"]) + target = json.loads(metadata)["target_directory"] + return os.path.realpath(os.path.join(target, "debug/picodata")) @pytest.fixture(scope="session") -- GitLab