Also skip.IfCondition directly from the test, so that the skip message is correct
Signed-off-by: Daniel Nephin <dnephin@docker.com>
| ... | ... |
@@ -15,7 +15,7 @@ source "$SCRIPTDIR/make/.go-autogen" |
| 15 | 15 |
|
| 16 | 16 |
integration_api_dirs=${TEST_INTEGRATION_DIR:-"$(
|
| 17 | 17 |
find ./integration -type d | |
| 18 |
- grep -vE '^(./integration($|/util|/testdata|/plugin$))')"} |
|
| 18 |
+ grep -vE '(^./integration($|/util)|/testdata)')"} |
|
| 19 | 19 |
|
| 20 | 20 |
run_test_integration() {
|
| 21 | 21 |
[[ "$TESTFLAGS" != *-check.f* ]] && run_test_integration_suites |
| ... | ... |
@@ -5,21 +5,16 @@ import ( |
| 5 | 5 |
"strings" |
| 6 | 6 |
"testing" |
| 7 | 7 |
"time" |
| 8 |
- |
|
| 9 |
- "github.com/gotestyourself/gotestyourself/skip" |
|
| 10 | 8 |
) |
| 11 | 9 |
|
| 12 | 10 |
// HasHubConnectivity checks to see if https://hub.docker.com is |
| 13 | 11 |
// accessible from the present environment |
| 14 |
-func HasHubConnectivity(t *testing.T) {
|
|
| 12 |
+func HasHubConnectivity(t *testing.T) bool {
|
|
| 15 | 13 |
// Set a timeout on the GET at 15s |
| 16 | 14 |
var timeout = 15 * time.Second |
| 17 | 15 |
var url = "https://hub.docker.com" |
| 18 | 16 |
|
| 19 |
- client := http.Client{
|
|
| 20 |
- Timeout: timeout, |
|
| 21 |
- } |
|
| 22 |
- |
|
| 17 |
+ client := http.Client{Timeout: timeout}
|
|
| 23 | 18 |
resp, err := client.Get(url) |
| 24 | 19 |
if err != nil && strings.Contains(err.Error(), "use of closed network connection") {
|
| 25 | 20 |
t.Fatalf("Timeout for GET request on %s", url)
|
| ... | ... |
@@ -27,5 +22,5 @@ func HasHubConnectivity(t *testing.T) {
|
| 27 | 27 |
if resp != nil {
|
| 28 | 28 |
resp.Body.Close() |
| 29 | 29 |
} |
| 30 |
- skip.IfCondition(t, err != nil) |
|
| 30 |
+ return err == nil |
|
| 31 | 31 |
} |