From 5768c8acda0d7b7960a34eeeca36760117df36af Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Mon, 14 Aug 2023 15:30:13 -0400 Subject: [PATCH] Add a script to run compare using the docker image. --- Makefile | 5 +++ scripts/run_docker_compare.bash | 46 ++++++++++++++++++++++++ scripts/run_docker_integration_test.bash | 3 +- 3 files changed, 53 insertions(+), 1 deletion(-) create mode 100755 scripts/run_docker_compare.bash diff --git a/Makefile b/Makefile index 2eb24667..dcfb5400 100644 --- a/Makefile +++ b/Makefile @@ -42,6 +42,11 @@ dockertest: > $(MAKE) -C docker/organic_test > docker run --rm -i -t -v "$$(readlink -f ./):/.source:ro" --mount source=cargo-cache,target=/usr/local/cargo/registry -w / organic-test sh -c "cp -r /.source /source && cd /source && cargo test --no-fail-fast --lib --test test_loader" +.PHONY: dockerclean +dockerclean: +# Delete volumes created for running the tests in docker. This does not touch anything related to the jaeger docker container. +> docker volume rm cargo-cache rust-cache + .PHONY: integrationtest integrationtest: > cargo test --no-fail-fast --test test_loader -- --test-threads $(TESTJOBS) diff --git a/scripts/run_docker_compare.bash b/scripts/run_docker_compare.bash new file mode 100755 index 00000000..a36f4283 --- /dev/null +++ b/scripts/run_docker_compare.bash @@ -0,0 +1,46 @@ +#!/usr/bin/env bash +# +set -euo pipefail +IFS=$'\n\t' +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +: ${SHELL:="NO"} # or YES to launch a shell instead of running the test + +cd "$DIR/../" +REALPATH=$(command -v uu-realpath || command -v realpath) +MAKE=$(command -v gmake || command -v make) + +function main { + local org_file="$($REALPATH "$1")" + build_container + launch_container "$org_file" +} + +function build_container { + $MAKE -C "$DIR/../docker/organic_test" +} + +function launch_container { + local org_file="$1" + local additional_flags=() + local additional_args=() + + local init_script=$(cat <