Skip to content

Commit

Permalink
test: split unit and integrations suites to parallelize (#12039)
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorwhitney authored Feb 22, 2024
1 parent dbea8ba commit 782b938
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 2 deletions.
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ run:
- linux
- cgo
- promtail_journal_enabled
- integration

# which dirs to skip: they won't be analyzed;
# can use regexp here: generated.*, regexp is applied on full path;
Expand Down
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,12 @@ lint: ## run linters
########

test: all ## run the unit tests
$(GOTEST) -covermode=atomic -coverprofile=coverage.txt -p=4 ./... | sed "s:$$: ${DRONE_STEP_NAME} ${DRONE_SOURCE_BRANCH}:" | tee test_results.txt
cd tools/lambda-promtail/ && $(GOTEST) -covermode=atomic -coverprofile=lambda-promtail-coverage.txt -p=4 ./... | sed "s:$$: ${DRONE_STEP_NAME} ${DRONE_SOURCE_BRANCH}:" | tee lambda_promtail_test_results.txt
$(GOTEST) -covermode=atomic -coverprofile=coverage.txt -p=4 ./... | tee test_results.txt
cd tools/lambda-promtail/ && $(GOTEST) -covermode=atomic -coverprofile=lambda-promtail-coverage.txt -p=4 ./... | tee lambda_promtail_test_results.txt

test-integration:
$(GOTEST) -count=1 -v -tags=integration -timeout 10m ./integration

compare-coverage:
./tools/diff_coverage.sh $(old) $(new) $(packages)

Expand Down
2 changes: 2 additions & 0 deletions integration/loki_micro_services_delete_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build integration

package integration

import (
Expand Down
1 change: 1 addition & 0 deletions integration/loki_micro_services_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build integration
package integration

import (
Expand Down
1 change: 1 addition & 0 deletions integration/loki_rule_eval_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build integration
package integration

import (
Expand Down
1 change: 1 addition & 0 deletions integration/loki_simple_scalable_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build integration
package integration

import (
Expand Down
1 change: 1 addition & 0 deletions integration/loki_single_binary_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build integration
package integration

import (
Expand Down
1 change: 1 addition & 0 deletions integration/multi_tenant_queries_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build integration
package integration

import (
Expand Down
1 change: 1 addition & 0 deletions integration/parse_metrics.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build integration
package integration

import (
Expand Down
1 change: 1 addition & 0 deletions integration/parse_metrics_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build integration
package integration

import (
Expand Down
1 change: 1 addition & 0 deletions integration/per_request_limits_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build integration
package integration

import (
Expand Down
2 changes: 2 additions & 0 deletions integration/shared_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build integration

package integration

import (
Expand Down

0 comments on commit 782b938

Please sign in to comment.