diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dd148204783..977fb0e8d57 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -86,6 +86,7 @@ jobs: test-target: [ test-e2e, + test-e2e-api, test-integration-poller, test-e2e-deployments, test-e2e-serverless, diff --git a/.gitignore b/.gitignore index 824e47ac5b6..9833822a570 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,7 @@ /tempodb/encoding/benchmark_block private-key.key integration/e2e/e2e_integration_test[0-9]* +integration/e2e/api/e2e_integration_test[0-9]* integration/e2e/deployments/e2e_integration_test[0-9]* .tempo.yaml /tmp diff --git a/Makefile b/Makefile index 596fcdf4c2f..3cc82227e47 100644 --- a/Makefile +++ b/Makefile @@ -140,6 +140,11 @@ test-e2e-serverless: tools docker-tempo docker-serverless ## Run serverless end test-e2e-deployments: tools docker-tempo docker-tempo-query ## Run end to end tests for deployments $(GOTEST) -v $(GOTEST_OPT) ./integration/e2e/deployments +# runs only api e2e tests +.PHONY: test-e2e-api +test-e2e-api: tools docker-tempo docker-tempo-query ## Run end to end tests for api + $(GOTEST) -v $(GOTEST_OPT) ./integration/e2e/api + # runs only poller integration tests .PHONY: test-integration-poller test-integration-poller: tools ## Run poller integration tests @@ -147,7 +152,7 @@ test-integration-poller: tools ## Run poller integration tests # test-all/bench use a docker image so build it first to make sure we're up to date .PHONY: test-all ## Run all tests -test-all: test-with-cover test-e2e test-e2e-serverless test-e2e-deployments test-integration-poller +test-all: test-with-cover test-e2e test-e2e-serverless test-e2e-deployments test-e2e-api test-integration-poller .PHONY: test-bench test-bench: tools docker-tempo ## Run all benchmarks diff --git a/integration/e2e/api_test.go b/integration/e2e/api/api_test.go similarity index 99% rename from integration/e2e/api_test.go rename to integration/e2e/api/api_test.go index aa8497491a8..019ccc3cbda 100644 --- a/integration/e2e/api_test.go +++ b/integration/e2e/api/api_test.go @@ -1,4 +1,4 @@ -package e2e +package api import ( "context" @@ -23,8 +23,9 @@ import ( ) const ( - spanX = "span.x" - resourceX = "resource.xx" + configAllInOneLocal = "../deployments/config-all-in-one-local.yaml" + spanX = "span.x" + resourceX = "resource.xx" ) func TestSearchTagsV2(t *testing.T) { diff --git a/integration/e2e/compression_test.go b/integration/e2e/api/compression_test.go similarity index 96% rename from integration/e2e/compression_test.go rename to integration/e2e/api/compression_test.go index 8388846d8d1..f4ad6288f17 100644 --- a/integration/e2e/compression_test.go +++ b/integration/e2e/api/compression_test.go @@ -1,4 +1,4 @@ -package e2e +package api import ( "compress/gzip" @@ -17,7 +17,7 @@ import ( ) const ( - configCompression = "deployments/config-all-in-one-local.yaml" + configCompression = "../deployments/config-all-in-one-local.yaml" ) func TestCompression(t *testing.T) { diff --git a/integration/e2e/config-cross-cluster-a.yaml b/integration/e2e/api/config-cross-cluster-a.yaml similarity index 100% rename from integration/e2e/config-cross-cluster-a.yaml rename to integration/e2e/api/config-cross-cluster-a.yaml diff --git a/integration/e2e/config-cross-cluster-b.yaml b/integration/e2e/api/config-cross-cluster-b.yaml similarity index 100% rename from integration/e2e/config-cross-cluster-b.yaml rename to integration/e2e/api/config-cross-cluster-b.yaml diff --git a/integration/e2e/config-https.yaml b/integration/e2e/api/config-https.yaml similarity index 100% rename from integration/e2e/config-https.yaml rename to integration/e2e/api/config-https.yaml diff --git a/integration/e2e/config-multi-tenant-local.yaml b/integration/e2e/api/config-multi-tenant-local.yaml similarity index 100% rename from integration/e2e/config-multi-tenant-local.yaml rename to integration/e2e/api/config-multi-tenant-local.yaml diff --git a/integration/e2e/config-plugin-test.yaml b/integration/e2e/api/config-plugin-test.yaml similarity index 100% rename from integration/e2e/config-plugin-test.yaml rename to integration/e2e/api/config-plugin-test.yaml diff --git a/integration/e2e/config-query-range.yaml b/integration/e2e/api/config-query-range.yaml similarity index 100% rename from integration/e2e/config-query-range.yaml rename to integration/e2e/api/config-query-range.yaml diff --git a/integration/e2e/config-tempo-query.yaml b/integration/e2e/api/config-tempo-query.yaml similarity index 100% rename from integration/e2e/config-tempo-query.yaml rename to integration/e2e/api/config-tempo-query.yaml diff --git a/integration/e2e/cross_cluster_reads_test.go b/integration/e2e/api/cross_cluster_reads_test.go similarity index 99% rename from integration/e2e/cross_cluster_reads_test.go rename to integration/e2e/api/cross_cluster_reads_test.go index 8edf940f305..a96e9e8d0a9 100644 --- a/integration/e2e/cross_cluster_reads_test.go +++ b/integration/e2e/api/cross_cluster_reads_test.go @@ -1,4 +1,4 @@ -package e2e +package api import ( "testing" diff --git a/integration/e2e/https_test.go b/integration/e2e/api/https_test.go similarity index 99% rename from integration/e2e/https_test.go rename to integration/e2e/api/https_test.go index cdee96dc049..1c35b77d021 100644 --- a/integration/e2e/https_test.go +++ b/integration/e2e/api/https_test.go @@ -1,4 +1,4 @@ -package e2e +package api import ( "context" diff --git a/integration/e2e/multi_tenant_test.go b/integration/e2e/api/multi_tenant_test.go similarity index 98% rename from integration/e2e/multi_tenant_test.go rename to integration/e2e/api/multi_tenant_test.go index f63ca403526..9808e23d9e6 100644 --- a/integration/e2e/multi_tenant_test.go +++ b/integration/e2e/api/multi_tenant_test.go @@ -1,4 +1,4 @@ -package e2e +package api import ( "context" @@ -66,7 +66,8 @@ func testSearch(t *testing.T, tenant string, tenantSize int) { require.NoError(t, util.CopyFileToSharedDir(s, configMultiTenant, "config.yaml")) tempo := util.NewTempoAllInOne() - require.NoError(t, s.StartAndWaitReady(tempo, newPrometheus())) + prometheus := util.NewPrometheus() + require.NoError(t, s.StartAndWaitReady(tempo, prometheus)) // Get port for the Jaeger gRPC receiver endpoint c, err := util.NewJaegerGRPCClient(tempo.Endpoint(14250)) diff --git a/integration/e2e/query_plugin_test.go b/integration/e2e/api/query_plugin_test.go similarity index 99% rename from integration/e2e/query_plugin_test.go rename to integration/e2e/api/query_plugin_test.go index a291580bb85..f7472dddc91 100644 --- a/integration/e2e/query_plugin_test.go +++ b/integration/e2e/api/query_plugin_test.go @@ -1,4 +1,4 @@ -package e2e +package api import ( "context" diff --git a/integration/e2e/query_range_test.go b/integration/e2e/api/query_range_test.go similarity index 99% rename from integration/e2e/query_range_test.go rename to integration/e2e/api/query_range_test.go index 821cb9b1c20..f8e5f215144 100644 --- a/integration/e2e/query_range_test.go +++ b/integration/e2e/api/query_range_test.go @@ -1,4 +1,4 @@ -package e2e +package api import ( "context" diff --git a/integration/e2e/metrics_generator_test.go b/integration/e2e/metrics_generator_test.go index d6c5d5b9e42..bee28142ccc 100644 --- a/integration/e2e/metrics_generator_test.go +++ b/integration/e2e/metrics_generator_test.go @@ -24,7 +24,6 @@ import ( const ( configMetricsGenerator = "config-metrics-generator.yaml" configMetricsGeneratorTargetInfo = "config-metrics-generator-targetinfo.yaml" - prometheusImage = "prom/prometheus:latest" ) func TestMetricsGenerator(t *testing.T) { @@ -36,7 +35,7 @@ func TestMetricsGenerator(t *testing.T) { tempoDistributor := util.NewTempoDistributor() tempoIngester := util.NewTempoIngester(1) tempoMetricsGenerator := util.NewTempoMetricsGenerator() - prometheus := newPrometheus() + prometheus := util.NewPrometheus() require.NoError(t, s.StartAndWaitReady(tempoDistributor, tempoIngester, tempoMetricsGenerator, prometheus)) // Wait until ingester and metrics-generator are active @@ -225,7 +224,7 @@ func TestMetricsGeneratorTargetInfoEnabled(t *testing.T) { tempoDistributor := util.NewTempoDistributor() tempoIngester := util.NewTempoIngester(1) tempoMetricsGenerator := util.NewTempoMetricsGenerator() - prometheus := newPrometheus() + prometheus := util.NewPrometheus() require.NoError(t, s.StartAndWaitReady(tempoDistributor, tempoIngester, tempoMetricsGenerator, prometheus)) // Wait until ingester and metrics-generator are active @@ -387,16 +386,6 @@ func TestMetricsGeneratorTargetInfoEnabled(t *testing.T) { assert.NoError(t, tempoMetricsGenerator.WaitSumMetrics(e2e.Equals(25), "tempo_metrics_generator_registry_series_added_total")) } -func newPrometheus() *e2e.HTTPService { - return e2e.NewHTTPService( - "prometheus", - prometheusImage, - e2e.NewCommandWithoutEntrypoint("/bin/prometheus", "--config.file=/etc/prometheus/prometheus.yml", "--web.enable-remote-write-receiver"), - e2e.NewHTTPReadinessProbe(9090, "/-/ready", 200, 299), - 9090, - ) -} - // extractMetricsFromPrometheus extracts metrics stored in Prometheus using the /federate endpoint. func extractMetricsFromPrometheus(prometheus *e2e.HTTPService, matcher string) (map[string]*io_prometheus_client.MetricFamily, error) { url := fmt.Sprintf("http://%s/federate?match[]=%s", prometheus.HTTPEndpoint(), url.QueryEscape(matcher)) diff --git a/integration/util/util.go b/integration/util/util.go index 8e81e2b8887..76a1fa03c8e 100644 --- a/integration/util/util.go +++ b/integration/util/util.go @@ -44,10 +44,11 @@ import ( ) const ( - image = "tempo:latest" - debugImage = "tempo-debug:latest" - queryImage = "tempo-query:latest" - jaegerImage = "jaegertracing/jaeger-query:1.64.0" + image = "tempo:latest" + debugImage = "tempo-debug:latest" + queryImage = "tempo-query:latest" + jaegerImage = "jaegertracing/jaeger-query:1.64.0" + prometheusImage = "prom/prometheus:latest" ) // GetExtraArgs returns the extra args to pass to the Docker command used to run Tempo. @@ -640,3 +641,13 @@ func SpanCount(a *tempopb.Trace) float64 { return float64(count) } + +func NewPrometheus() *e2e.HTTPService { + return e2e.NewHTTPService( + "prometheus", + prometheusImage, + e2e.NewCommandWithoutEntrypoint("/bin/prometheus", "--config.file=/etc/prometheus/prometheus.yml", "--web.enable-remote-write-receiver"), + e2e.NewHTTPReadinessProbe(9090, "/-/ready", 200, 299), + 9090, + ) +}