diff --git a/Makefile b/Makefile index 9abf36c6b114..4b3f2786820a 100644 --- a/Makefile +++ b/Makefile @@ -38,6 +38,7 @@ E2E_WAIT_TIMEOUT ?= 90s # timeout for wait conditions E2E_PARALLEL ?= 20 E2E_SUITE_TIMEOUT ?= 15m GOTEST ?= go test -v -p 20 +ALL_BUILD_TAGS ?= api,cli,cron,executor,examples,corefunctional,functional,plugins # should we build the static files? ifneq (,$(filter $(MAKECMDGOALS),codegen lint test docs start)) @@ -608,8 +609,10 @@ test-%-sdk: make --directory sdks/$* install test -B Test%: - E2E_WAIT_TIMEOUT=$(E2E_WAIT_TIMEOUT) go test -failfast -v -timeout $(E2E_SUITE_TIMEOUT) -count 1 --tags api,cli,cron,executor,examples,corefunctional,functional,plugins -parallel $(E2E_PARALLEL) ./test/e2e -run='.*/$*' + E2E_WAIT_TIMEOUT=$(E2E_WAIT_TIMEOUT) go test -failfast -v -timeout $(E2E_SUITE_TIMEOUT) -count 1 --tags $(ALL_BUILD_TAGS) -parallel $(E2E_PARALLEL) ./test/e2e -run='.*/$*' +Benchmark%: + go test --tags $(ALL_BUILD_TAGS) ./test/e2e -run='$@' -benchmem -bench . # clean diff --git a/docs/running-locally.md b/docs/running-locally.md index 2aa3fec83511..ff608b417f92 100644 --- a/docs/running-locally.md +++ b/docs/running-locally.md @@ -154,7 +154,7 @@ To test SSO integration, use `PROFILE=sso`: make start UI=true PROFILE=sso ``` -## TLS +### TLS By default, `make start` will start Argo in [plain text mode](tls.md#plain-text). To simulate a TLS proxy in front of Argo, use `UI_SECURE=true` (which implies `UI=true`): diff --git a/test/e2e/fixtures/e2e_suite.go b/test/e2e/fixtures/e2e_suite.go index 8aa92d4696fc..9f4dab8b149a 100644 --- a/test/e2e/fixtures/e2e_suite.go +++ b/test/e2e/fixtures/e2e_suite.go @@ -175,7 +175,7 @@ func (s *E2ESuite) DeleteResources() { // delete archived workflows from the archive if s.Persistence.IsEnabled() { - archive := s.Persistence.workflowArchive + archive := s.Persistence.WorkflowArchive parse, err := labels.ParseToRequirements(Label) s.CheckError(err) workflows, err := archive.ListWorkflows(utils.ListOptions{ diff --git a/test/e2e/fixtures/persistence.go b/test/e2e/fixtures/persistence.go index 6d0309bec097..123e23d340cd 100644 --- a/test/e2e/fixtures/persistence.go +++ b/test/e2e/fixtures/persistence.go @@ -10,9 +10,9 @@ import ( ) type Persistence struct { + WorkflowArchive sqldb.WorkflowArchive session db.Session offloadNodeStatusRepo sqldb.OffloadNodeStatusRepo - workflowArchive sqldb.WorkflowArchive } func newPersistence(kubeClient kubernetes.Interface, wcConfig *config.Config) *Persistence { @@ -38,9 +38,9 @@ func newPersistence(kubeClient kubernetes.Interface, wcConfig *config.Config) *P } instanceIDService := instanceid.NewService(wcConfig.InstanceID) workflowArchive := sqldb.NewWorkflowArchive(session, persistence.GetClusterName(), Namespace, instanceIDService) - return &Persistence{session, offloadNodeStatusRepo, workflowArchive} + return &Persistence{workflowArchive, session, offloadNodeStatusRepo} } else { - return &Persistence{offloadNodeStatusRepo: sqldb.ExplosiveOffloadNodeStatusRepo, workflowArchive: sqldb.NullWorkflowArchive} + return &Persistence{offloadNodeStatusRepo: sqldb.ExplosiveOffloadNodeStatusRepo, WorkflowArchive: sqldb.NullWorkflowArchive} } } diff --git a/test/e2e/workflow_archive_test.go b/test/e2e/workflow_archive_test.go new file mode 100644 index 000000000000..ce00e5ccf064 --- /dev/null +++ b/test/e2e/workflow_archive_test.go @@ -0,0 +1,42 @@ +//go:build functional + +package e2e + +import ( + "testing" + + sutils "github.com/argoproj/argo-workflows/v3/server/utils" + "github.com/argoproj/argo-workflows/v3/test/e2e/fixtures" +) + +func BenchmarkWorkflowArchive(b *testing.B) { + // Workaround for https://github.com/stretchr/testify/issues/811 + suite := fixtures.E2ESuite{} + suite.SetT(&testing.T{}) + suite.SetupSuite() + b.ResetTimer() + + b.Run("ListWorkflows", func(b *testing.B) { + for range b.N { + wfs, err := suite.Persistence.WorkflowArchive.ListWorkflows(sutils.ListOptions{ + Limit: 100, + }) + if err != nil { + b.Fatal(err) + } + b.Logf("Found %d workflows", wfs.Len()) + } + }) + + b.Run("CountWorkflows", func(b *testing.B) { + for range b.N { + wfCount, err := suite.Persistence.WorkflowArchive.CountWorkflows(sutils.ListOptions{}) + if err != nil { + b.Fatal(err) + } + b.Logf("Found %d workflows", wfCount) + } + }) + + suite.TearDownSuite() +}