Skip to content

Commit

Permalink
test: add circle ci integration testing on PRs (#11246)
Browse files Browse the repository at this point in the history
  • Loading branch information
powersj authored and MyaLongmire committed Jul 6, 2022
1 parent 524054a commit 0cc60d2
Show file tree
Hide file tree
Showing 13 changed files with 35 additions and 32 deletions.
15 changes: 15 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,17 @@ jobs:
- run: 'GOARCH=386 make check'
- test-go:
arch: "386"
test-integration:
machine:
image: ubuntu-2204:current
resource_class: large
steps:
- checkout
- restore_cache:
key: go-mod-v1-{{ checksum "go.sum" }}
- check-changed-files-or-halt
- run: 'make deps'
- run: 'make test-integration'
test-go-mac:
executor: mac
steps:
Expand Down Expand Up @@ -492,6 +503,10 @@ workflows:
filters:
tags:
only: /.*/
- 'test-integration':
filters:
tags:
only: /.*/
- 'windows-package':
requires:
- 'test-go-windows'
Expand Down
2 changes: 1 addition & 1 deletion plugins/common/proxy/socks5_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/stretchr/testify/require"
)

func TestSocks5ProxyConfig(t *testing.T) {
func TestSocks5ProxyConfigIntegration(t *testing.T) {
if testing.Short() {
t.Skip("Skipping integration test in short mode")
}
Expand Down
5 changes: 0 additions & 5 deletions plugins/inputs/cloud_pubsub/cloud_pubsub_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,6 @@ func TestRunOverlongMessages(t *testing.T) {
}

func TestRunErrorInSubscriber(t *testing.T) {
// hard-coded retry in seconds
if testing.Short() {
t.Skip("Skipping long test in short mode")
}

subID := "sub-unexpected-error"

acc := &testutil.Accumulator{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ func setupIntegrationTest(t *testing.T) (*testutil.Container, error) {
return &container, nil
}

func TestElasticsearchQuery(t *testing.T) {
func TestElasticsearchQueryIntegration(t *testing.T) {
if testing.Short() {
t.Skip("Skipping integration test in short mode")
}
Expand Down Expand Up @@ -658,7 +658,7 @@ func TestElasticsearchQuery(t *testing.T) {
}
}

func TestElasticsearchQuery_getMetricFields(t *testing.T) {
func TestElasticsearchQueryIntegration_getMetricFields(t *testing.T) {
if testing.Short() {
t.Skip("Skipping integration test in short mode")
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/inputs/redis_sentinel/redis_sentinel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (

const masterName = "mymaster"

func TestRedisSentinelConnect(t *testing.T) {
func TestRedisSentinelConnectIntegration(t *testing.T) {
if testing.Short() {
t.Skip("Skipping integration test in short mode")
}
Expand Down
6 changes: 3 additions & 3 deletions plugins/inputs/sql/sql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func pwgen(n int) string {
return string(buffer)
}

func TestMariaDB(t *testing.T) {
func TestMariaDBIntegration(t *testing.T) {
if testing.Short() {
t.Skip("Skipping integration test in short mode")
}
Expand Down Expand Up @@ -136,7 +136,7 @@ func TestMariaDB(t *testing.T) {
}
}

func TestPostgreSQL(t *testing.T) {
func TestPostgreSQLIntegration(t *testing.T) {
if testing.Short() {
t.Skip("Skipping integration test in short mode")
}
Expand Down Expand Up @@ -243,7 +243,7 @@ func TestPostgreSQL(t *testing.T) {
}
}

func TestClickHouse(t *testing.T) {
func TestClickHouseIntegration(t *testing.T) {
if testing.Short() {
t.Skip("Skipping integration test in short mode")
}
Expand Down
8 changes: 4 additions & 4 deletions plugins/outputs/elasticsearch/elasticsearch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func TestConnectAndWriteIntegration(t *testing.T) {
require.NoError(t, err)
}

func TestConnectAndWriteMetricWithNaNValueEmpty(t *testing.T) {
func TestConnectAndWriteMetricWithNaNValueEmptyIntegration(t *testing.T) {
if testing.Short() {
t.Skip("Skipping integration test in short mode")
}
Expand Down Expand Up @@ -117,7 +117,7 @@ func TestConnectAndWriteMetricWithNaNValueEmpty(t *testing.T) {
}
}

func TestConnectAndWriteMetricWithNaNValueNone(t *testing.T) {
func TestConnectAndWriteMetricWithNaNValueNoneIntegration(t *testing.T) {
if testing.Short() {
t.Skip("Skipping integration test in short mode")
}
Expand Down Expand Up @@ -161,7 +161,7 @@ func TestConnectAndWriteMetricWithNaNValueNone(t *testing.T) {
}
}

func TestConnectAndWriteMetricWithNaNValueDrop(t *testing.T) {
func TestConnectAndWriteMetricWithNaNValueDropIntegration(t *testing.T) {
if testing.Short() {
t.Skip("Skipping integration test in short mode")
}
Expand Down Expand Up @@ -205,7 +205,7 @@ func TestConnectAndWriteMetricWithNaNValueDrop(t *testing.T) {
}
}

func TestConnectAndWriteMetricWithNaNValueReplacement(t *testing.T) {
func TestConnectAndWriteMetricWithNaNValueReplacementIntegration(t *testing.T) {
if testing.Short() {
t.Skip("Skipping integration test in short mode")
}
Expand Down
4 changes: 0 additions & 4 deletions plugins/outputs/event_hubs/event_hubs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,6 @@ func TestInitAndWrite(t *testing.T) {
*/

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

if os.Getenv("EVENTHUB_CONNECTION_STRING") == "" {
t.Skip("Missing environment variable EVENTHUB_CONNECTION_STRING")
}
Expand Down
4 changes: 2 additions & 2 deletions plugins/outputs/kafka/kafka_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func TestConnectAndWriteIntegration(t *testing.T) {
k.Close()
}

func TestTopicSuffixesIntegration(t *testing.T) {
func TestTopicSuffixes(t *testing.T) {
topic := "Test"

m := testutil.TestMetric(1)
Expand Down Expand Up @@ -138,7 +138,7 @@ func TestTopicSuffixesIntegration(t *testing.T) {
}
}

func TestValidateTopicSuffixMethodIntegration(t *testing.T) {
func TestValidateTopicSuffixMethod(t *testing.T) {
err := ValidateTopicSuffixMethod("invalid_topic_suffix_method")
require.Error(t, err, "Topic suffix method used should be invalid.")

Expand Down
3 changes: 0 additions & 3 deletions plugins/outputs/newrelic/newrelic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ func TestBasic(t *testing.T) {
InsightsKey: "12345",
Timeout: config.Duration(time.Second * 5),
}
if testing.Short() {
t.Skip("skipping test in short mode.")
}

err := nr.Connect()
require.NoError(t, err)
Expand Down
6 changes: 3 additions & 3 deletions plugins/outputs/sql/sql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@ import (
"github.com/testcontainers/testcontainers-go/wait"
)

func TestSqlQuote(t *testing.T) {
func TestSqlQuoteIntegration(t *testing.T) {
if testing.Short() {
t.Skip("Skipping integration test in short mode")
}
}

func TestSqlCreateStatement(t *testing.T) {
func TestSqlCreateStatementIntegration(t *testing.T) {
if testing.Short() {
t.Skip("Skipping integration test in short mode")
}
}

func TestSqlInsertStatement(t *testing.T) {
func TestSqlInsertStatementIntegration(t *testing.T) {
if testing.Short() {
t.Skip("Skipping integration test in short mode")
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/processors/reverse_dns/reverse_dns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/influxdata/telegraf/testutil"
)

func TestSimpleReverseLookup(t *testing.T) {
func TestSimpleReverseLookupIntegration(t *testing.T) {
if testing.Short() {
t.Skip("Skipping integration test in short mode")
}
Expand Down
6 changes: 3 additions & 3 deletions testutil/container_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/stretchr/testify/require"
)

func TestEmptyContainer(t *testing.T) {
func TestEmptyContainerIntegration(t *testing.T) {
if testing.Short() {
t.Skip("Skipping integration test in short mode")
}
Expand All @@ -22,7 +22,7 @@ func TestEmptyContainer(t *testing.T) {
require.NoError(t, err)
}

func TestMappedPortLookup(t *testing.T) {
func TestMappedPortLookupIntegration(t *testing.T) {
if testing.Short() {
t.Skip("Skipping integration test in short mode")
}
Expand Down Expand Up @@ -59,7 +59,7 @@ func TestMappedPortLookup(t *testing.T) {
}
}

func TestBadImageName(t *testing.T) {
func TestBadImageNameIntegration(t *testing.T) {
if testing.Short() {
t.Skip("Skipping integration test in short mode")
}
Expand Down

0 comments on commit 0cc60d2

Please sign in to comment.