Skip to content

Commit fd1f6ab

Browse files
Feature/add benchmark tests for v2 (#710)
* Add benchmark tests for CRUD operations in V2 * code changes related to CRUD operations in benchmart tests in V1 and V2. Removed existing benchmark files * resolved lint errors * added Markdown file for Benchmarks * 1) Moved BENCHMARKS file to v2 folder 2) Moved few functions and the Test_BatchInsert test case from database_collection_perf_test to database_view-arangosearch_test 3) Removed initial ifndef TESTOPTIONS from Makefile 4) Added a short note about benchmarks in README * addressed comments * Update v2/README.md Co-authored-by: jwierzbo <[email protected]> * Update README to address review comments --------- Co-authored-by: jwierzbo <[email protected]>
1 parent b1d2682 commit fd1f6ab

File tree

9 files changed

+1245
-414
lines changed

9 files changed

+1245
-414
lines changed

Makefile

Lines changed: 50 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ GOBUILDTAGSOPT=-tags "$(GOBUILDTAGS)"
1919
ARANGODB ?= arangodb/enterprise:latest
2020
STARTER ?= arangodb/arangodb-starter:latest
2121

22-
ifndef TESTOPTIONS
23-
TESTOPTIONS :=
24-
endif
2522
ifdef VERBOSE
2623
TESTVERBOSEOPTIONS := -v
2724
endif
@@ -114,8 +111,11 @@ endif
114111
endif
115112

116113
ifeq ("$(TEST_BENCHMARK)", "true")
117-
TAGS := -bench=. -run=notests -cpu=1,2,4
114+
TAGS := -bench=. -benchmem -run=notests -cpu=1,2,4
118115
TESTS := $(REPOPATH)/test
116+
ifndef TESTOPTIONS
117+
TESTOPTIONS := $(TAGS)
118+
endif
119119
endif
120120

121121
ifdef TEST_ENDPOINTS_OVERRIDE
@@ -417,6 +417,7 @@ COMMON_DOCKER_CMD_PARAMS = \
417417
-e TEST_AUTHENTICATION=$(TEST_AUTHENTICATION) \
418418
-e TEST_JWTSECRET=$(TEST_JWTSECRET) \
419419
-e TEST_MODE=$(TEST_MODE) \
420+
-e TEST_MODE_K8S=$(TEST_MODE_K8S) \
420421
-e TEST_BACKUP_REMOTE_REPO=$(TEST_BACKUP_REMOTE_REPO) \
421422
-e TEST_BACKUP_REMOTE_CONFIG='$(TEST_BACKUP_REMOTE_CONFIG)' \
422423
-e TEST_DEBUG='$(TEST_DEBUG)' \
@@ -508,6 +509,51 @@ run-benchmarks-single-vpack-no-auth:
508509
@echo "Benchmarks: Single server, Velocypack, no authentication"
509510
@${MAKE} TEST_MODE="single" TEST_AUTH="none" TEST_CONTENT_TYPE="vpack" TEST_BENCHMARK="true" __run_tests
510511

512+
# V1 Cluster benchmarks
513+
run-benchmarks-cluster-json-no-auth:
514+
@echo "V1 Benchmarks: Cluster server, JSON no authentication"
515+
@${MAKE} TEST_MODE="cluster" TEST_AUTH="none" TEST_CONTENT_TYPE="json" TEST_BENCHMARK="true" __run_tests
516+
517+
run-benchmarks-remote-with-auth:
518+
@echo "V1 Benchmarks: Remote server with authentication"
519+
@echo "Usage: TEST_ENDPOINTS_OVERRIDE=https://host:port TEST_AUTHENTICATION=basic:user:pass make run-benchmarks-remote-with-auth"
520+
ifndef TEST_AUTHENTICATION
521+
@echo "ERROR: TEST_AUTHENTICATION is not set. Please export it first."
522+
@echo "Example: export TEST_AUTHENTICATION='basic:root:password'"
523+
@exit 1
524+
endif
525+
ifndef TEST_ENDPOINTS_OVERRIDE
526+
@echo "ERROR: TEST_ENDPOINTS_OVERRIDE is not set. Please export it first."
527+
@echo "Example: export TEST_ENDPOINTS_OVERRIDE='https://host:port'"
528+
@exit 1
529+
endif
530+
@${MAKE} TEST_MODE="cluster" TEST_MODE_K8S="k8s" TEST_NOT_WAIT_UNTIL_READY="1" TEST_CONTENT_TYPE="json" TEST_BENCHMARK="true" __run_tests
531+
532+
533+
# V2 Cluster benchmarks
534+
run-benchmarks-v2-cluster-json-no-auth:
535+
@echo "V2 Benchmarks: Cluster server, JSON no authentication (from benchmark_tests/)"
536+
@${MAKE} TEST_MODE="cluster" TEST_AUTH="none" TEST_CONTENT_TYPE="json" TEST_BENCHMARK="true" __run_v2_tests
537+
538+
run-benchmarks-v2-cluster-json-ssl:
539+
@echo "V2 Benchmarks: Cluster server, JSON with SSL"
540+
@${MAKE} TEST_MODE="cluster" TEST_AUTH="none" TEST_SSL="auto" TEST_CONTENT_TYPE="json" TEST_BENCHMARK="true" __run_v2_tests
541+
542+
run-benchmarks-v2-remote-with-auth:
543+
@echo "V2 Benchmarks: Remote server with authentication"
544+
@echo "Usage: TEST_ENDPOINTS_OVERRIDE=https://host:port TEST_AUTHENTICATION=basic:user:pass make run-benchmarks-v2-remote-with-auth"
545+
ifndef TEST_AUTHENTICATION
546+
@echo "ERROR: TEST_AUTHENTICATION is not set. Please export it first."
547+
@echo "Example: export TEST_AUTHENTICATION='basic:root:password'"
548+
@exit 1
549+
endif
550+
ifndef TEST_ENDPOINTS_OVERRIDE
551+
@echo "ERROR: TEST_ENDPOINTS_OVERRIDE is not set. Please export it first."
552+
@echo "Example: export TEST_ENDPOINTS_OVERRIDE='https://host:port'"
553+
@exit 1
554+
endif
555+
@${MAKE} TEST_MODE="cluster" TEST_MODE_K8S="k8s" TEST_NOT_WAIT_UNTIL_READY="1" TEST_CONTENT_TYPE="json" TEST_BENCHMARK="true" __run_v2_tests
556+
511557
## Lint
512558

513559
.PHONY: tools

test/benchmark_collection_test.go

Lines changed: 0 additions & 88 deletions
This file was deleted.

test/benchmark_document_test.go

Lines changed: 0 additions & 166 deletions
This file was deleted.

0 commit comments

Comments
 (0)