Skip to content

Commit 74bfaff

Browse files
authored
Enable Elasticsearch functional tests for SQL advanced visibility (#3923)
* Enable Elasticsearch functional tests for SQL advanced visibility * Cleanup cluster configs * Disable cyclomatic and cognitive linter rules for tests dir
1 parent 2117c81 commit 74bfaff

15 files changed

+380
-275
lines changed

.golangci.yml

+6
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,9 @@ linters-settings:
8282
- name: unhandled-error
8383
arguments:
8484
- "fmt.Printf"
85+
issues:
86+
exclude-rules:
87+
- path: tests\/.+\.go
88+
text: "(cyclomatic|cognitive)"
89+
linters:
90+
- revive

Makefile

+7-7
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ clean-test-results:
264264

265265
build-tests:
266266
@printf $(COLOR) "Build tests..."
267-
@go test -exec="true" -count=0 -tags=esintegration $(TEST_DIRS)
267+
@go test -exec="true" -count=0 $(TEST_DIRS)
268268

269269
unit-test: clean-test-results
270270
@printf $(COLOR) "Run unit tests..."
@@ -278,18 +278,18 @@ integration-test: clean-test-results
278278

279279
functional-test: clean-test-results
280280
@printf $(COLOR) "Run functional tests..."
281-
@go test $(FUNCTIONAL_TEST_ROOT) -timeout=$(TEST_TIMEOUT) $(TEST_TAG) -race | tee -a test.log
282-
@go test $(FUNCTIONAL_TEST_NDC_ROOT) -timeout=$(TEST_TIMEOUT) $(TEST_TAG) -race | tee -a test.log
281+
@go test $(FUNCTIONAL_TEST_ROOT) -timeout=$(TEST_TIMEOUT) $(TEST_TAG) -race -persistenceType=$(PERSISTENCE_TYPE) -persistenceDriver=$(PERSISTENCE_DRIVER) | tee -a test.log
282+
@go test $(FUNCTIONAL_TEST_NDC_ROOT) -timeout=$(TEST_TIMEOUT) $(TEST_TAG) -race -persistenceType=$(PERSISTENCE_TYPE) -persistenceDriver=$(PERSISTENCE_DRIVER) | tee -a test.log
283283
# Need to run xdc tests with race detector off because of ringpop bug causing data race issue.
284-
@go test $(FUNCTIONAL_TEST_XDC_ROOT) -timeout=$(TEST_TIMEOUT) $(TEST_TAG) | tee -a test.log
284+
@go test $(FUNCTIONAL_TEST_XDC_ROOT) -timeout=$(TEST_TIMEOUT) $(TEST_TAG) -persistenceType=$(PERSISTENCE_TYPE) -persistenceDriver=$(PERSISTENCE_DRIVER) | tee -a test.log
285285
@! grep -q "^--- FAIL" test.log
286286

287287
functional-with-fault-injection-test: clean-test-results
288288
@printf $(COLOR) "Run integration tests with fault injection..."
289-
@go test $(FUNCTIONAL_TEST_ROOT) -timeout=$(TEST_TIMEOUT) $(TEST_TAG) -race -PersistenceFaultInjectionRate=0.005 | tee -a test.log
290-
@go test $(FUNCTIONAL_TEST_NDC_ROOT) -timeout=$(TEST_TIMEOUT) $(TEST_TAG) -race -PersistenceFaultInjectionRate=0.005 | tee -a test.log
289+
@go test $(FUNCTIONAL_TEST_ROOT) -timeout=$(TEST_TIMEOUT) $(TEST_TAG) -race -PersistenceFaultInjectionRate=0.005 -persistenceType=$(PERSISTENCE_TYPE) -persistenceDriver=$(PERSISTENCE_DRIVER) | tee -a test.log
290+
@go test $(FUNCTIONAL_TEST_NDC_ROOT) -timeout=$(TEST_TIMEOUT) $(TEST_TAG) -race -PersistenceFaultInjectionRate=0.005 -persistenceType=$(PERSISTENCE_TYPE) -persistenceDriver=$(PERSISTENCE_DRIVER) | tee -a test.log
291291
# Need to run xdc tests with race detector off because of ringpop bug causing data race issue.
292-
@go test $(FUNCTIONAL_TEST_XDC_ROOT) -timeout=$(TEST_TIMEOUT) $(TEST_TAG) -PersistenceFaultInjectionRate=0.005 | tee -a test.log
292+
@go test $(FUNCTIONAL_TEST_XDC_ROOT) -timeout=$(TEST_TIMEOUT) $(TEST_TAG) -PersistenceFaultInjectionRate=0.005 -persistenceType=$(PERSISTENCE_TYPE) -persistenceDriver=$(PERSISTENCE_DRIVER) | tee -a test.log
293293
@! grep -q "^--- FAIL" test.log
294294

295295
test: unit-test integration-test functional-test functional-with-fault-injection-test

develop/buildkite/docker-compose-es8.yml

-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ services:
5656
- "ES_VERSION=v8"
5757
- "PERSISTENCE_TYPE=nosql"
5858
- "PERSISTENCE_DRIVER=cassandra"
59-
- "TEST_TAG=esintegration"
6059
- "TEMPORAL_VERSION_CHECK_DISABLED=1"
6160
- BUILDKITE_AGENT_ACCESS_TOKEN
6261
- BUILDKITE_JOB_ID

develop/buildkite/docker-compose.yml

-22
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ services:
9393
- "ES_VERSION=v7"
9494
- "PERSISTENCE_TYPE=nosql"
9595
- "PERSISTENCE_DRIVER=cassandra"
96-
- "TEST_TAG=esintegration"
9796
- "TEMPORAL_VERSION_CHECK_DISABLED=1"
9897
- BUILDKITE_AGENT_ACCESS_TOKEN
9998
- BUILDKITE_JOB_ID
@@ -120,7 +119,6 @@ services:
120119
- "ES_VERSION=v7"
121120
- "PERSISTENCE_TYPE=sql"
122121
- "PERSISTENCE_DRIVER=mysql"
123-
- "TEST_TAG=esintegration"
124122
- "TEMPORAL_VERSION_CHECK_DISABLED=1"
125123
- BUILDKITE_AGENT_ACCESS_TOKEN
126124
- BUILDKITE_JOB_ID
@@ -143,19 +141,15 @@ services:
143141
dockerfile: ./develop/buildkite/Dockerfile
144142
environment:
145143
- "MYSQL_SEEDS=mysql"
146-
- "ES_SEEDS=elasticsearch"
147-
- "ES_VERSION=v7"
148144
- "PERSISTENCE_TYPE=sql"
149145
- "PERSISTENCE_DRIVER=mysql8"
150-
- "TEST_TAG=esintegration"
151146
- "TEMPORAL_VERSION_CHECK_DISABLED=1"
152147
- BUILDKITE_AGENT_ACCESS_TOKEN
153148
- BUILDKITE_JOB_ID
154149
- BUILDKITE_BUILD_ID
155150
- BUILDKITE_BUILD_NUMBER
156151
depends_on:
157152
- mysql
158-
- elasticsearch
159153
volumes:
160154
- ../..:/temporal
161155
- /usr/bin/buildkite-agent:/usr/bin/buildkite-agent
@@ -174,7 +168,6 @@ services:
174168
- "ES_VERSION=v7"
175169
- "PERSISTENCE_TYPE=sql"
176170
- "PERSISTENCE_DRIVER=postgres"
177-
- "TEST_TAG=esintegration"
178171
- "TEMPORAL_VERSION_CHECK_DISABLED=1"
179172
- BUILDKITE_AGENT_ACCESS_TOKEN
180173
- BUILDKITE_JOB_ID
@@ -197,19 +190,15 @@ services:
197190
dockerfile: ./develop/buildkite/Dockerfile
198191
environment:
199192
- "POSTGRES_SEEDS=postgresql"
200-
- "ES_SEEDS=elasticsearch"
201-
- "ES_VERSION=v7"
202193
- "PERSISTENCE_TYPE=sql"
203194
- "PERSISTENCE_DRIVER=postgres12"
204-
- "TEST_TAG=esintegration"
205195
- "TEMPORAL_VERSION_CHECK_DISABLED=1"
206196
- BUILDKITE_AGENT_ACCESS_TOKEN
207197
- BUILDKITE_JOB_ID
208198
- BUILDKITE_BUILD_ID
209199
- BUILDKITE_BUILD_NUMBER
210200
depends_on:
211201
- postgresql
212-
- elasticsearch
213202
volumes:
214203
- ../..:/temporal
215204
- /usr/bin/buildkite-agent:/usr/bin/buildkite-agent
@@ -248,7 +237,6 @@ services:
248237
- "ES_VERSION=v7"
249238
- "PERSISTENCE_TYPE=nosql"
250239
- "PERSISTENCE_DRIVER=cassandra"
251-
- "TEST_TAG=esintegration"
252240
- "TEST_RUN_COUNT=10"
253241
- "TEMPORAL_VERSION_CHECK_DISABLED=1"
254242
- BUILDKITE_AGENT_ACCESS_TOKEN
@@ -276,7 +264,6 @@ services:
276264
- "ES_VERSION=v7"
277265
- "PERSISTENCE_TYPE=sql"
278266
- "PERSISTENCE_DRIVER=mysql"
279-
- "TEST_TAG=esintegration"
280267
- "TEST_RUN_COUNT=10"
281268
- "TEMPORAL_VERSION_CHECK_DISABLED=1"
282269
- BUILDKITE_AGENT_ACCESS_TOKEN
@@ -300,11 +287,8 @@ services:
300287
dockerfile: ./develop/buildkite/Dockerfile
301288
environment:
302289
- "MYSQL_SEEDS=mysql"
303-
- "ES_SEEDS=elasticsearch"
304-
- "ES_VERSION=v7"
305290
- "PERSISTENCE_TYPE=sql"
306291
- "PERSISTENCE_DRIVER=mysql8"
307-
- "TEST_TAG=esintegration"
308292
- "TEST_RUN_COUNT=10"
309293
- "TEMPORAL_VERSION_CHECK_DISABLED=1"
310294
- BUILDKITE_AGENT_ACCESS_TOKEN
@@ -313,7 +297,6 @@ services:
313297
- BUILDKITE_BUILD_NUMBER
314298
depends_on:
315299
- mysql
316-
- elasticsearch
317300
volumes:
318301
- ../..:/temporal
319302
- /usr/bin/buildkite-agent:/usr/bin/buildkite-agent
@@ -332,7 +315,6 @@ services:
332315
- "ES_VERSION=v7"
333316
- "PERSISTENCE_TYPE=sql"
334317
- "PERSISTENCE_DRIVER=postgres"
335-
- "TEST_TAG=esintegration"
336318
- "TEST_RUN_COUNT=10"
337319
- "TEMPORAL_VERSION_CHECK_DISABLED=1"
338320
- BUILDKITE_AGENT_ACCESS_TOKEN
@@ -356,11 +338,8 @@ services:
356338
dockerfile: ./develop/buildkite/Dockerfile
357339
environment:
358340
- "POSTGRES_SEEDS=postgresql"
359-
- "ES_SEEDS=elasticsearch"
360-
- "ES_VERSION=v7"
361341
- "PERSISTENCE_TYPE=sql"
362342
- "PERSISTENCE_DRIVER=postgres12"
363-
- "TEST_TAG=esintegration"
364343
- "TEST_RUN_COUNT=10"
365344
- "TEMPORAL_VERSION_CHECK_DISABLED=1"
366345
- BUILDKITE_AGENT_ACCESS_TOKEN
@@ -369,7 +348,6 @@ services:
369348
- BUILDKITE_BUILD_NUMBER
370349
depends_on:
371350
- postgresql
372-
- elasticsearch
373351
volumes:
374352
- ../..:/temporal
375353
- /usr/bin/buildkite-agent:/usr/bin/buildkite-agent

0 commit comments

Comments
 (0)