Skip to content

Commit

Permalink
Enable ndc integration test in buildkite (cadence-workflow#2626)
Browse files Browse the repository at this point in the history
* Enable ndc integration test in buildkite
  • Loading branch information
yux0 authored Oct 2, 2019
1 parent 673a10b commit 6d2ffbd
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,21 @@ steps:
run: integration-test-xdc-cassandra
config: docker/buildkite/docker-compose.yml

- label: ":golang: integration ndc test with cassandra"
agents:
queue: "workers"
docker: "*"
command: "make cover_ndc_profile"
artifact_paths:
- "build/coverage/*.out"
retry:
automatic:
limit: 1
plugins:
- docker-compose#v3.0.0:
run: integration-test-xdc-cassandra
config: docker/buildkite/docker-compose.yml

- label: ":golang: integration test with mysql"
agents:
queue: "workers"
Expand Down Expand Up @@ -101,6 +116,21 @@ steps:
run: integration-test-xdc-mysql
config: docker/buildkite/docker-compose.yml

- label: ":golang: integration ndc test with mysql"
agents:
queue: "workers"
docker: "*"
command: "make cover_ndc_profile"
artifact_paths:
- "build/coverage/*.out"
retry:
automatic:
limit: 1
plugins:
- docker-compose#v3.0.0:
run: integration-test-xdc-mysql
config: docker/buildkite/docker-compose.yml

- wait

- label: ":golang: code-coverage"
Expand Down
19 changes: 19 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ INTEG_TEST_ROOT=./host
INTEG_TEST_DIR=host
INTEG_TEST_XDC_ROOT=./host/xdc
INTEG_TEST_XDC_DIR=hostxdc
INTEG_TEST_NDC_ROOT=./host/ndc
INTEG_TEST_NDC_DIR=hostndc
EV2_TEST=_ev2

GO_BUILD_LDFLAGS_CMD := $(abspath ./scripts/go-build-ldflags.sh)
Expand All @@ -52,6 +54,10 @@ ifndef PERSISTENCE_TYPE
override PERSISTENCE_TYPE = cassandra
endif

ifndef TEST_RUN_COUNT
override TEST_RUN_COUNT = 1
endif

ifdef TEST_TAG
override TEST_TAG := -tags $(TEST_TAG)
endif
Expand Down Expand Up @@ -95,6 +101,9 @@ INTEG_XDC_CASS_COVER_FILE := $(COVER_ROOT)/integ_xdc_cassandra_cover.out
INTEG_SQL_COVER_FILE := $(COVER_ROOT)/integ_sql_cover.out
INTEG_SQL_EV2_COVER_FILE := $(COVER_ROOT)/integ_sql_ev2_cover.out
INTEG_XDC_SQL_COVER_FILE := $(COVER_ROOT)/integ_xdc_sql_cover.out
INTEG_NDC_COVER_FILE := $(COVER_ROOT)/integ_ndc_$(PERSISTENCE_TYPE)_cover.out
INTEG_NDC_CASS_COVER_FILE := $(COVER_ROOT)/integ_ndc_cassandra_cover.out
INTEG_NDC_SQL_COVER_FILE := $(COVER_ROOT)/integ_ndc_sql_cover.out

# Need the following option to have integration tests
# count towards coverage. godoc below:
Expand Down Expand Up @@ -200,6 +209,16 @@ cover_xdc_profile: clean bins_nothrift
@time go test -v -timeout $(TEST_TIMEOUT) $(INTEG_TEST_XDC_ROOT) $(TEST_TAG) -persistenceType=$(PERSISTENCE_TYPE) $(GOCOVERPKG_ARG) -coverprofile=$(BUILD)/$(INTEG_TEST_XDC_DIR)/coverage.out || exit 1;
@cat $(BUILD)/$(INTEG_TEST_XDC_DIR)/coverage.out | grep -v "^mode: \w\+" | grep -v "mode: set" >> $(INTEG_XDC_COVER_FILE)

cover_ndc_profile: clean bins_nothrift
@mkdir -p $(BUILD)
@mkdir -p $(COVER_ROOT)
@echo "mode: atomic" > $(INTEG_NDC_COVER_FILE)

@echo Running integration test for 3+ dc with $(PERSISTENCE_TYPE)
@mkdir -p $(BUILD)/$(INTEG_TEST_NDC_DIR)
@time go test -v -timeout $(TEST_TIMEOUT) $(INTEG_TEST_NDC_ROOT) $(TEST_TAG) -persistenceType=$(PERSISTENCE_TYPE) $(GOCOVERPKG_ARG) -coverprofile=$(BUILD)/$(INTEG_TEST_NDC_DIR)/coverage.out -count=$(TEST_RUN_COUNT) || exit 1;
@cat $(BUILD)/$(INTEG_TEST_NDC_DIR)/coverage.out | grep -v "^mode: \w\+" | grep -v "mode: set" >> $(INTEG_NDC_COVER_FILE)

$(COVER_ROOT)/cover.out: $(UNIT_COVER_FILE) $(INTEG_CASS_COVER_FILE) $(INTEG_CASS_EV2_COVER_FILE) $(INTEG_XDC_CASS_COVER_FILE) $(INTEG_SQL_COVER_FILE) $(INTEG_SQL_EV2_COVER_FILE) $(INTEG_XDC_SQL_COVER_FILE)
@echo "mode: atomic" > $(COVER_ROOT)/cover.out
cat $(UNIT_COVER_FILE) | grep -v "^mode: \w\+" | grep -vP ".gen|[Mm]ock[s]?" >> $(COVER_ROOT)/cover.out
Expand Down
2 changes: 2 additions & 0 deletions docker/buildkite/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ services:
- "ES_SEEDS=elasticsearch"
- "KAFKA_SEEDS=kafka"
- "TEST_TAG=esintegration"
- "TEST_RUN_COUNT=10"
- BUILDKITE_AGENT_ACCESS_TOKEN
- BUILDKITE_JOB_ID
- BUILDKITE_BUILD_ID
Expand Down Expand Up @@ -192,6 +193,7 @@ services:
- "KAFKA_SEEDS=kafka"
- "PERSISTENCE_TYPE=sql"
- "TEST_TAG=esintegration"
- "TEST_RUN_COUNT=10"
- BUILDKITE_AGENT_ACCESS_TOKEN
- BUILDKITE_JOB_ID
- BUILDKITE_BUILD_ID
Expand Down

0 comments on commit 6d2ffbd

Please sign in to comment.