From a6dd23f9a1aab382e2b6697a443ee5f3f8906d4a Mon Sep 17 00:00:00 2001 From: Joe Zou Date: Mon, 2 Nov 2020 17:51:35 +0800 Subject: [PATCH 01/12] add Makefile --- Makefile | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000000..7bf706c624 --- /dev/null +++ b/Makefile @@ -0,0 +1,58 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +VERSION ?= latest + +GO = go +GO_PATH = $$($(GO) env GOPATH) +GO_BUILD = $(GO) build +GO_GET = $(GO) get +GO_TEST = $(GO) test +GO_BUILD_FLAGS = -v +GO_BUILD_LDFLAGS = -X main.version=$(VERSION) + +GO_LICENSE_CHECKER = $(GO_PATH)/bin/license-header-checker +LICENSE_DIR = /tmp/tools/license + +PLATFORMS := windows linux darwin +os = $(word 1, $@) +ARCH = amd64 + +SHELL = /bin/bash + +prepare: + $(GO_LICENSE_CHECKER) -version || GO111MODULE=off $(GO_GET) -u github.com/lsm-dev/license-header-checker + wget -P $(LICENSE_DIR) https://github.com/dubbogo/resources/raw/master/tools/license/license.txt + ./before_ut.sh + +.PHONE: test +test: clean lint + $(GO_TEST) ./... -coverprofile=coverage.txt -covermode=atomic + +deps: prepare + $(GO_GET) -v -t -d ./... + +.PHONY: license +license: clean tools + $(GO_LICENSE_CHECKER) -v -a -r -i vendor $(LICENSE_DIR)/license.txt . go && [[ -z `git status -s` ]] + +.PHONY: verify +verify: clean license lint test + +.PHONY: clean +clean: tools + -rm -rf coverage.txt From 9d343fb71046d979d473b8045099260187faafbd Mon Sep 17 00:00:00 2001 From: Joe Zou Date: Mon, 2 Nov 2020 18:53:27 +0800 Subject: [PATCH 02/12] add makefiel and ignore --- .gitignore | 2 ++ Makefile | 18 +++++++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 8158b497e3..898962e244 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,5 @@ config_center/apollo/mockDubbog.properties.json # vim stuff *~ .*.sw? +/license-header-checker-linux/ +/license-header-checker-linux.zip diff --git a/Makefile b/Makefile index 7bf706c624..2c224c6d19 100644 --- a/Makefile +++ b/Makefile @@ -19,6 +19,7 @@ VERSION ?= latest GO = go GO_PATH = $$($(GO) env GOPATH) +GO_OS = $$($(GO) env GOOS) GO_BUILD = $(GO) build GO_GET = $(GO) get GO_TEST = $(GO) test @@ -26,7 +27,8 @@ GO_BUILD_FLAGS = -v GO_BUILD_LDFLAGS = -X main.version=$(VERSION) GO_LICENSE_CHECKER = $(GO_PATH)/bin/license-header-checker -LICENSE_DIR = /tmp/tools/license +GO_LICENSE_CHECKER_DIR = license-header-checker-$(GO_OS) +LICENSE_DIR = /tmp/tools/license/license.txt PLATFORMS := windows linux darwin os = $(word 1, $@) @@ -35,9 +37,11 @@ ARCH = amd64 SHELL = /bin/bash prepare: - $(GO_LICENSE_CHECKER) -version || GO111MODULE=off $(GO_GET) -u github.com/lsm-dev/license-header-checker - wget -P $(LICENSE_DIR) https://github.com/dubbogo/resources/raw/master/tools/license/license.txt - ./before_ut.sh + wget https://github.com/lsm-dev/license-header-checker/releases/download/v1.1.0/$(GO_LICENSE_CHECKER_DIR).zip -O $(GO_LICENSE_CHECKER_DIR).zip + unzip -o $(GO_LICENSE_CHECKER_DIR).zip + cp $(GO_LICENSE_CHECKER_DIR)/64bits/license-header-checker $(GO_PATH)/bin/ + wget -O $(LICENSE_DIR) https://github.com/dubbogo/resources/raw/master/tools/license/license.txt + #./before_ut.sh .PHONE: test test: clean lint @@ -47,12 +51,12 @@ deps: prepare $(GO_GET) -v -t -d ./... .PHONY: license -license: clean tools - $(GO_LICENSE_CHECKER) -v -a -r -i vendor $(LICENSE_DIR)/license.txt . go && [[ -z `git status -s` ]] +license: clean prepare + $(GO_LICENSE_CHECKER) -v -a -r -i vendor $(LICENSE_DIR) . go && [[ -z `git status -s` ]] .PHONY: verify verify: clean license lint test .PHONY: clean -clean: tools +clean: prepare -rm -rf coverage.txt From 451d0b831ff8469d2aa0cb1840f4e60e3155ec73 Mon Sep 17 00:00:00 2001 From: Joe Zou Date: Mon, 2 Nov 2020 18:59:44 +0800 Subject: [PATCH 03/12] add makefiel and ignore --- Makefile | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 2c224c6d19..a790684005 100644 --- a/Makefile +++ b/Makefile @@ -37,10 +37,8 @@ ARCH = amd64 SHELL = /bin/bash prepare: - wget https://github.com/lsm-dev/license-header-checker/releases/download/v1.1.0/$(GO_LICENSE_CHECKER_DIR).zip -O $(GO_LICENSE_CHECKER_DIR).zip - unzip -o $(GO_LICENSE_CHECKER_DIR).zip - cp $(GO_LICENSE_CHECKER_DIR)/64bits/license-header-checker $(GO_PATH)/bin/ - wget -O $(LICENSE_DIR) https://github.com/dubbogo/resources/raw/master/tools/license/license.txt + $(GO_LICENSE_CHECKER) -version || (wget https://github.com/lsm-dev/license-header-checker/releases/download/v1.1.0/$(GO_LICENSE_CHECKER_DIR).zip -O $(GO_LICENSE_CHECKER_DIR).zip && unzip -o $(GO_LICENSE_CHECKER_DIR).zip && cp $(GO_LICENSE_CHECKER_DIR)/64bits/license-header-checker $(GO_PATH)/bin/) + ls $(LICENSE_DIR) || wget -O $(LICENSE_DIR) https://github.com/dubbogo/resources/raw/master/tools/license/license.txt #./before_ut.sh .PHONE: test @@ -52,7 +50,7 @@ deps: prepare .PHONY: license license: clean prepare - $(GO_LICENSE_CHECKER) -v -a -r -i vendor $(LICENSE_DIR) . go && [[ -z `git status -s` ]] + $(GO_LICENSE_CHECKER) -v -a -r -i vendor $(LICENSE_DIR) . go && [[ -z `git status -s` ]] .PHONY: verify verify: clean license lint test From 229f898bb520ca7c5f5ab4d94450b0cfcf0a9f33 Mon Sep 17 00:00:00 2001 From: Joe Zou Date: Mon, 2 Nov 2020 19:14:49 +0800 Subject: [PATCH 04/12] modify make file --- Makefile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index a790684005..d5160974e2 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,8 @@ VERSION ?= latest GO = go GO_PATH = $$($(GO) env GOPATH) -GO_OS = $$($(GO) env GOOS) +GO_OS = mac +#GO_OS = $$($(GO) env GOOS) GO_BUILD = $(GO) build GO_GET = $(GO) get GO_TEST = $(GO) test @@ -28,7 +29,7 @@ GO_BUILD_LDFLAGS = -X main.version=$(VERSION) GO_LICENSE_CHECKER = $(GO_PATH)/bin/license-header-checker GO_LICENSE_CHECKER_DIR = license-header-checker-$(GO_OS) -LICENSE_DIR = /tmp/tools/license/license.txt +LICENSE_DIR = /tmp/tools/license PLATFORMS := windows linux darwin os = $(word 1, $@) @@ -37,8 +38,8 @@ ARCH = amd64 SHELL = /bin/bash prepare: - $(GO_LICENSE_CHECKER) -version || (wget https://github.com/lsm-dev/license-header-checker/releases/download/v1.1.0/$(GO_LICENSE_CHECKER_DIR).zip -O $(GO_LICENSE_CHECKER_DIR).zip && unzip -o $(GO_LICENSE_CHECKER_DIR).zip && cp $(GO_LICENSE_CHECKER_DIR)/64bits/license-header-checker $(GO_PATH)/bin/) - ls $(LICENSE_DIR) || wget -O $(LICENSE_DIR) https://github.com/dubbogo/resources/raw/master/tools/license/license.txt + $(GO_LICENSE_CHECKER) -version || (wget https://github.com/lsm-dev/license-header-checker/releases/download/v1.2.0/$(GO_LICENSE_CHECKER_DIR).zip -O $(GO_LICENSE_CHECKER_DIR).zip && unzip -o $(GO_LICENSE_CHECKER_DIR).zip && mkdir -p $(GO_PATH)/bin/ && cp $(GO_LICENSE_CHECKER_DIR)/64bit/license-header-checker $(GO_PATH)/bin/) + wget -P $(LICENSE_DIR) https://github.com/dubbogo/resources/raw/master/tools/license/license.txt #./before_ut.sh .PHONE: test @@ -50,7 +51,7 @@ deps: prepare .PHONY: license license: clean prepare - $(GO_LICENSE_CHECKER) -v -a -r -i vendor $(LICENSE_DIR) . go && [[ -z `git status -s` ]] + $(GO_LICENSE_CHECKER) -v -a -r -i vendor $(LICENSE_DIR)/license.txt . go && [[ -z `git status -s` ]] .PHONY: verify verify: clean license lint test From 8d08824105457855de416dd4c1ebcd01237590cc Mon Sep 17 00:00:00 2001 From: Joe Zou Date: Mon, 2 Nov 2020 23:34:08 +0800 Subject: [PATCH 05/12] modify make file --- Makefile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index d5160974e2..4000b911a0 100644 --- a/Makefile +++ b/Makefile @@ -18,17 +18,19 @@ VERSION ?= latest GO = go -GO_PATH = $$($(GO) env GOPATH) -GO_OS = mac -#GO_OS = $$($(GO) env GOOS) +GO_PATH = $(shell $(GO) env GOPATH) +GO_OS = $(shell $(GO) env GOOS) +ifeq ($(GO_OS), darwin) + GO_OS = mac +endif GO_BUILD = $(GO) build GO_GET = $(GO) get GO_TEST = $(GO) test GO_BUILD_FLAGS = -v GO_BUILD_LDFLAGS = -X main.version=$(VERSION) -GO_LICENSE_CHECKER = $(GO_PATH)/bin/license-header-checker GO_LICENSE_CHECKER_DIR = license-header-checker-$(GO_OS) +GO_LICENSE_CHECKER = $(GO_PATH)/bin/license-header-checker LICENSE_DIR = /tmp/tools/license PLATFORMS := windows linux darwin @@ -39,7 +41,7 @@ SHELL = /bin/bash prepare: $(GO_LICENSE_CHECKER) -version || (wget https://github.com/lsm-dev/license-header-checker/releases/download/v1.2.0/$(GO_LICENSE_CHECKER_DIR).zip -O $(GO_LICENSE_CHECKER_DIR).zip && unzip -o $(GO_LICENSE_CHECKER_DIR).zip && mkdir -p $(GO_PATH)/bin/ && cp $(GO_LICENSE_CHECKER_DIR)/64bit/license-header-checker $(GO_PATH)/bin/) - wget -P $(LICENSE_DIR) https://github.com/dubbogo/resources/raw/master/tools/license/license.txt + ls /tmp/tools/license/license.txt || wget -P $(LICENSE_DIR) https://github.com/dubbogo/resources/raw/master/tools/license/license.txt #./before_ut.sh .PHONE: test @@ -51,7 +53,7 @@ deps: prepare .PHONY: license license: clean prepare - $(GO_LICENSE_CHECKER) -v -a -r -i vendor $(LICENSE_DIR)/license.txt . go && [[ -z `git status -s` ]] + $(GO_LICENSE_CHECKER) -v -a -r -i vendor $(LICENSE_DIR)/license.txt . go && [[ -z `git status -s` ]] .PHONY: verify verify: clean license lint test From 0ccb9af1258825c717e105a796cf08222628ae4d Mon Sep 17 00:00:00 2001 From: Joe Zou Date: Tue, 3 Nov 2020 00:27:13 +0800 Subject: [PATCH 06/12] modify make file --- Makefile | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 4000b911a0..75a5ec6349 100644 --- a/Makefile +++ b/Makefile @@ -33,19 +33,31 @@ GO_LICENSE_CHECKER_DIR = license-header-checker-$(GO_OS) GO_LICENSE_CHECKER = $(GO_PATH)/bin/license-header-checker LICENSE_DIR = /tmp/tools/license -PLATFORMS := windows linux darwin -os = $(word 1, $@) ARCH = amd64 +ZK_TEST_LIST=registry/zookeeper cluster/router/chain cluster/router/condition cluster/router/tag metadata/report/zookeeper +ZK_JAR_NAME=zookeeper-3.4.9-fatjar.jar +ZK_FATJAR_BASE=/zookeeper-4unittest/contrib/fatjar +ZK_JAR_PATH=remoting/zookeeper$(ZK_FATJAR_BASE) +ZK_JAR=$(ZK_JAR_PATH)/$(ZK_JAR_NAME) + SHELL = /bin/bash -prepare: +prepareLic: $(GO_LICENSE_CHECKER) -version || (wget https://github.com/lsm-dev/license-header-checker/releases/download/v1.2.0/$(GO_LICENSE_CHECKER_DIR).zip -O $(GO_LICENSE_CHECKER_DIR).zip && unzip -o $(GO_LICENSE_CHECKER_DIR).zip && mkdir -p $(GO_PATH)/bin/ && cp $(GO_LICENSE_CHECKER_DIR)/64bit/license-header-checker $(GO_PATH)/bin/) ls /tmp/tools/license/license.txt || wget -P $(LICENSE_DIR) https://github.com/dubbogo/resources/raw/master/tools/license/license.txt - #./before_ut.sh + +prepareZk: + ls $(ZK_JAR) || (mkdir -p $(ZK_JAR_PATH)&& wget -P $(ZK_JAR_PATH) https://github.com/dubbogo/resources/raw/master/zookeeper-4unitest/contrib/fatjar/${ZK_JAR_NAME}) + @for i in $(ZK_TEST_LIST); do \ + mkdir -p $$i$(ZK_FATJAR_BASE);\ + cp ${ZK_JAR} $$i$(ZK_FATJAR_BASE);\ + done + +prepare: prepareZk prepareLic .PHONE: test -test: clean lint +test: clean $(GO_TEST) ./... -coverprofile=coverage.txt -covermode=atomic deps: prepare @@ -56,8 +68,9 @@ license: clean prepare $(GO_LICENSE_CHECKER) -v -a -r -i vendor $(LICENSE_DIR)/license.txt . go && [[ -z `git status -s` ]] .PHONY: verify -verify: clean license lint test +verify: clean license test .PHONY: clean clean: prepare - -rm -rf coverage.txt + rm -rf coverage.txt + rm -rf license-header-checker* From 935a58738e2d32b5649be8592086092eb5404dff Mon Sep 17 00:00:00 2001 From: Joe Zou Date: Tue, 3 Nov 2020 09:26:22 +0800 Subject: [PATCH 07/12] add Makefile into travis and remove shell --- .travis.yml | 10 +-------- Makefile | 4 ++-- README.md | 20 ++++++++---------- README_CN.md | 22 +++++++++---------- before_ut.bat | 43 -------------------------------------- before_ut.sh | 43 -------------------------------------- before_validate_license.sh | 26 ----------------------- 7 files changed, 22 insertions(+), 146 deletions(-) delete mode 100644 before_ut.bat delete mode 100755 before_ut.sh delete mode 100644 before_validate_license.sh diff --git a/.travis.yml b/.travis.yml index 566c88ece0..7b338c2779 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,15 +16,7 @@ install: true # define ci-stage script: # license-check - - echo 'start license check' - - go fmt ./... && [[ -z `git status -s` ]] - - sh before_validate_license.sh - - chmod u+x /tmp/tools/license/license-header-checker - - /tmp/tools/license/license-header-checker -v -a -r -i vendor /tmp/tools/license/license.txt . go && [[ -z `git status -s` ]] - # unit-test - - echo 'start unit-test' - - chmod u+x before_ut.sh && ./before_ut.sh - - go mod vendor && go test ./... -coverprofile=coverage.txt -covermode=atomic + - make verify # integrate-test - chmod +x integrate_test.sh && ./integrate_test.sh diff --git a/Makefile b/Makefile index 75a5ec6349..73fc703ab9 100644 --- a/Makefile +++ b/Makefile @@ -57,14 +57,14 @@ prepareZk: prepare: prepareZk prepareLic .PHONE: test -test: clean +test: clean prepareZk $(GO_TEST) ./... -coverprofile=coverage.txt -covermode=atomic deps: prepare $(GO_GET) -v -t -d ./... .PHONY: license -license: clean prepare +license: clean prepareLic $(GO_LICENSE_CHECKER) -v -a -r -i vendor $(LICENSE_DIR)/license.txt . go && [[ -z `git status -s` ]] .PHONY: verify diff --git a/README.md b/README.md index 9e1edd3af1..27ffc1b605 100644 --- a/README.md +++ b/README.md @@ -144,28 +144,26 @@ https://dubbogo.github.io/dubbo-go-website (**Improving**) ## Quick Start -[dubbo-samples/golang](https://github.com/dubbogo/dubbo-samples) shows how to use dubbo-go. Please read the [dubbo-samples/golang/README.md](https://github.com/dubbogo/dubbo-samples/blob/master/golang/README.md) carefully to learn how to dispose the configuration and compile the program. +[dubbo-go-samples](https://github.com/apache/dubbo-go-samples) shows how to use dubbo-go. Please read the [dubbo-samples/golang/README.md](https://github.com/apache/dubbo-go-samples/blob/master/README.md) carefully to learn how to dispose the configuration and compile the program. ## Running unit tests -### Prepare +### Run -Mac/Linux ```bash -sh ./before_ut.sh +make verify ``` -Windows +### Verify license + ```bash -before_ut.bat +make license ``` -### Run -```bash -go test ./... +### Run unit test -# coverage -go test ./... -coverprofile=coverage.txt -covermode=atomic +```bash +make test ``` ## Build diff --git a/README_CN.md b/README_CN.md index b76d8983de..42b65a822c 100644 --- a/README_CN.md +++ b/README_CN.md @@ -144,29 +144,27 @@ https://dubbogo.github.io/dubbo-go-website (**完善中**) ## 运行单测 -### 准备 +### 执行全部校验 -Mac/Linux ```bash -sh ./before_ut.sh +make verify ``` -Windows +### 校验许可证 + ```bash -before_ut.bat +make license ``` -### 执行 -```bash -go test ./... +### 执行单元测试 -# coverage -go test ./... -coverprofile=coverage.txt -covermode=atomic +```bash +make test ``` ## 编译 -请移步 [dubbo-samples/golang](https://github.com/dubbogo/dubbo-samples) +请移步 [dubbo-go-samples](https://github.com/apache/dubbo-go-samples) ## 如何贡献 @@ -211,4 +209,4 @@ go test ./... -coverprofile=coverage.txt -covermode=atomic - + \ No newline at end of file diff --git a/before_ut.bat b/before_ut.bat deleted file mode 100644 index b8d72e4a87..0000000000 --- a/before_ut.bat +++ /dev/null @@ -1,43 +0,0 @@ -:: -:: Licensed to the Apache Software Foundation (ASF) under one or more -:: contributor license agreements. See the NOTICE file distributed with -:: this work for additional information regarding copyright ownership. -:: The ASF licenses this file to You under the Apache License, Version 2.0 -:: (the "License"); you may not use this file except in compliance with -:: the License. You may obtain a copy of the License at -:: -:: http://www.apache.org/licenses/LICENSE-2.0 -:: -:: Unless required by applicable law or agreed to in writing, software -:: distributed under the License is distributed on an "AS IS" BASIS, -:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -:: See the License for the specific language governing permissions and -:: limitations under the License. - -set zkJarName=zookeeper-3.4.9-fatjar.jar -set remoteJarUrl="https://github.com/dubbogo/resources/raw/master/zookeeper-4unitest/contrib/fatjar/%zkJarName%" -set zkJarPath=remoting/zookeeper/zookeeper-4unittest/contrib/fatjar -set zkJar=%zkJarPath%/%zkJarName% - -if not exist "%zkJar%" ( - md "%zkJarPath%" - curl -L %remoteJarUrl% -o %zkJar% -) - -md config_center\zookeeper\zookeeper-4unittest\contrib\fatjar -xcopy /f "%zkJar%" "config_center/zookeeper/zookeeper-4unittest/contrib/fatjar/" - -md registry\zookeeper\zookeeper-4unittest\contrib\fatjar -xcopy /f "%zkJar%" "registry/zookeeper/zookeeper-4unittest/contrib/fatjar/" - -md cluster\router\chain\zookeeper-4unittest\contrib\fatjar -xcopy /f "%zkJar%" "cluster/router/chain/zookeeper-4unittest/contrib/fatjar/" - -md cluster\router\condition\zookeeper-4unittest\contrib\fatjar -xcopy /f "%zkJar%" "cluster/router/condition/zookeeper-4unittest/contrib/fatjar/" - -md cluster/router/tag/zookeeper-4unittest/contrib/fatjar -xcopy /f "%zkJar%" "cluster/router/tag/zookeeper-4unittest/contrib/fatjar/" - -md metadata\report\zookeeper\zookeeper-4unittest\contrib\fatjar -xcopy /f "%zkJar%" "metadata/report/zookeeper/zookeeper-4unittest/contrib/fatjar/" \ No newline at end of file diff --git a/before_ut.sh b/before_ut.sh deleted file mode 100755 index b55e424ef7..0000000000 --- a/before_ut.sh +++ /dev/null @@ -1,43 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -zkJarName="zookeeper-3.4.9-fatjar.jar" -remoteJarUrl="https://github.com/dubbogo/resources/raw/master/zookeeper-4unitest/contrib/fatjar/${zkJarName}" -zkJarPath="remoting/zookeeper/zookeeper-4unittest/contrib/fatjar" -zkJar="${zkJarPath}/${zkJarName}" - -if [ ! -f "${zkJar}" ]; then - mkdir -p ${zkJarPath} - wget -P "${zkJarPath}" ${remoteJarUrl} -fi - -mkdir -p config_center/zookeeper/zookeeper-4unittest/contrib/fatjar -cp ${zkJar} config_center/zookeeper/zookeeper-4unittest/contrib/fatjar - -mkdir -p registry/zookeeper/zookeeper-4unittest/contrib/fatjar -cp ${zkJar} registry/zookeeper/zookeeper-4unittest/contrib/fatjar - -mkdir -p cluster/router/chain/zookeeper-4unittest/contrib/fatjar -cp ${zkJar} cluster/router/chain/zookeeper-4unittest/contrib/fatjar - -mkdir -p cluster/router/condition/zookeeper-4unittest/contrib/fatjar -cp ${zkJar} cluster/router/condition/zookeeper-4unittest/contrib/fatjar - -mkdir -p cluster/router/tag/zookeeper-4unittest/contrib/fatjar -cp ${zkJar} cluster/router/tag/zookeeper-4unittest/contrib/fatjar - -mkdir -p metadata/report/zookeeper/zookeeper-4unittest/contrib/fatjar -cp ${zkJar} metadata/report/zookeeper/zookeeper-4unittest/contrib/fatjar \ No newline at end of file diff --git a/before_validate_license.sh b/before_validate_license.sh deleted file mode 100644 index 8fa6e381c7..0000000000 --- a/before_validate_license.sh +++ /dev/null @@ -1,26 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -remoteLicenseCheckerPath="https://github.com/dubbogo/resources/raw/master/tools/license" -remoteLicenseCheckerName="license-header-checker" -remoteLicenseCheckerURL="${remoteLicenseCheckerPath}/${remoteLicenseCheckerName}" -remoteLicenseName="license.txt" -remoteLicenseURL="${remoteLicenseCheckerPath}/${remoteLicenseName}" - -licensePath="/tmp/tools/license" -mkdir -p ${licensePath} -wget -P "${licensePath}" ${remoteLicenseCheckerURL} -wget -P "${licensePath}" ${remoteLicenseURL} From 7b1cd9da337917acac86d37e7708db18c101f0d4 Mon Sep 17 00:00:00 2001 From: Joe Zou Date: Tue, 3 Nov 2020 09:33:53 +0800 Subject: [PATCH 08/12] add Makefile into github action --- .github/workflows/github-actions.yml | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 7875ca6596..9850bec068 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -50,18 +50,9 @@ jobs: go get -v -t -d ./... fi - - name: License Check + - name: Verify run: | - go fmt ./... && [[ -z `git status -s` ]] - sh before_validate_license.sh - chmod u+x /tmp/tools/license/license-header-checker - /tmp/tools/license/license-header-checker -v -a -r -i vendor /tmp/tools/license/license.txt . go && [[ -z `git status -s` ]] - - - name: Test - run: | - chmod u+x before_ut.sh && ./before_ut.sh - go mod vendor && go test ./... -coverprofile=coverage.txt -covermode=atomic - chmod +x integrate_test.sh && ./integrate_test.sh + make verify - name: Coverage run: bash <(curl -s https://codecov.io/bash) \ No newline at end of file From 159268f1543da16f98ab27ce0616cc9ab2d4d4f3 Mon Sep 17 00:00:00 2001 From: Joe Zou Date: Tue, 3 Nov 2020 09:39:07 +0800 Subject: [PATCH 09/12] fix Makefile problem --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 73fc703ab9..2f6c9bd4e2 100644 --- a/Makefile +++ b/Makefile @@ -34,8 +34,8 @@ GO_LICENSE_CHECKER = $(GO_PATH)/bin/license-header-checker LICENSE_DIR = /tmp/tools/license ARCH = amd64 - -ZK_TEST_LIST=registry/zookeeper cluster/router/chain cluster/router/condition cluster/router/tag metadata/report/zookeeper +# for add zookeeper fatjar +ZK_TEST_LIST=config_center/zookeeper registry/zookeeper cluster/router/chain cluster/router/condition cluster/router/tag metadata/report/zookeeper ZK_JAR_NAME=zookeeper-3.4.9-fatjar.jar ZK_FATJAR_BASE=/zookeeper-4unittest/contrib/fatjar ZK_JAR_PATH=remoting/zookeeper$(ZK_FATJAR_BASE) From b6110c56c497d74c41a90778e8a54c020e48c363 Mon Sep 17 00:00:00 2001 From: Joe Zou Date: Tue, 3 Nov 2020 09:40:21 +0800 Subject: [PATCH 10/12] modify the stage name of github action --- .github/workflows/github-actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 9850bec068..9779ae01b5 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -54,5 +54,5 @@ jobs: run: | make verify - - name: Coverage + - name: Post Coverage run: bash <(curl -s https://codecov.io/bash) \ No newline at end of file From 758d80ba083f56ade23af4b1549020c054a1d32a Mon Sep 17 00:00:00 2001 From: Joe Zou Date: Tue, 3 Nov 2020 11:10:17 +0800 Subject: [PATCH 11/12] revert integrate test --- .github/workflows/github-actions.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 9779ae01b5..bdd1c63d44 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -54,5 +54,9 @@ jobs: run: | make verify + - name: Integrate Test + run: | + chmod +x integrate_test.sh && ./integrate_test.sh + - name: Post Coverage run: bash <(curl -s https://codecov.io/bash) \ No newline at end of file From 677bad63a1e1d274730012be1440855b2b2422fb Mon Sep 17 00:00:00 2001 From: Joe Zou Date: Tue, 3 Nov 2020 11:12:02 +0800 Subject: [PATCH 12/12] change format --- .github/workflows/github-actions.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index bdd1c63d44..a585029b03 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -55,8 +55,8 @@ jobs: make verify - name: Integrate Test - run: | - chmod +x integrate_test.sh && ./integrate_test.sh + run: | + chmod +x integrate_test.sh && ./integrate_test.sh - name: Post Coverage run: bash <(curl -s https://codecov.io/bash) \ No newline at end of file