File tree 14 files changed +139
-40
lines changed
14 files changed +139
-40
lines changed Original file line number Diff line number Diff line change
1
+ ## 自查清单
2
+
3
+ 注意: 请完成下列自查清单中的** 所有** 自查项,完成一项勾选一项.
4
+
5
+ - [ ] 当前PR不存在未合并的代码或者其他冲突.
6
+ - [ ] 当前PR中的** 产品代码** 有恰当的注释、文档及** 必备的单元、集成及e2e测试代码** .
7
+
8
+ ## PR概述
9
+ <!--
10
+ 简明扼要地描述一下这个PR所做的事情以及它试图解决的问题。 可以添加图片、链接等来补充说明.
11
+ -->
12
+
13
+ ## 关联Issue
14
+ <!--
15
+ 这个PR是否会关闭某些未解决的Issue?如果是的话,请在这里使用类似于`#901`的方式来提及Issue或`close #877`的方式来关闭对应的Issue.
16
+ -->
17
+
18
+ ## 其他内容
19
+ <!--
20
+ 在这里写下任何你想与代码审查者想要沟通的内容.
21
+ -->
Original file line number Diff line number Diff line change 30
30
with :
31
31
go-version : " >=1.21.0"
32
32
33
- - name : Install goimports
34
- run : go install golang.org/x/tools/cmd/goimports@latest
33
+ - name : Install dependencies
34
+ run : |
35
+ go install mvdan.cc/gofumpt@latest && \
36
+ go install golang.org/x/tools/cmd/goimports@latest && \
37
+ go install github.com/golangci/golangci-lint/cmd/[email protected]
35
38
36
39
- name : Check
37
40
run : |
Original file line number Diff line number Diff line change 31
31
go-version : ' >=1.21.0'
32
32
33
33
- name : Build
34
- run : go build -v ./...
35
-
36
- - name : Test
37
- run : go test -race -coverprofile=cover.out -v ./...
38
-
39
- - name : Post Coverage
40
- uses : codecov/codecov-action@v3
34
+ run : go build -v ./...
Original file line number Diff line number Diff line change 12
12
# See the License for the specific language governing permissions and
13
13
# limitations under the License.
14
14
15
- name : Integration Test
15
+ name : Integration and E2E Test
16
16
17
17
on :
18
18
push :
30
30
with :
31
31
go-version : ' >=1.21.0'
32
32
33
- - name : Test
34
- run : sudo sh ./script/integrate_test.sh
33
+ - name : Unit Test
34
+ run : make ut
35
+
36
+ - name : Run E2E Test
37
+ run : make e2e
38
+
39
+ - name : Post Coverage
40
+ uses : codecov/codecov-action@v3
Original file line number Diff line number Diff line change
1
+ {
2
+ "**/*.go" : " // Copyright 2021 ecodeclub" ,
3
+ "**/*.{yml,toml}" : " # Copyright 2021 ecodeclub" ,
4
+ "**/*.sh" : " # Copyright 2021 ecodeclub"
5
+ }
Original file line number Diff line number Diff line change 6
6
@echo " 初始化开发环境......"
7
7
@find " $( SCRIPTS_PATH) " -type f -name ' *.sh' -exec chmod +x {} \;
8
8
@bash $(SCRIPTS_PATH ) /setup/setup.sh
9
- @$( MAKE ) tidy
9
+ @make tidy
10
10
11
11
# 依赖清理
12
12
.PHONY : tidy
16
16
# 代码风格
17
17
.PHONY : fmt
18
18
fmt :
19
- @goimports -l -w $$(find . -type f -name '*.go' -not -path "./.idea/*" -not -path "./cmd/monolithic/ioc/wire_gen.go" )
20
- @gofumpt -l -w $$(find . -type f -name '*.go' -not -path "./.idea/*" -not -path "./cmd/monolithic/ioc/wire_gen.go" )
19
+ @goimports -l -w $$(find . -type f -name '*.go' -not -path "./.idea/*" )
20
+ @gofumpt -l -w $$(find . -type f -name '*.go' -not -path "./.idea/*" )
21
21
22
22
# 静态扫描
23
23
.PHONY : lint
@@ -29,20 +29,12 @@ lint:
29
29
ut :
30
30
@go test -race -cover -coverprofile=unit.out -failfast -shuffle=on ./...
31
31
32
- # 集成测试
33
- .PHONY : it
34
- it :
35
- @make dev_3rd_down
36
- @make dev_3rd_up
37
- @go test -tags=integration -race -cover -coverprofile=integration.out -failfast -shuffle=on ./...
38
- @make dev_3rd_down
39
-
40
32
# 端到端测试
41
33
.PHONY : e2e
42
34
e2e :
43
35
@make dev_3rd_down
44
36
@make dev_3rd_up
45
- @go test -tags=e2e -race -cover -coverprofile=e2e.out -failfast -shuffle=on ./...
37
+ @go test -tags=e2e -race -cover -coverprofile=e2e.out -failfast -shuffle=on ./e2e/ ...
46
38
@make dev_3rd_down
47
39
48
40
# 启动本地研发 docker 依赖
@@ -58,8 +50,8 @@ dev_3rd_down:
58
50
check :
59
51
@echo " \n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 检查阶段 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n"
60
52
@echo " 整理项目依赖中......"
61
- @$( MAKE ) tidy
53
+ @make tidy
62
54
@echo " 代码风格检查中......"
63
- @$( MAKE ) fmt
55
+ @make fmt
64
56
@echo " 代码静态扫描中......"
65
- @$( MAKE ) lint
57
+ @make lint
Original file line number Diff line number Diff line change
1
+ //go:build e2e
2
+
3
+ // Copyright 2021 ecodeclub
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 (the "License");
6
+ // you may not use this file except in compliance with the License.
7
+ // You may obtain a copy of the License at
8
+ //
9
+ // http://www.apache.org/licenses/LICENSE-2.0
10
+ //
11
+ // Unless required by applicable law or agreed to in writing, software
12
+ // distributed under the License is distributed on an "AS IS" BASIS,
13
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ // See the License for the specific language governing permissions and
15
+ // limitations under the License.
16
+ package e2e
17
+
18
+ import (
19
+ "testing"
20
+
21
+ "github.com/stretchr/testify/assert"
22
+ )
23
+
24
+ func TestE2E (t * testing.T ) {
25
+ assert .True (t , true )
26
+ }
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
+ # Copyright 2021 ecodeclub
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
2
15
3
16
output=$( make tidy)
4
17
if [ -n " $output " ]; then
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
+ # Copyright 2021 ecodeclub
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
2
15
3
16
output=$( make lint)
4
17
if [ -n " $output " ]; then
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
+ # Copyright 2021 ecodeclub
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
2
15
3
16
output=$( make fmt)
4
17
if [ -n " $output " ]; then
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
+ # Copyright 2021 ecodeclub
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
2
15
3
16
echo " 运行端到端测试中......"
4
17
make e2e
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
+ # Copyright 2021 ecodeclub
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
2
15
3
16
echo " 运行单元测试中......"
4
17
make ut
Original file line number Diff line number Diff line change @@ -26,11 +26,6 @@ if [ $? -ne 0 ]; then
26
26
exit 1
27
27
fi
28
28
29
- sh " $( pwd) /scripts/cicd/integration-testing.sh"
30
- if [ $? -ne 0 ]; then
31
- exit 1
32
- fi
33
-
34
29
sh " $( pwd) /scripts/cicd/end-to-end-testing.sh"
35
30
if [ $? -ne 0 ]; then
36
31
exit 1
You can’t perform that action at this time.
0 commit comments