Selaa lähdekoodia

Update test harness to strip namespace by default (so that "update.sh/python" becomes simply "python" for the sake of determining which tests to run)

Tianon Gravi 9 vuotta sitten
vanhempi
sitoutus
53d7709ac4
1 muutettua tiedostoa jossa 7 lisäystä ja 2 poistoa
  1. 7 2
      test/run.sh

+ 7 - 2
test/run.sh

@@ -19,12 +19,13 @@ EOUSAGE
 }
 
 # arg handling
-opts="$(getopt -o 'ht:c:?' --long 'dry-run,help,test:,config:' -- "$@" || { usage >&2 && false; })"
+opts="$(getopt -o 'ht:c:?' --long 'dry-run,help,test:,config:,keep-namespace' -- "$@" || { usage >&2 && false; })"
 eval set -- "$opts"
 
 declare -A argTests=()
 declare -a configs=()
 dryRun=
+keepNamespace=
 while true; do
 	flag=$1
 	shift
@@ -33,6 +34,7 @@ while true; do
 		--help|-h|'-?') usage && exit 0 ;;
 		--test|-t) argTests["$1"]=1 && shift ;;
 		--config|-c) configs+=("$(readlink -f "$1")") && shift ;;
+		--keep-namespace) keepNamespace=1 ;;
 		--) break ;;
 		*)
 			{
@@ -103,7 +105,10 @@ for dockerImage in "$@"; do
 		variant='onbuild'
 	fi
 	
-	testRepo=$repo
+	testRepo="$repo"
+	if [ -z "$keepNamespace" ]; then
+		testRepo="${testRepo##*/}"
+	fi
 	[ -z "${testAlias[$repo]}" ] || testRepo="${testAlias[$repo]}"
 	
 	explicitVariant=