Explorar o código

Merge pull request #5445 from infosiftr/skip-windows

Add logic to tests for ignoring images that have zero tests
Tianon Gravi %!s(int64=6) %!d(string=hai) anos
pai
achega
8be3e2dc49
Modificáronse 2 ficheiros con 23 adicións e 6 borrados
  1. 2 0
      test/config.sh
  2. 21 6
      test/run.sh

+ 2 - 0
test/config.sh

@@ -11,6 +11,8 @@ globalTests+=(
 # for "explicit" images, only run tests that are explicitly specified for that image/variant
 explicitTests+=(
 	[:onbuild]=1
+	[:nanoserver]=1
+	[:windowsservercore]=1
 )
 imageTests[:onbuild]+='
 	override-cmd

+ 21 - 6
test/run.sh

@@ -88,12 +88,6 @@ didFail=
 for dockerImage in "$@"; do
 	echo "testing $dockerImage"
 	
-	if ! docker inspect "$dockerImage" &> /dev/null; then
-		echo $'\timage does not exist!'
-		didFail=1
-		continue
-	fi
-	
 	repo="${dockerImage%:*}"
 	tagVar="${dockerImage#*:}"
 	#version="${tagVar%-*}"
@@ -121,6 +115,14 @@ for dockerImage in "$@"; do
 			# Percona Server for MongoDB is still "mongo"
 			variant='psmdb'
 			;;
+		*nanoserver*)
+			# all nanoserver variants are windows and should have explict tests
+			variant='nanoserver'
+			;;
+		*windowsservercore*)
+			# all servercore variants are windows and should have explict tests
+			variant='windowsservercore'
+			;;
 	esac
 	
 	testRepo="$repo"
@@ -191,6 +193,19 @@ for dockerImage in "$@"; do
 		tests+=( "$t" )
 	done
 	
+	# check for zero tests before checking for existing image
+	# this will make windows variants no longer fail
+	if [ "${#tests[@]}" -eq '0' ]; then
+		echo $'\timage has no tests...skipping'
+		continue
+	fi
+	
+	if ! docker inspect "$dockerImage" &> /dev/null; then
+		echo $'\timage does not exist!'
+		didFail=1
+		continue
+	fi
+	
 	currentTest=0
 	totalTest="${#tests[@]}"
 	for t in "${tests[@]}"; do