diff --git a/.circleci/config.yml b/.circleci/config.yml index 4c60f84d91a0f..c9328ddbce3e3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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: @@ -492,6 +503,10 @@ workflows: filters: tags: only: /.*/ + - 'test-integration': + filters: + tags: + only: /.*/ - 'windows-package': requires: - 'test-go-windows' diff --git a/plugins/common/proxy/socks5_test.go b/plugins/common/proxy/socks5_test.go index a82ebf1098890..33fa4b4aab724 100644 --- a/plugins/common/proxy/socks5_test.go +++ b/plugins/common/proxy/socks5_test.go @@ -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") } diff --git a/plugins/inputs/cloud_pubsub/cloud_pubsub_test.go b/plugins/inputs/cloud_pubsub/cloud_pubsub_test.go index 486de9645c8d1..e27c1e8104bcf 100644 --- a/plugins/inputs/cloud_pubsub/cloud_pubsub_test.go +++ b/plugins/inputs/cloud_pubsub/cloud_pubsub_test.go @@ -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{} diff --git a/plugins/inputs/elasticsearch_query/elasticsearch_query_test.go b/plugins/inputs/elasticsearch_query/elasticsearch_query_test.go index e7f461d43a1f9..d18c13afdee05 100644 --- a/plugins/inputs/elasticsearch_query/elasticsearch_query_test.go +++ b/plugins/inputs/elasticsearch_query/elasticsearch_query_test.go @@ -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") } @@ -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") } diff --git a/plugins/inputs/redis_sentinel/redis_sentinel_test.go b/plugins/inputs/redis_sentinel/redis_sentinel_test.go index f259e63af70ff..506d17778cb98 100644 --- a/plugins/inputs/redis_sentinel/redis_sentinel_test.go +++ b/plugins/inputs/redis_sentinel/redis_sentinel_test.go @@ -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") } diff --git a/plugins/inputs/sql/sql_test.go b/plugins/inputs/sql/sql_test.go index 22796159fc3e6..9ad7dcf7e3be2 100644 --- a/plugins/inputs/sql/sql_test.go +++ b/plugins/inputs/sql/sql_test.go @@ -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") } @@ -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") } @@ -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") } diff --git a/plugins/outputs/elasticsearch/elasticsearch_test.go b/plugins/outputs/elasticsearch/elasticsearch_test.go index e9b919d1e8d52..0ddbe672a1542 100644 --- a/plugins/outputs/elasticsearch/elasticsearch_test.go +++ b/plugins/outputs/elasticsearch/elasticsearch_test.go @@ -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") } @@ -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") } @@ -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") } @@ -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") } diff --git a/plugins/outputs/event_hubs/event_hubs_test.go b/plugins/outputs/event_hubs/event_hubs_test.go index 9b17aef605833..74d461cceabe0 100644 --- a/plugins/outputs/event_hubs/event_hubs_test.go +++ b/plugins/outputs/event_hubs/event_hubs_test.go @@ -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") } diff --git a/plugins/outputs/kafka/kafka_test.go b/plugins/outputs/kafka/kafka_test.go index adfcf862450d7..b7fa73ea87f67 100644 --- a/plugins/outputs/kafka/kafka_test.go +++ b/plugins/outputs/kafka/kafka_test.go @@ -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) @@ -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.") diff --git a/plugins/outputs/newrelic/newrelic_test.go b/plugins/outputs/newrelic/newrelic_test.go index e545a1ac94e03..823902f18077e 100644 --- a/plugins/outputs/newrelic/newrelic_test.go +++ b/plugins/outputs/newrelic/newrelic_test.go @@ -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) diff --git a/plugins/outputs/sql/sql_test.go b/plugins/outputs/sql/sql_test.go index b54826ab97246..f1227577a3a67 100644 --- a/plugins/outputs/sql/sql_test.go +++ b/plugins/outputs/sql/sql_test.go @@ -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") } diff --git a/plugins/processors/reverse_dns/reverse_dns_test.go b/plugins/processors/reverse_dns/reverse_dns_test.go index 3ca39bbb800b0..9457ed670826a 100644 --- a/plugins/processors/reverse_dns/reverse_dns_test.go +++ b/plugins/processors/reverse_dns/reverse_dns_test.go @@ -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") } diff --git a/testutil/container_test.go b/testutil/container_test.go index bde0ce5615006..eefaab7bea9ef 100644 --- a/testutil/container_test.go +++ b/testutil/container_test.go @@ -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") } @@ -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") } @@ -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") }