-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FAB-10244] Script and target for running int-test
The existing target wouldn't fail the build when integration tests failed. Change-Id: I5e77d86d3ac66fb7cd0e0263d1f1d79e66e4c225 Signed-off-by: Matthew Sykes <sykesmat@us.ibm.com>
- Loading branch information
Showing
3 changed files
with
38 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
# | ||
# Copyright IBM Corp. All Rights Reserved. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# Use ginkgo to run integration tests. If arguments are provided to the | ||
# script, they are treated as the directories containing the tests to run. | ||
# When no arguments are provided, all integration tests are executed. | ||
|
||
set -e -u | ||
|
||
fabric_dir="$(cd "$(dirname "$0")/.." && pwd)" | ||
|
||
# find packages that contain "integration" in the import path | ||
integration_dirs() { | ||
local packages="$1" | ||
|
||
go list -f {{.Dir}} "$packages" | grep -E '/integration($|/)' | sed "s,${fabric_dir},.,g" | ||
} | ||
|
||
main() { | ||
cd "$fabric_dir" | ||
|
||
local -a dirs=("$@") | ||
if [ "${#dirs[@]}" -eq 0 ]; then | ||
dirs=($(integration_dirs "./...")) | ||
fi | ||
|
||
echo "Running integration tests..." | ||
ginkgo -keepGoing --slowSpecThreshold 60 -r "${dirs[@]}" | ||
} | ||
|
||
main "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters