Skip to content

Commit

Permalink
fix: ensure CI tests runs against i386 (influxdata#10457)
Browse files Browse the repository at this point in the history
  • Loading branch information
powersj authored Jan 18, 2022
1 parent 9d8cf9b commit 80580c0
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 10 deletions.
36 changes: 33 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ commands:
os:
type: string
default: "linux"
arch:
type: string
default: "amd64"
gotestsum:
type: string
default: "gotestsum"
Expand Down Expand Up @@ -78,7 +81,7 @@ commands:
- run: ./scripts/install_gotestsum.sh << parameters.os >> << parameters.gotestsum >>
- run: |
PACKAGE_NAMES=$(go list ./... | circleci tests split --split-by=timings --timings-type=classname)
./<< parameters.gotestsum >> --junitfile test-results/gotestsum-report.xml -- -short $PACKAGE_NAMES
GOARCH=<< parameters.arch >> ./<< parameters.gotestsum >> --junitfile test-results/gotestsum-report.xml -- -short $PACKAGE_NAMES
- store_test_results:
path: test-results
- when:
Expand Down Expand Up @@ -166,6 +169,28 @@ jobs:
root: '/go'
paths:
- '*'
test-go-linux-386:
executor: go-1_17
parallelism: 4
steps:
- checkout
- restore_cache:
key: go-mod-v1-{{ checksum "go.sum" }}
- check-changed-files-or-halt
- run: 'GOARCH=386 make deps'
- run: 'GOARCH=386 make tidy'
- run: 'GOARCH=386 make check'
- test-go:
arch: "386"
- save_cache:
name: 'go module cache'
key: go-mod-v1-{{ checksum "go.sum" }}
paths:
- '/go/pkg/mod'
- persist_to_workspace:
root: '/go'
paths:
- '*'
test-go-mac:
executor: mac
steps:
Expand Down Expand Up @@ -415,6 +440,10 @@ workflows:
filters:
tags:
only: /.*/
- 'test-go-linux-386':
filters:
tags:
only: /.*/
- 'test-go-mac':
filters:
tags: # only runs on tags if you specify this filter
Expand Down Expand Up @@ -443,7 +472,7 @@ workflows:
only: /.*/
- 'i386-package':
requires:
- 'test-go-linux'
- 'test-go-linux-386'
filters:
tags:
only: /.*/
Expand Down Expand Up @@ -585,6 +614,7 @@ workflows:
nightly:
jobs:
- 'test-go-linux'
- 'test-go-linux-386'
- 'test-go-mac'
- 'test-go-windows'
- 'windows-package':
Expand All @@ -606,7 +636,7 @@ workflows:
name: 'i386-package-nightly'
nightly: true
requires:
- 'test-go-linux'
- 'test-go-linux-386'
- 'ppc64le-package':
name: 'ppc64le-package-nightly'
nightly: true
Expand Down
4 changes: 4 additions & 0 deletions plugins/inputs/phpfpm/phpfpm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,10 @@ func TestPhpFpmDefaultGetFromLocalhost(t *testing.T) {
}

func TestPhpFpmGeneratesMetrics_Throw_Error_When_Fpm_Status_Is_Not_Responding(t *testing.T) {
if testing.Short() {
t.Skip("Skipping long test in short mode")
}

r := &phpfpm{
Urls: []string{"http://aninvalidone"},
}
Expand Down
14 changes: 7 additions & 7 deletions plugins/processors/noise/noise_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func TestAddNoiseOverflowCheck(t *testing.T) {
input: []telegraf.Metric{
testutil.MustMetric("underflow_int64",
map[string]string{},
map[string]interface{}{"value": math.MinInt64},
map[string]interface{}{"value": int64(math.MinInt64)},
time.Unix(0, 0),
),
testutil.MustMetric("underflow_uint64_1",
Expand All @@ -207,7 +207,7 @@ func TestAddNoiseOverflowCheck(t *testing.T) {
expected: []telegraf.Metric{
testutil.MustMetric("underflow_int64",
map[string]string{},
map[string]interface{}{"value": math.MinInt64},
map[string]interface{}{"value": int64(math.MinInt64)},
time.Unix(0, 0),
),
testutil.MustMetric("underflow_uint64_1",
Expand All @@ -228,12 +228,12 @@ func TestAddNoiseOverflowCheck(t *testing.T) {
input: []telegraf.Metric{
testutil.MustMetric("overflow_int64",
map[string]string{},
map[string]interface{}{"value": math.MaxInt64},
map[string]interface{}{"value": int64(math.MaxInt64)},
time.Unix(0, 0),
),
testutil.MustMetric("overflow_uint",
map[string]string{},
map[string]interface{}{"value": uint(math.MaxUint)},
map[string]interface{}{"value": uint64(math.MaxUint)},
time.Unix(0, 0),
),
testutil.MustMetric("overflow_uint64",
Expand All @@ -245,12 +245,12 @@ func TestAddNoiseOverflowCheck(t *testing.T) {
expected: []telegraf.Metric{
testutil.MustMetric("overflow_int64",
map[string]string{},
map[string]interface{}{"value": math.MaxInt64},
map[string]interface{}{"value": int64(math.MaxInt64)},
time.Unix(0, 0),
),
testutil.MustMetric("overflow_uint",
map[string]string{},
map[string]interface{}{"value": uint(math.MaxUint)},
map[string]interface{}{"value": uint64(math.MaxUint)},
time.Unix(0, 0),
),
testutil.MustMetric("overflow_uint64",
Expand All @@ -259,7 +259,7 @@ func TestAddNoiseOverflowCheck(t *testing.T) {
time.Unix(0, 0),
),
},
distribution: &testDistribution{value: 1.0},
distribution: &testDistribution{value: 0.0},
},
{
name: "non-numeric fields",
Expand Down

0 comments on commit 80580c0

Please sign in to comment.