Merge pull request #10833 from fabianorosas/10832-fix-test-unit-without-parallel
Fix test-unit run without parallel Upstream-commit: f2d2862459ee501bafec2b0f33e52ae849dd7993 Component: engine
This commit is contained in:
@@ -27,6 +27,11 @@ bundle_test_unit() {
|
||||
export TESTFLAGS
|
||||
export HAVE_GO_TEST_COVER
|
||||
export DEST
|
||||
|
||||
# some hack to export array variables
|
||||
export BUILDFLAGS_FILE="buildflags_file"
|
||||
( IFS=$'\n'; echo "${BUILDFLAGS[*]}" ) > "$BUILDFLAGS_FILE"
|
||||
|
||||
if command -v parallel &> /dev/null; then
|
||||
# accomodate parallel to be able to access variables
|
||||
export SHELL="$BASH"
|
||||
@@ -34,10 +39,6 @@ bundle_test_unit() {
|
||||
mkdir -p "$HOME/.parallel"
|
||||
touch "$HOME/.parallel/ignored_vars"
|
||||
|
||||
# some hack to export array variables
|
||||
export BUILDFLAGS_FILE="$HOME/buildflags_file"
|
||||
( IFS=$'\n'; echo "${BUILDFLAGS[*]}" ) > "$BUILDFLAGS_FILE"
|
||||
|
||||
echo "$TESTDIRS" | parallel --jobs "$PARALLEL_JOBS" --env _ "$(dirname "$BASH_SOURCE")/.go-compile-test-dir"
|
||||
rm -rf "$HOME"
|
||||
else
|
||||
@@ -47,6 +48,7 @@ bundle_test_unit() {
|
||||
# don't let one directory that fails to build tank _all_ our tests!
|
||||
done
|
||||
fi
|
||||
rm -f "$BUILDFLAGS_FILE"
|
||||
)
|
||||
echo "$TESTDIRS" | go_run_test_dir
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user