Add support for tracing in run_docker_compare.bash.
This commit is contained in:
@@ -5,6 +5,8 @@ IFS=$'\n\t'
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
: ${SHELL:="NO"} # or YES to launch a shell instead of running the test
|
||||
: ${TRACE:="NO"} # or YES to send traces to jaeger
|
||||
: ${BACKTRACE:="NO"} # or YES to print a rust backtrace when panicking
|
||||
|
||||
cd "$DIR/../"
|
||||
REALPATH=$(command -v uu-realpath || command -v realpath)
|
||||
@@ -29,7 +31,6 @@ function launch_container {
|
||||
set -euo pipefail
|
||||
IFS=\$'\n\t'
|
||||
|
||||
export CARGO_TARGET_DIR=/target
|
||||
cargo run -- /input.org
|
||||
EOF
|
||||
)
|
||||
@@ -40,9 +41,16 @@ EOF
|
||||
additional_flags+=(-i -t)
|
||||
fi
|
||||
|
||||
# TODO: add support for reporting to jaeger with RUST_BACKTRACE=1 RUST_LOG=debug
|
||||
if [ "$TRACE" = "YES" ]; then
|
||||
# We use the host network so it can talk to jaeger hosted at 127.0.0.1
|
||||
additional_flags+=(--network=host --env RUST_LOG=debug)
|
||||
fi
|
||||
|
||||
docker run "${additional_flags[@]}" --rm -v "${org_file}:/input.org:ro" -v "$($REALPATH ./):/source:ro" --mount source=cargo-cache,target=/usr/local/cargo/registry --mount source=rust-cache,target=/target -w /source organic-test "${additional_args[@]}"
|
||||
if [ "$BACKTRACE" = "YES" ]; then
|
||||
additional_flags+=(--env RUST_BACKTRACE=full)
|
||||
fi
|
||||
|
||||
docker run "${additional_flags[@]}" --rm -v "${org_file}:/input.org:ro" -v "$($REALPATH ./):/source:ro" --mount source=cargo-cache,target=/usr/local/cargo/registry --mount source=rust-cache,target=/target --env CARGO_TARGET_DIR=/target -w /source organic-test "${additional_args[@]}"
|
||||
}
|
||||
|
||||
main "${@}"
|
||||
|
||||
@@ -46,12 +46,11 @@ function launch_container {
|
||||
set -euo pipefail
|
||||
IFS=\$'\n\t'
|
||||
|
||||
export CARGO_TARGET_DIR=/target
|
||||
cargo test --no-fail-fast --lib --test test_loader "$test" -- --show-output
|
||||
EOF
|
||||
)
|
||||
|
||||
docker run --rm -v "$($REALPATH ./):/source:ro" --mount source=cargo-cache,target=/usr/local/cargo/registry --mount source=rust-cache,target=/target -w /source organic-test sh -c "$init_script"
|
||||
docker run --rm -v "$($REALPATH ./):/source:ro" --mount source=cargo-cache,target=/usr/local/cargo/registry --mount source=rust-cache,target=/target --env CARGO_TARGET_DIR=/target -w /source organic-test sh -c "$init_script"
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user