You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/01/11 14:16:19 UTC
[GitHub] [apisix-dashboard] ShiningRush opened a new pull request #1270: Chore:add e2e test coverage
ShiningRush opened a new pull request #1270:
URL: https://github.com/apache/apisix-dashboard/pull/1270
Resolve #1033
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] moonming commented on pull request #1270: Chore:add e2e test coverage
Posted by GitBox <gi...@apache.org>.
moonming commented on pull request #1270:
URL: https://github.com/apache/apisix-dashboard/pull/1270#issuecomment-762636121
ping @ShiningRush @nic-chen any update?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] moonming commented on a change in pull request #1270: Chore:add e2e test coverage
Posted by GitBox <gi...@apache.org>.
moonming commented on a change in pull request #1270:
URL: https://github.com/apache/apisix-dashboard/pull/1270#discussion_r557015869
##########
File path: .github/workflows/backend-e2e-test.yml
##########
@@ -52,3 +52,8 @@ jobs:
- name: run test for plugin skywalking
working-directory: ./api/test/e2e/skywalking
run: go test -v
+
+ - name: output test coverage
+ working-directory: ./api/test/testdata
+ run: |
+ go tool cover -func=./integrationcover.out
Review comment:
@nic-chen you can help @ShiningRush to finish this PR
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] moonming commented on pull request #1270: Chore:add e2e test coverage
Posted by GitBox <gi...@apache.org>.
moonming commented on pull request #1270:
URL: https://github.com/apache/apisix-dashboard/pull/1270#issuecomment-762712473
> > ping @ShiningRush @nic-chen any update?
>
> can't find a way to show e2e and unit test coverage in different graph yet.
> I think we could merge this PR first. and check the coverage report for E2E in the CI result for now.
ok
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] starsz commented on a change in pull request #1270: Chore:add e2e test coverage
Posted by GitBox <gi...@apache.org>.
starsz commented on a change in pull request #1270:
URL: https://github.com/apache/apisix-dashboard/pull/1270#discussion_r556553972
##########
File path: api/cmd/manager/main_test.go
##########
@@ -0,0 +1,55 @@
+/*
+ * 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.
+ */
+package main
+import (
+ "os"
+ "os/signal"
+ "strings"
+ "syscall"
+ "testing"
+)
+func TestMainWrapper(t *testing.T) {
+ if os.Getenv("ENV") == "test" {
+ t.Skip("skipping build binary when execute unit test")
+ }
+
+ var (
+ args []string
+ )
+ for _, arg := range os.Args {
+ switch {
+ case strings.HasPrefix(arg, "DEVEL"):
Review comment:
Just want to know what's this arg used for?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] ShiningRush commented on a change in pull request #1270: Chore:add e2e test coverage
Posted by GitBox <gi...@apache.org>.
ShiningRush commented on a change in pull request #1270:
URL: https://github.com/apache/apisix-dashboard/pull/1270#discussion_r558131957
##########
File path: .github/workflows/backend-test.yml
##########
@@ -0,0 +1,122 @@
+name: Backend Unit Test
+
+on:
+ push:
+ branches:
+ - master
+ pull_request:
+ branches:
+ - master
+
+jobs:
+
+ backend-unit-test:
+ runs-on: ubuntu-latest
+
+ services:
+ etcd:
+ image: bitnami/etcd:3.4.13
+ ports:
+ - 2379:2379
+ - 2380:2380
+ env:
+ ALLOW_NONE_AUTHENTICATION: yes
+
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: get lua lib
+ run: |
+ wget https://github.com/api7/dag-to-lua/archive/v1.1.tar.gz
+ sudo mkdir -p ./api/dag-to-lua
+ tar -zxvf v1.1.tar.gz
+ sudo mv ./dag-to-lua-1.1/lib/* ./api/dag-to-lua/
+
+ - name: setup go
+ uses: actions/setup-go@v2.1.3
+ with:
+ go-version: '1.13'
+
+ - name: run test
+ run: |
+ make api-test
+
+ - name: output test coverage
+ working-directory: ./api
+ run: |
+ go tool cover -func=./coverage.txt
+
+ - name: upload coverage file
+ uses: actions/upload-artifact@v1
+ with:
+ name: coverage-file
+ path: ./api/coverage.txt
+
+
+ backend-e2e-test:
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: setup go
+ uses: actions/setup-go@v2.1.3
+ with:
+ go-version: '1.13'
+
+ - name: run docker compose
+ working-directory: ./api/test/docker
+ run: |
+ docker-compose up -d
+ sleep 5
+ docker logs docker_managerapi_1
+
+ - name: run test
+ working-directory: ./api/test/e2e
+ run: go test -v
+
+ - name: re-generate json schema
+ working-directory: ./api/
+ run: |
+ curl 127.0.0.1:9090/v1/schema > ./conf/schema.json
+
+ - name: stop docker compose
+ working-directory: ./api/test/docker
+ run: |
+ docker-compose down
+ sleep 10
+
+ - name: re-run docker compose
+ working-directory: ./api/test/docker
+ run: |
+ docker-compose up -d --build
+ sleep 5
+ docker logs docker_managerapi_1
+
+ - name: run test for plugin skywalking
+ working-directory: ./api/test/e2e/skywalking
+ run: go test -v
+
+ - name: output test coverage
+ working-directory: ./api/test/testdata
+ run: |
+ go tool cover -func=./integrationcover.out
+
+ - name: download coverage file
+ uses: actions/download-artifact@v2
+ with:
+ name: coverage-file
+
+ - name: merge coverage file
+ run: |
+ git clone https://github.com/wadey/gocovmerge.git
+ cd gocovmerge
+ go build .
+ cd ../
+ ./gocovmerge/gocovmerge ./api/test/testdata/integrationcover.out coverage.txt > ./api/coverage.txt
Review comment:
Is that really good? unit test's coverage is usually greater than e2e, so we maybe just know unit test coverage.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] ShiningRush commented on a change in pull request #1270: Chore:add e2e test coverage
Posted by GitBox <gi...@apache.org>.
ShiningRush commented on a change in pull request #1270:
URL: https://github.com/apache/apisix-dashboard/pull/1270#discussion_r556224522
##########
File path: .github/workflows/backend-e2e-test.yml
##########
@@ -52,3 +52,8 @@ jobs:
- name: run test for plugin skywalking
working-directory: ./api/test/e2e/skywalking
run: go test -v
+
+ - name: output test coverage
+ working-directory: ./api/test/testdata
+ run: |
+ go tool cover -func=./integrationcover.out
Review comment:
Is here any demo?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] ShiningRush commented on a change in pull request #1270: Chore:add e2e test coverage
Posted by GitBox <gi...@apache.org>.
ShiningRush commented on a change in pull request #1270:
URL: https://github.com/apache/apisix-dashboard/pull/1270#discussion_r558114644
##########
File path: api/cmd/manager/main_test.go
##########
@@ -0,0 +1,55 @@
+/*
+ * 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.
+ */
+package main
+import (
+ "os"
+ "os/signal"
+ "strings"
+ "syscall"
+ "testing"
+)
+func TestMainWrapper(t *testing.T) {
+ if os.Getenv("ENV") == "test" {
+ t.Skip("skipping build binary when execute unit test")
+ }
+
+ var (
+ args []string
+ )
+ for _, arg := range os.Args {
+ switch {
+ case strings.HasPrefix(arg, "DEVEL"):
Review comment:
Hmmm, it is no used for manager api, we can delete it.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] nic-chen commented on a change in pull request #1270: Chore:add e2e test coverage
Posted by GitBox <gi...@apache.org>.
nic-chen commented on a change in pull request #1270:
URL: https://github.com/apache/apisix-dashboard/pull/1270#discussion_r555088362
##########
File path: api/cmd/manager/main_test.go
##########
@@ -0,0 +1,35 @@
+package main
Review comment:
do we need to skip this file in unit test?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #1270: Chore:add e2e test coverage
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #1270:
URL: https://github.com/apache/apisix-dashboard/pull/1270#issuecomment-758353231
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1270?src=pr&el=h1) Report
> Merging [#1270](https://codecov.io/gh/apache/apisix-dashboard/pull/1270?src=pr&el=desc) (45f0b92) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/0f322e1d4a03e3416da1ae989fcfa49232035648?el=desc) (0f322e1) will **decrease** coverage by `0.09%`.
> The diff coverage is `n/a`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1270?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #1270 +/- ##
==========================================
- Coverage 42.44% 42.34% -0.10%
==========================================
Files 31 32 +1
Lines 1932 1934 +2
==========================================
- Hits 820 819 -1
- Misses 1001 1004 +3
Partials 111 111
```
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1270?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [api/internal/core/store/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1270/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmUuZ28=) | `79.37% <0.00%> (-0.63%)` | :arrow_down: |
| [api/cmd/manager/main.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1270/diff?src=pr&el=tree#diff-YXBpL2NtZC9tYW5hZ2VyL21haW4uZ28=) | `0.00% <0.00%> (ø)` | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1270?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1270?src=pr&el=footer). Last update [0f322e1...45f0b92](https://codecov.io/gh/apache/apisix-dashboard/pull/1270?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] nic-chen commented on pull request #1270: Chore:add e2e test coverage
Posted by GitBox <gi...@apache.org>.
nic-chen commented on pull request #1270:
URL: https://github.com/apache/apisix-dashboard/pull/1270#issuecomment-762704147
> ping @ShiningRush @nic-chen any update?
can't find a way to show e2e and unit test coverage in different graph yet.
I think we could merge this PR first. and check the coverage report for E2E in the CI result for now.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] nic-chen commented on a change in pull request #1270: Chore:add e2e test coverage
Posted by GitBox <gi...@apache.org>.
nic-chen commented on a change in pull request #1270:
URL: https://github.com/apache/apisix-dashboard/pull/1270#discussion_r556224036
##########
File path: .github/workflows/backend-e2e-test.yml
##########
@@ -52,3 +52,8 @@ jobs:
- name: run test for plugin skywalking
working-directory: ./api/test/e2e/skywalking
run: go test -v
+
+ - name: output test coverage
+ working-directory: ./api/test/testdata
+ run: |
+ go tool cover -func=./integrationcover.out
Review comment:
@ShiningRush I think we could upload the result to `Codecov`, It's Easier to view.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #1270: Chore:add e2e test coverage
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #1270:
URL: https://github.com/apache/apisix-dashboard/pull/1270#issuecomment-758353231
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1270?src=pr&el=h1) Report
> Merging [#1270](https://codecov.io/gh/apache/apisix-dashboard/pull/1270?src=pr&el=desc) (ef358fb) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/84af5f178ad2668dc803d57d47044bc9330ddaba?el=desc) (84af5f1) will **increase** coverage by `1.22%`.
> The diff coverage is `n/a`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1270?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #1270 +/- ##
==========================================
+ Coverage 42.83% 44.06% +1.22%
==========================================
Files 31 32 +1
Lines 1940 1945 +5
==========================================
+ Hits 831 857 +26
+ Misses 999 976 -23
- Partials 110 112 +2
```
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1270?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [api/cmd/manager/main.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1270/diff?src=pr&el=tree#diff-YXBpL2NtZC9tYW5hZ2VyL21haW4uZ28=) | `0.00% <0.00%> (ø)` | |
| [api/internal/filter/authentication.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1270/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9hdXRoZW50aWNhdGlvbi5nbw==) | `76.47% <0.00%> (+76.47%)` | :arrow_up: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1270?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1270?src=pr&el=footer). Last update [84af5f1...ef358fb](https://codecov.io/gh/apache/apisix-dashboard/pull/1270?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] ShiningRush commented on a change in pull request #1270: Chore:add e2e test coverage
Posted by GitBox <gi...@apache.org>.
ShiningRush commented on a change in pull request #1270:
URL: https://github.com/apache/apisix-dashboard/pull/1270#discussion_r558288412
##########
File path: .github/workflows/backend-test.yml
##########
@@ -0,0 +1,122 @@
+name: Backend Unit Test
+
+on:
+ push:
+ branches:
+ - master
+ pull_request:
+ branches:
+ - master
+
+jobs:
+
+ backend-unit-test:
+ runs-on: ubuntu-latest
+
+ services:
+ etcd:
+ image: bitnami/etcd:3.4.13
+ ports:
+ - 2379:2379
+ - 2380:2380
+ env:
+ ALLOW_NONE_AUTHENTICATION: yes
+
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: get lua lib
+ run: |
+ wget https://github.com/api7/dag-to-lua/archive/v1.1.tar.gz
+ sudo mkdir -p ./api/dag-to-lua
+ tar -zxvf v1.1.tar.gz
+ sudo mv ./dag-to-lua-1.1/lib/* ./api/dag-to-lua/
+
+ - name: setup go
+ uses: actions/setup-go@v2.1.3
+ with:
+ go-version: '1.13'
+
+ - name: run test
+ run: |
+ make api-test
+
+ - name: output test coverage
+ working-directory: ./api
+ run: |
+ go tool cover -func=./coverage.txt
+
+ - name: upload coverage file
+ uses: actions/upload-artifact@v1
+ with:
+ name: coverage-file
+ path: ./api/coverage.txt
+
+
+ backend-e2e-test:
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: setup go
+ uses: actions/setup-go@v2.1.3
+ with:
+ go-version: '1.13'
+
+ - name: run docker compose
+ working-directory: ./api/test/docker
+ run: |
+ docker-compose up -d
+ sleep 5
+ docker logs docker_managerapi_1
+
+ - name: run test
+ working-directory: ./api/test/e2e
+ run: go test -v
+
+ - name: re-generate json schema
+ working-directory: ./api/
+ run: |
+ curl 127.0.0.1:9090/v1/schema > ./conf/schema.json
+
+ - name: stop docker compose
+ working-directory: ./api/test/docker
+ run: |
+ docker-compose down
+ sleep 10
+
+ - name: re-run docker compose
+ working-directory: ./api/test/docker
+ run: |
+ docker-compose up -d --build
+ sleep 5
+ docker logs docker_managerapi_1
+
+ - name: run test for plugin skywalking
+ working-directory: ./api/test/e2e/skywalking
+ run: go test -v
+
+ - name: output test coverage
+ working-directory: ./api/test/testdata
+ run: |
+ go tool cover -func=./integrationcover.out
+
+ - name: download coverage file
+ uses: actions/download-artifact@v2
+ with:
+ name: coverage-file
+
+ - name: merge coverage file
+ run: |
+ git clone https://github.com/wadey/gocovmerge.git
+ cd gocovmerge
+ go build .
+ cd ../
+ ./gocovmerge/gocovmerge ./api/test/testdata/integrationcover.out coverage.txt > ./api/coverage.txt
Review comment:
Is it possible to show e2e and unit test coverage in different graph?It is helpful to know the real e2e coverage.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] ShiningRush commented on pull request #1270: Chore:add e2e test coverage
Posted by GitBox <gi...@apache.org>.
ShiningRush commented on pull request #1270:
URL: https://github.com/apache/apisix-dashboard/pull/1270#issuecomment-758596795
@juzhiyuan please have look at the failed case, it looks like not related with this PR.Is it stable?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] nic-chen commented on a change in pull request #1270: Chore:add e2e test coverage
Posted by GitBox <gi...@apache.org>.
nic-chen commented on a change in pull request #1270:
URL: https://github.com/apache/apisix-dashboard/pull/1270#discussion_r557271381
##########
File path: .github/workflows/backend-e2e-test.yml
##########
@@ -52,3 +52,8 @@ jobs:
- name: run test for plugin skywalking
working-directory: ./api/test/e2e/skywalking
run: go test -v
+
+ - name: output test coverage
+ working-directory: ./api/test/testdata
+ run: |
+ go tool cover -func=./integrationcover.out
Review comment:
OK
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] moonming edited a comment on pull request #1270: Chore:add e2e test coverage
Posted by GitBox <gi...@apache.org>.
moonming edited a comment on pull request #1270:
URL: https://github.com/apache/apisix-dashboard/pull/1270#issuecomment-760779464
where can we get the code coverage? is there a report like codecov?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #1270: Chore:add e2e test coverage
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #1270:
URL: https://github.com/apache/apisix-dashboard/pull/1270#issuecomment-758353231
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1270?src=pr&el=h1) Report
> Merging [#1270](https://codecov.io/gh/apache/apisix-dashboard/pull/1270?src=pr&el=desc) (919167f) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/84af5f178ad2668dc803d57d47044bc9330ddaba?el=desc) (84af5f1) will **increase** coverage by `1.22%`.
> The diff coverage is `n/a`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1270?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #1270 +/- ##
==========================================
+ Coverage 42.83% 44.06% +1.22%
==========================================
Files 31 32 +1
Lines 1940 1945 +5
==========================================
+ Hits 831 857 +26
+ Misses 999 976 -23
- Partials 110 112 +2
```
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1270?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [api/cmd/manager/main.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1270/diff?src=pr&el=tree#diff-YXBpL2NtZC9tYW5hZ2VyL21haW4uZ28=) | `0.00% <0.00%> (ø)` | |
| [api/internal/filter/authentication.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1270/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9hdXRoZW50aWNhdGlvbi5nbw==) | `76.47% <0.00%> (+76.47%)` | :arrow_up: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1270?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1270?src=pr&el=footer). Last update [84af5f1...919167f](https://codecov.io/gh/apache/apisix-dashboard/pull/1270?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] moonming commented on pull request #1270: Chore:add e2e test coverage
Posted by GitBox <gi...@apache.org>.
moonming commented on pull request #1270:
URL: https://github.com/apache/apisix-dashboard/pull/1270#issuecomment-760779464
how can we get the code coverage?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] nic-chen commented on a change in pull request #1270: Chore:add e2e test coverage
Posted by GitBox <gi...@apache.org>.
nic-chen commented on a change in pull request #1270:
URL: https://github.com/apache/apisix-dashboard/pull/1270#discussion_r558247936
##########
File path: .github/workflows/backend-test.yml
##########
@@ -0,0 +1,122 @@
+name: Backend Unit Test
+
+on:
+ push:
+ branches:
+ - master
+ pull_request:
+ branches:
+ - master
+
+jobs:
+
+ backend-unit-test:
+ runs-on: ubuntu-latest
+
+ services:
+ etcd:
+ image: bitnami/etcd:3.4.13
+ ports:
+ - 2379:2379
+ - 2380:2380
+ env:
+ ALLOW_NONE_AUTHENTICATION: yes
+
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: get lua lib
+ run: |
+ wget https://github.com/api7/dag-to-lua/archive/v1.1.tar.gz
+ sudo mkdir -p ./api/dag-to-lua
+ tar -zxvf v1.1.tar.gz
+ sudo mv ./dag-to-lua-1.1/lib/* ./api/dag-to-lua/
+
+ - name: setup go
+ uses: actions/setup-go@v2.1.3
+ with:
+ go-version: '1.13'
+
+ - name: run test
+ run: |
+ make api-test
+
+ - name: output test coverage
+ working-directory: ./api
+ run: |
+ go tool cover -func=./coverage.txt
+
+ - name: upload coverage file
+ uses: actions/upload-artifact@v1
+ with:
+ name: coverage-file
+ path: ./api/coverage.txt
+
+
+ backend-e2e-test:
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: setup go
+ uses: actions/setup-go@v2.1.3
+ with:
+ go-version: '1.13'
+
+ - name: run docker compose
+ working-directory: ./api/test/docker
+ run: |
+ docker-compose up -d
+ sleep 5
+ docker logs docker_managerapi_1
+
+ - name: run test
+ working-directory: ./api/test/e2e
+ run: go test -v
+
+ - name: re-generate json schema
+ working-directory: ./api/
+ run: |
+ curl 127.0.0.1:9090/v1/schema > ./conf/schema.json
+
+ - name: stop docker compose
+ working-directory: ./api/test/docker
+ run: |
+ docker-compose down
+ sleep 10
+
+ - name: re-run docker compose
+ working-directory: ./api/test/docker
+ run: |
+ docker-compose up -d --build
+ sleep 5
+ docker logs docker_managerapi_1
+
+ - name: run test for plugin skywalking
+ working-directory: ./api/test/e2e/skywalking
+ run: go test -v
+
+ - name: output test coverage
+ working-directory: ./api/test/testdata
+ run: |
+ go tool cover -func=./integrationcover.out
+
+ - name: download coverage file
+ uses: actions/download-artifact@v2
+ with:
+ name: coverage-file
+
+ - name: merge coverage file
+ run: |
+ git clone https://github.com/wadey/gocovmerge.git
+ cd gocovmerge
+ go build .
+ cd ../
+ ./gocovmerge/gocovmerge ./api/test/testdata/integrationcover.out coverage.txt > ./api/coverage.txt
Review comment:
oh, it will automatically merge. we don't need to merge it manually.
anyway, what's your suggestion of this? @ShiningRush
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] membphis merged pull request #1270: Chore:add e2e test coverage
Posted by GitBox <gi...@apache.org>.
membphis merged pull request #1270:
URL: https://github.com/apache/apisix-dashboard/pull/1270
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] nic-chen commented on pull request #1270: Chore:add e2e test coverage
Posted by GitBox <gi...@apache.org>.
nic-chen commented on pull request #1270:
URL: https://github.com/apache/apisix-dashboard/pull/1270#issuecomment-760887935
> where can we get the code coverage? is there a report like codecov?
I have looked at other similar tools, and there is no report in pr like `codecov`.
And `codecov` will automatically merge reports submitted multiple times.
So we could choose:
1. Let e2e and unit test reports merge
2. Only submit the unit test or only the e2e test report, and we need to check the other report on ci results ([example](https://github.com/apache/apisix-dashboard/runs/1707440752#step:10:243)).
What's your suggestion? @moonming
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] nic-chen commented on a change in pull request #1270: Chore:add e2e test coverage
Posted by GitBox <gi...@apache.org>.
nic-chen commented on a change in pull request #1270:
URL: https://github.com/apache/apisix-dashboard/pull/1270#discussion_r558734545
##########
File path: .github/workflows/backend-test.yml
##########
@@ -0,0 +1,122 @@
+name: Backend Unit Test
+
+on:
+ push:
+ branches:
+ - master
+ pull_request:
+ branches:
+ - master
+
+jobs:
+
+ backend-unit-test:
+ runs-on: ubuntu-latest
+
+ services:
+ etcd:
+ image: bitnami/etcd:3.4.13
+ ports:
+ - 2379:2379
+ - 2380:2380
+ env:
+ ALLOW_NONE_AUTHENTICATION: yes
+
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: get lua lib
+ run: |
+ wget https://github.com/api7/dag-to-lua/archive/v1.1.tar.gz
+ sudo mkdir -p ./api/dag-to-lua
+ tar -zxvf v1.1.tar.gz
+ sudo mv ./dag-to-lua-1.1/lib/* ./api/dag-to-lua/
+
+ - name: setup go
+ uses: actions/setup-go@v2.1.3
+ with:
+ go-version: '1.13'
+
+ - name: run test
+ run: |
+ make api-test
+
+ - name: output test coverage
+ working-directory: ./api
+ run: |
+ go tool cover -func=./coverage.txt
+
+ - name: upload coverage file
+ uses: actions/upload-artifact@v1
+ with:
+ name: coverage-file
+ path: ./api/coverage.txt
+
+
+ backend-e2e-test:
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: setup go
+ uses: actions/setup-go@v2.1.3
+ with:
+ go-version: '1.13'
+
+ - name: run docker compose
+ working-directory: ./api/test/docker
+ run: |
+ docker-compose up -d
+ sleep 5
+ docker logs docker_managerapi_1
+
+ - name: run test
+ working-directory: ./api/test/e2e
+ run: go test -v
+
+ - name: re-generate json schema
+ working-directory: ./api/
+ run: |
+ curl 127.0.0.1:9090/v1/schema > ./conf/schema.json
+
+ - name: stop docker compose
+ working-directory: ./api/test/docker
+ run: |
+ docker-compose down
+ sleep 10
+
+ - name: re-run docker compose
+ working-directory: ./api/test/docker
+ run: |
+ docker-compose up -d --build
+ sleep 5
+ docker logs docker_managerapi_1
+
+ - name: run test for plugin skywalking
+ working-directory: ./api/test/e2e/skywalking
+ run: go test -v
+
+ - name: output test coverage
+ working-directory: ./api/test/testdata
+ run: |
+ go tool cover -func=./integrationcover.out
+
+ - name: download coverage file
+ uses: actions/download-artifact@v2
+ with:
+ name: coverage-file
+
+ - name: merge coverage file
+ run: |
+ git clone https://github.com/wadey/gocovmerge.git
+ cd gocovmerge
+ go build .
+ cd ../
+ ./gocovmerge/gocovmerge ./api/test/testdata/integrationcover.out coverage.txt > ./api/coverage.txt
Review comment:
I haven't found a way to display two graphs at a PR yet.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] ShiningRush commented on a change in pull request #1270: Chore:add e2e test coverage
Posted by GitBox <gi...@apache.org>.
ShiningRush commented on a change in pull request #1270:
URL: https://github.com/apache/apisix-dashboard/pull/1270#discussion_r555705062
##########
File path: api/cmd/manager/main_test.go
##########
@@ -0,0 +1,35 @@
+package main
Review comment:
Yes, I already config it to skip it when run unit test
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #1270: Chore:add e2e test coverage
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #1270:
URL: https://github.com/apache/apisix-dashboard/pull/1270#issuecomment-758353231
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1270?src=pr&el=h1) Report
> Merging [#1270](https://codecov.io/gh/apache/apisix-dashboard/pull/1270?src=pr&el=desc) (6323215) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/84af5f178ad2668dc803d57d47044bc9330ddaba?el=desc) (84af5f1) will **increase** coverage by `1.22%`.
> The diff coverage is `n/a`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1270?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #1270 +/- ##
==========================================
+ Coverage 42.83% 44.06% +1.22%
==========================================
Files 31 32 +1
Lines 1940 1945 +5
==========================================
+ Hits 831 857 +26
+ Misses 999 976 -23
- Partials 110 112 +2
```
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1270?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [api/cmd/manager/main.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1270/diff?src=pr&el=tree#diff-YXBpL2NtZC9tYW5hZ2VyL21haW4uZ28=) | `0.00% <0.00%> (ø)` | |
| [api/internal/filter/authentication.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1270/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9hdXRoZW50aWNhdGlvbi5nbw==) | `76.47% <0.00%> (+76.47%)` | :arrow_up: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1270?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1270?src=pr&el=footer). Last update [84af5f1...6323215](https://codecov.io/gh/apache/apisix-dashboard/pull/1270?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] nic-chen commented on a change in pull request #1270: Chore:add e2e test coverage
Posted by GitBox <gi...@apache.org>.
nic-chen commented on a change in pull request #1270:
URL: https://github.com/apache/apisix-dashboard/pull/1270#discussion_r556236129
##########
File path: .github/workflows/backend-e2e-test.yml
##########
@@ -52,3 +52,8 @@ jobs:
- name: run test for plugin skywalking
working-directory: ./api/test/e2e/skywalking
run: go test -v
+
+ - name: output test coverage
+ working-directory: ./api/test/testdata
+ run: |
+ go tool cover -func=./integrationcover.out
Review comment:
how about this ?
https://github.com/apache/apisix-dashboard/blob/master/.github/workflows/backend-unit-test.yml#L46
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-io commented on pull request #1270: Chore:add e2e test coverage
Posted by GitBox <gi...@apache.org>.
codecov-io commented on pull request #1270:
URL: https://github.com/apache/apisix-dashboard/pull/1270#issuecomment-758353231
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1270?src=pr&el=h1) Report
> Merging [#1270](https://codecov.io/gh/apache/apisix-dashboard/pull/1270?src=pr&el=desc) (11d2ca6) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/d6dcaa4066acf864b2d9303e570486b5dabb9265?el=desc) (d6dcaa4) will **not change** coverage.
> The diff coverage is `n/a`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1270?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #1270 +/- ##
=======================================
Coverage 42.44% 42.44%
=======================================
Files 31 31
Lines 1932 1932
=======================================
Hits 820 820
Misses 1001 1001
Partials 111 111
```
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1270?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1270?src=pr&el=footer). Last update [d6dcaa4...11d2ca6](https://codecov.io/gh/apache/apisix-dashboard/pull/1270?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #1270: Chore:add e2e test coverage
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #1270:
URL: https://github.com/apache/apisix-dashboard/pull/1270#issuecomment-758353231
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1270?src=pr&el=h1) Report
> Merging [#1270](https://codecov.io/gh/apache/apisix-dashboard/pull/1270?src=pr&el=desc) (6323215) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/84af5f178ad2668dc803d57d47044bc9330ddaba?el=desc) (84af5f1) will **increase** coverage by `20.50%`.
> The diff coverage is `n/a`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1270?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #1270 +/- ##
===========================================
+ Coverage 42.83% 63.34% +20.50%
===========================================
Files 31 41 +10
Lines 1940 2316 +376
===========================================
+ Hits 831 1467 +636
+ Misses 999 675 -324
- Partials 110 174 +64
```
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1270?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [api/cmd/managerapi.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1270/diff?src=pr&el=tree#diff-YXBpL2NtZC9tYW5hZ2VyYXBpLmdv) | `77.08% <0.00%> (ø)` | |
| [api/cmd/manager/main.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1270/diff?src=pr&el=tree#diff-YXBpL2NtZC9tYW5hZ2VyL21haW4uZ28=) | `0.00% <0.00%> (ø)` | |
| [api/internal/core/storage/etcd.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1270/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmFnZS9ldGNkLmdv) | `59.15% <0.00%> (ø)` | |
| [...l/handler/route\_online\_debug/route\_online\_debug.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1270/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvcm91dGVfb25saW5lX2RlYnVnL3JvdXRlX29ubGluZV9kZWJ1Zy5nbw==) | `73.80% <0.00%> (ø)` | |
| [api/internal/log/log.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1270/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2xvZy9sb2cuZ28=) | `50.00% <0.00%> (ø)` | |
| [api/internal/route.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1270/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL3JvdXRlLmdv) | `83.87% <0.00%> (ø)` | |
| [api/internal/conf/conf.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1270/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvbmYvY29uZi5nbw==) | `67.85% <0.00%> (ø)` | |
| [api/internal/core/storage/storage\_mock.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1270/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmFnZS9zdG9yYWdlX21vY2suZ28=) | `0.00% <0.00%> (ø)` | |
| [api/internal/log/zap.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1270/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2xvZy96YXAuZ28=) | `60.86% <0.00%> (ø)` | |
| [api/internal/handler/healthz/healthz.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1270/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvaGVhbHRoei9oZWFsdGh6Lmdv) | `66.66% <0.00%> (ø)` | |
| ... and [24 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1270/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1270?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1270?src=pr&el=footer). Last update [84af5f1...6323215](https://codecov.io/gh/apache/apisix-dashboard/pull/1270?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] ShiningRush commented on pull request #1270: Chore:add e2e test coverage
Posted by GitBox <gi...@apache.org>.
ShiningRush commented on pull request #1270:
URL: https://github.com/apache/apisix-dashboard/pull/1270#issuecomment-762738924
Got it
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org