test: skip HoltWinters tests when GOARCH != amd64 (#22414)
parent
15fb8949f2
commit
29ef6dc562
|
@ -5,6 +5,7 @@ import (
|
|||
"fmt"
|
||||
"math"
|
||||
"math/rand"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"testing"
|
||||
"time"
|
||||
|
@ -22,6 +23,10 @@ func almostEqual(got, exp float64) bool {
|
|||
}
|
||||
|
||||
func TestHoltWinters_AusTourists(t *testing.T) {
|
||||
if runtime.GOARCH != "amd64" {
|
||||
t.Skip("Expected HoltWinters outputs only valid when GOARCH = amd64")
|
||||
}
|
||||
|
||||
hw := query.NewFloatHoltWintersReducer(10, 4, false, 1)
|
||||
// Dataset from http://www.inside-r.org/packages/cran/fpp/docs/austourists
|
||||
austourists := []query.FloatPoint{
|
||||
|
@ -108,6 +113,10 @@ func TestHoltWinters_AusTourists(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestHoltWinters_AusTourists_Missing(t *testing.T) {
|
||||
if runtime.GOARCH != "amd64" {
|
||||
t.Skip("Expected HoltWinters outputs only valid when GOARCH = amd64")
|
||||
}
|
||||
|
||||
hw := query.NewFloatHoltWintersReducer(10, 4, false, 1)
|
||||
// Dataset from http://www.inside-r.org/packages/cran/fpp/docs/austourists
|
||||
austourists := []query.FloatPoint{
|
||||
|
@ -187,6 +196,10 @@ func TestHoltWinters_AusTourists_Missing(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestHoltWinters_USPopulation(t *testing.T) {
|
||||
if runtime.GOARCH != "amd64" {
|
||||
t.Skip("Expected HoltWinters outputs only valid when GOARCH = amd64")
|
||||
}
|
||||
|
||||
series := []query.FloatPoint{
|
||||
{Time: 1, Value: 3.93},
|
||||
{Time: 2, Value: 5.31},
|
||||
|
@ -260,6 +273,10 @@ func TestHoltWinters_USPopulation(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestHoltWinters_USPopulation_Missing(t *testing.T) {
|
||||
if runtime.GOARCH != "amd64" {
|
||||
t.Skip("Expected HoltWinters outputs only valid when GOARCH = amd64")
|
||||
}
|
||||
|
||||
series := []query.FloatPoint{
|
||||
{Time: 1, Value: 3.93},
|
||||
{Time: 2, Value: 5.31},
|
||||
|
@ -329,6 +346,10 @@ func TestHoltWinters_USPopulation_Missing(t *testing.T) {
|
|||
}
|
||||
}
|
||||
func TestHoltWinters_RoundTime(t *testing.T) {
|
||||
if runtime.GOARCH != "amd64" {
|
||||
t.Skip("Expected HoltWinters outputs only valid when GOARCH = amd64")
|
||||
}
|
||||
|
||||
maxTime := time.Unix(0, influxql.MaxTime).Round(time.Second).UnixNano()
|
||||
data := []query.FloatPoint{
|
||||
{Time: maxTime - int64(5*time.Second), Value: 1},
|
||||
|
@ -365,6 +386,10 @@ func TestHoltWinters_RoundTime(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestHoltWinters_MaxTime(t *testing.T) {
|
||||
if runtime.GOARCH != "amd64" {
|
||||
t.Skip("Expected HoltWinters outputs only valid when GOARCH = amd64")
|
||||
}
|
||||
|
||||
data := []query.FloatPoint{
|
||||
{Time: influxql.MaxTime - 1, Value: 1},
|
||||
{Time: influxql.MaxTime, Value: 2},
|
||||
|
|
|
@ -5,6 +5,7 @@ import (
|
|||
"fmt"
|
||||
"math/rand"
|
||||
"reflect"
|
||||
"runtime"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
|
@ -40,15 +41,16 @@ func floatIterator(fSlice []float64, name, tags string, startTime, step int64) *
|
|||
|
||||
func TestSelect(t *testing.T) {
|
||||
for _, tt := range []struct {
|
||||
name string
|
||||
q string
|
||||
typ influxql.DataType
|
||||
fields map[string]influxql.DataType
|
||||
expr string
|
||||
itrs []query.Iterator
|
||||
rows []query.Row
|
||||
now time.Time
|
||||
err string
|
||||
name string
|
||||
q string
|
||||
typ influxql.DataType
|
||||
fields map[string]influxql.DataType
|
||||
expr string
|
||||
itrs []query.Iterator
|
||||
rows []query.Row
|
||||
now time.Time
|
||||
err string
|
||||
onlyArch string
|
||||
}{
|
||||
{
|
||||
name: "Min",
|
||||
|
@ -2831,6 +2833,7 @@ func TestSelect(t *testing.T) {
|
|||
{Time: 20 * Second, Series: query.Series{Name: "cpu"}, Values: []interface{}{11.960623419918432}},
|
||||
{Time: 22 * Second, Series: query.Series{Name: "cpu"}, Values: []interface{}{7.953140268154609}},
|
||||
},
|
||||
onlyArch: "amd64",
|
||||
},
|
||||
{
|
||||
name: "DuplicateSelectors",
|
||||
|
@ -2881,6 +2884,10 @@ func TestSelect(t *testing.T) {
|
|||
},
|
||||
} {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
if tt.onlyArch != "" && runtime.GOARCH != tt.onlyArch {
|
||||
t.Skipf("Expected outputs of %s only valid when GOARCH = %s", tt.name, tt.onlyArch)
|
||||
}
|
||||
|
||||
shardMapper := ShardMapper{
|
||||
MapShardsFn: func(_ context.Context, sources influxql.Sources, _ influxql.TimeRange) query.ShardGroup {
|
||||
var fields map[string]influxql.DataType
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package testing
|
||||
|
||||
import "runtime"
|
||||
|
||||
var FluxEndToEndSkipList = map[string]map[string]string{
|
||||
"universe": {
|
||||
// TODO(adam) determine the reason for these test failures.
|
||||
|
@ -175,6 +177,12 @@ var FluxEndToEndSkipList = map[string]map[string]string{
|
|||
},
|
||||
}
|
||||
|
||||
func init() {
|
||||
if runtime.GOOS != "amd64" {
|
||||
FluxEndToEndSkipList["universe"]["holt_winters"] = "expected HoltWinters outputs only valid on amd64"
|
||||
}
|
||||
}
|
||||
|
||||
type PerTestFeatureFlagMap = map[string]map[string]map[string]string
|
||||
|
||||
var FluxEndToEndFeatureFlags = PerTestFeatureFlagMap{}
|
||||
|
|
Loading…
Reference in New Issue