Fix CI AppVeyor 'make check' errors for go 1.15 on windows (#8061)
Avoid writing to nul on windows. On Appveyor, writing to nul creates a file instead of discarding output. The file's existence creates errors later in the build.
This commit is contained in:
parent
3278054c5c
commit
b5fafb4c95
8
Makefile
8
Makefile
|
|
@ -1,11 +1,5 @@
|
||||||
ifeq ($(OS), Windows_NT)
|
|
||||||
devnull := nul
|
|
||||||
else
|
|
||||||
devnull := /dev/null
|
|
||||||
endif
|
|
||||||
|
|
||||||
next_version := 1.16.0
|
next_version := 1.16.0
|
||||||
tag := $(shell git describe --exact-match --tags 2>$(devnull))
|
tag := $(shell git describe --exact-match --tags 2>git_describe_error.tmp; rm -f git_describe_error.tmp)
|
||||||
branch := $(shell git rev-parse --abbrev-ref HEAD)
|
branch := $(shell git rev-parse --abbrev-ref HEAD)
|
||||||
commit := $(shell git rev-parse --short=8 HEAD)
|
commit := $(shell git rev-parse --short=8 HEAD)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ package win_perf_counters
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
"fmt"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
|
@ -185,11 +186,11 @@ func TestWinPerfcountersConfigGet2(t *testing.T) {
|
||||||
if len(m.counters) == 1 {
|
if len(m.counters) == 1 {
|
||||||
require.NoError(t, nil)
|
require.NoError(t, nil)
|
||||||
} else if len(m.counters) == 0 {
|
} else if len(m.counters) == 0 {
|
||||||
var errorstring1 = "No results returned from the counterPath: " + string(len(m.counters))
|
var errorstring1 = "No results returned from the counterPath"
|
||||||
err2 := errors.New(errorstring1)
|
err2 := errors.New(errorstring1)
|
||||||
require.NoError(t, err2)
|
require.NoError(t, err2)
|
||||||
} else if len(m.counters) > 1 {
|
} else if len(m.counters) > 1 {
|
||||||
var errorstring1 = "Too many results returned from the counterPath: " + string(len(m.counters))
|
var errorstring1 = fmt.Sprintf("Too many results returned from the counterPath: %v", len(m.counters))
|
||||||
err2 := errors.New(errorstring1)
|
err2 := errors.New(errorstring1)
|
||||||
require.NoError(t, err2)
|
require.NoError(t, err2)
|
||||||
}
|
}
|
||||||
|
|
@ -233,12 +234,12 @@ func TestWinPerfcountersConfigGet3(t *testing.T) {
|
||||||
require.NoError(t, nil)
|
require.NoError(t, nil)
|
||||||
} else if len(m.counters) < 2 {
|
} else if len(m.counters) < 2 {
|
||||||
|
|
||||||
var errorstring1 = "Too few results returned from the counterPath. " + string(len(m.counters))
|
var errorstring1 = fmt.Sprintf("Too few results returned from the counterPath: %v", len(m.counters))
|
||||||
err2 := errors.New(errorstring1)
|
err2 := errors.New(errorstring1)
|
||||||
require.NoError(t, err2)
|
require.NoError(t, err2)
|
||||||
} else if len(m.counters) > 2 {
|
} else if len(m.counters) > 2 {
|
||||||
|
|
||||||
var errorstring1 = "Too many results returned from the counterPath: " + string(len(m.counters))
|
var errorstring1 = fmt.Sprintf("Too many results returned from the counterPath: %v", len(m.counters))
|
||||||
err2 := errors.New(errorstring1)
|
err2 := errors.New(errorstring1)
|
||||||
require.NoError(t, err2)
|
require.NoError(t, err2)
|
||||||
}
|
}
|
||||||
|
|
@ -282,12 +283,12 @@ func TestWinPerfcountersConfigGet4(t *testing.T) {
|
||||||
require.NoError(t, nil)
|
require.NoError(t, nil)
|
||||||
} else if len(m.counters) < 2 {
|
} else if len(m.counters) < 2 {
|
||||||
|
|
||||||
var errorstring1 = "Too few results returned from the counterPath: " + string(len(m.counters))
|
var errorstring1 = fmt.Sprintf("Too few results returned from the counterPath: %v", len(m.counters))
|
||||||
err2 := errors.New(errorstring1)
|
err2 := errors.New(errorstring1)
|
||||||
require.NoError(t, err2)
|
require.NoError(t, err2)
|
||||||
} else if len(m.counters) > 2 {
|
} else if len(m.counters) > 2 {
|
||||||
|
|
||||||
var errorstring1 = "Too many results returned from the counterPath: " + string(len(m.counters))
|
var errorstring1 = fmt.Sprintf("Too many results returned from the counterPath: %v", len(m.counters))
|
||||||
err2 := errors.New(errorstring1)
|
err2 := errors.New(errorstring1)
|
||||||
require.NoError(t, err2)
|
require.NoError(t, err2)
|
||||||
}
|
}
|
||||||
|
|
@ -331,13 +332,11 @@ func TestWinPerfcountersConfigGet5(t *testing.T) {
|
||||||
if len(m.counters) == 4 {
|
if len(m.counters) == 4 {
|
||||||
require.NoError(t, nil)
|
require.NoError(t, nil)
|
||||||
} else if len(m.counters) < 4 {
|
} else if len(m.counters) < 4 {
|
||||||
var errorstring1 = "Too few results returned from the counterPath: " +
|
var errorstring1 = fmt.Sprintf("Too few results returned from the counterPath: %v", len(m.counters))
|
||||||
string(len(m.counters))
|
|
||||||
err2 := errors.New(errorstring1)
|
err2 := errors.New(errorstring1)
|
||||||
require.NoError(t, err2)
|
require.NoError(t, err2)
|
||||||
} else if len(m.counters) > 4 {
|
} else if len(m.counters) > 4 {
|
||||||
var errorstring1 = "Too many results returned from the counterPath: " +
|
var errorstring1 = fmt.Sprintf("Too many results returned from the counterPath: %v", len(m.counters))
|
||||||
string(len(m.counters))
|
|
||||||
err2 := errors.New(errorstring1)
|
err2 := errors.New(errorstring1)
|
||||||
require.NoError(t, err2)
|
require.NoError(t, err2)
|
||||||
}
|
}
|
||||||
|
|
@ -415,13 +414,11 @@ func TestWinPerfcountersConfigGet7(t *testing.T) {
|
||||||
if len(m.counters) == 2 {
|
if len(m.counters) == 2 {
|
||||||
require.NoError(t, nil)
|
require.NoError(t, nil)
|
||||||
} else if len(m.counters) < 2 {
|
} else if len(m.counters) < 2 {
|
||||||
var errorstring1 = "Too few results returned from the counterPath: " +
|
var errorstring1 = fmt.Sprintf("Too few results returned from the counterPath: %v", len(m.counters))
|
||||||
string(len(m.counters))
|
|
||||||
err2 := errors.New(errorstring1)
|
err2 := errors.New(errorstring1)
|
||||||
require.NoError(t, err2)
|
require.NoError(t, err2)
|
||||||
} else if len(m.counters) > 2 {
|
} else if len(m.counters) > 2 {
|
||||||
var errorstring1 = "Too many results returned from the counterPath: " +
|
var errorstring1 = fmt.Sprintf("Too many results returned from the counterPath: %v", len(m.counters))
|
||||||
string(len(m.counters))
|
|
||||||
err2 := errors.New(errorstring1)
|
err2 := errors.New(errorstring1)
|
||||||
require.NoError(t, err2)
|
require.NoError(t, err2)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue