Skip to content

Commit

Permalink
add support for --target
Browse files Browse the repository at this point in the history
  • Loading branch information
teh-cmc committed Jul 5, 2023
1 parent 5020e24 commit 4fb6207
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions scripts/ci/run_e2e_roundtrip_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def main() -> None:
parser = argparse.ArgumentParser(description="Run our end-to-end cross-language roundtrip tests for all SDK")
parser.add_argument("--no-build", action="store_true", help="Skip building rerun-sdk")
parser.add_argument("--release", action="store_true", help="Run cargo invocations with --release")
parser.add_argument("--target", type=str, default=None, help="Target used for cargo invocations")
parser.add_argument("--target-dir", type=str, default=None, help="Target directory used for cargo invocations")

args = parser.parse_args()
Expand All @@ -48,7 +49,7 @@ def main() -> None:

for arch in archetypes:
python_output_path = run_roundtrip_python(arch)
rust_output_path = run_roundtrip_rust(arch, args.release, args.target_dir)
rust_output_path = run_roundtrip_rust(arch, args.release, args.target, args.target_dir)
run_comparison(python_output_path, rust_output_path)


Expand All @@ -70,12 +71,15 @@ def run_roundtrip_python(arch: str) -> str:
return output_path


def run_roundtrip_rust(arch: str, release: bool, target_dir: str | None) -> str:
def run_roundtrip_rust(arch: str, release: bool, target: str | None, target_dir: str | None) -> str:
project_name = f"roundtrip_{arch}"
output_path = f"tests/rust/roundtrips/{arch}/out.rrd"

cmd = ["cargo", "r", "-p", project_name]

if target is not None:
cmd += ["--target", target]

if target_dir is not None:
cmd += ["--target-dir", target_dir]

Expand Down

0 comments on commit 4fb6207

Please sign in to comment.