Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 94450bf
Author: litesun <7sunmiao@gmail.com>
Date:   Tue Nov 3 10:19:04 2020 +0800

    fix: promethus incorrect value when update route (#666)

commit de8bdbf
Author: nic-chen <33000667+nic-chen@users.noreply.github.com>
Date:   Tue Nov 3 07:50:29 2020 +0800

    CI: collect golang unit test code coverage (#654)

commit 722c0fd
Author: litesun <7sunmiao@gmail.com>
Date:   Tue Nov 3 00:03:06 2020 +0800

    feat: added e2e test for Login page (#619)

    * feat: added Front-end e2e test YAML file

    * feat: added login e2e test

    * feat: update Login.e2e.js

    * Update Login.e2e.js

    * feat: added e2e readme

    * feat: added licence

    * feat: added  start-server-and-test package

    * feat: update login test case

    * Update frontend-e2e-test.yml

    * feat: added logout test case

    * Update frontend-e2e-test.yml

    * feat: added login failed with empty input

    * feat: update CI

    * feat: update text

    * feat: added public.js

    * feat: change logout timeout

    * feat: Added e2e test documentation link to development.md

    * Update develop.md

    * Update develop.zh-CN.md

    * Update README.md

    Co-authored-by: 琚致远 <juzhiyuan@apache.org>

commit 915ce83
Author: nic-chen <33000667+nic-chen@users.noreply.github.com>
Date:   Mon Nov 2 21:13:34 2020 +0800

    test: add e2e test for field hosts in `route` api (#612)

    * feat: ETCD cluster and APISIX cluster for CI

    * feat: add test cases

    * feat: add upstream service in docker compose

    * fix: comment

    * test: add test cases

    * fix: code format

    * test: add ci

    * fix ci

    * fix ci

    * fix ci

    * fix: remove consumer test

    * test: sleep for sync

    * test: e2e as an independent subproject

    * fix CI error

    * test: run docker

    * fix: remove json schema generate script in docker build

    * fix: check host and hosts config together

    * fix ci

    * test: add test cases for `host` in route

    * remove useless code

    * fix: using relative path to read conf (#617)

    * fix: using  relative path

    * fix path

    * fix path

    * fix conf path

    * fix ci error

    * fix etcd ip

    * fix: code format

    * run backend e2e test ci on v2 branch

    * fix: code format

    * fix: code format

    * fix: CI error

    * test: remove deploy CI again

    * remove useless codes

    * fix: go fmt

    * test: don't use `go fmt`

    * fix: code format

    * fix: var name

    * fix lint

    * fix CI error

    * debug

    * fix: docker container name

    * fix CI error

    * fix CI error

    * test: add more test cases

    * fix CI error

    * chore: remove useless code

    * fix: go fmt

    * fix: refactor test code

    * fix: check body

    * fix small issue

    * fix: update docker compose

    * fix CI

    * test

    * test

    * test: build image first

    * test: revert subnet ip in docker compose

    * fix by review

    * fix: docker compose

    * test: add test cases

    * fix: remove useless code

    * fix: code format

    * test: code format

commit 94d0245
Author: 琚致远 <juzhiyuan@apache.org>
Date:   Mon Nov 2 13:17:42 2020 +0800

    chore: improve issue template and vscode (#660)
  • Loading branch information
juzhiyuan committed Nov 3, 2020
1 parent 8782e3f commit 93d38ee
Show file tree
Hide file tree
Showing 33 changed files with 1,480 additions and 306 deletions.
23 changes: 0 additions & 23 deletions .github/ISSUE_TEMPLATE

This file was deleted.

36 changes: 36 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: Bug report
about: Create a bug report for the Apache APISIX Dashboard
labels: "bug"
---

# Bug report

## Describe the bug

A clear and concise description of what the bug is.

## How to Reproduce

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

## Expected behavior

A clear and concise description of what you expected to happen.

## Screenshots

Add screenshots to help explain your problem if applicable.

## System information

- OS: [e.g. macOS, Windows]
- Browser (if applies) [e.g. Chrome, Safari, Edge]
- Version: [e.g. 2.0-rc3]

## Additional context

Add any other context about the problem here.
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Visit Apache APISIX
url: https://github.com/apache/apisix
about: Ask questions or discuss with other community members about Apache APISIX
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Feature request
about: Create a feature request for the Apache APISIX Dashboard
labels: 'feature'
---

# Feature request

## Please describe your feature

A clear and concise description of what you want and what your use case is.

## Describe the solution you'd like

A clear and concise description of what you want to happen.

## Describe alternatives you've considered

A clear and concise description of any alternative solutions or features you've considered.

## Additional context

Add any other context or screenshots about the feature request here.
37 changes: 37 additions & 0 deletions .github/workflows/e2e-test-backend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Backend E2E Test

on:
push:
branches:
- master
pull_request:
branches:
- master
- v2.0

jobs:
run-test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: install runtime
run: |
sudo apt-get update
sudo add-apt-repository ppa:longsleep/golang-backports
sudo apt update
export GO111MOUDULE=on
sudo apt install golang-1.14-go
- 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
31 changes: 31 additions & 0 deletions .github/workflows/frontend-e2e-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Front-end e2e test

on:
push:
branches:
- master
pull_request:
branches:
- master
- v2.0
defaults:
run:
working-directory: frontend

jobs:
frontend-e2e:
name: Front-end e2e test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Setup Node.js environment for Front-end
uses: actions/setup-node@v1
with:
node-version: 14.x

- name: Install Front-end dependencies
run: yarn install

- name: Start Front-end then test
run: yarn test:e2e
17 changes: 14 additions & 3 deletions .github/workflows/test-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,25 @@ jobs:
sudo apt install golang-1.14-go
- name: run test
run: |
make api-test
- name: upload coverage profile
working-directory: ./api
run: go test ./...
run: |
bash <(curl -s https://codecov.io/bash)
- name: run with custom port
working-directory: ./api
run: |
sed -i 's/8080/\# 8088/' conf/conf.json
go run main.go &
export GO111MOUDULE=on
export APISIX_CONF_PATH=$PWD/conf
sed -i 's/8080/8088/' conf/conf.json
go build -o ./manager-api
./manager-api > ./api.log 2>&1 &
sleep 2
cat ./api.log
cat conf/conf.json
- name: run with custom port
working-directory: ./api
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ _roadhog-api-doc

# production
dist
/.vscode

# misc
.DS_Store
Expand All @@ -19,7 +18,6 @@ yarn-error.log
.idea
package-lock.json
*bak
.vscode

# visual studio code
.history
Expand Down
8 changes: 8 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"eslint.validate": [
"javascript",
"javascriptreact",
{ "language": "typescript", "autoFix": true },
{ "language": "typescriptreact", "autoFix": true }
]
}
18 changes: 17 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,27 @@
# limitations under the License.
#

export GO111MODULE=on

### license-check: Check apisix-dashboard source codes for Apache License
.PHONY: license-check
license-check:
ifeq ("$(wildcard .actions/openwhisk-utilities/scancode/scanCode.py)", "")
git clone https://github.com/apache/openwhisk-utilities.git .actions/openwhisk-utilities
cp .actions/ASF* .actions/openwhisk-utilities/scancode/
endif
.actions/openwhisk-utilities/scancode/scanCode.py --config .actions/ASF-Release.cfg ./
.actions/openwhisk-utilities/scancode/scanCode.py --config .actions/ASF-Release.cfg ./


### api-test: Run the tests of manager-api
.PHONY: api-test
api-test:
cd api/ && go test -v -race -cover -coverprofile=coverage.txt -covermode=atomic ./...


### help: Show Makefile rules
.PHONY: help
help: default
@echo Makefile rules:
@echo
@grep -E '^### [-A-Za-z0-9_]+:' Makefile | sed 's/###/ /'
14 changes: 1 addition & 13 deletions api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ RUN mkdir -p /go/manager-api \
&& mv /go/src/github.com/apisix/manager-api/entry.sh /go/manager-api/ \
&& mv /go/src/github.com/apisix/manager-api/build-tools/* /go/manager-api/build-tools/ \
&& mv /go/src/github.com/apisix/manager-api/conf/conf_preview.json /go/manager-api/conf.json \
&& mv /go/src/github.com/apisix/manager-api/conf/schema.json /go/manager-api/schema.json \
&& rm -rf /go/src/github.com/apisix/manager-api \
&& rm -rf /etc/localtime \
&& ln -s /usr/share/zoneinfo/Hongkong /etc/localtime \
Expand All @@ -37,13 +38,6 @@ RUN wget https://github.com/api7/dag-to-lua/archive/v1.1.tar.gz \
&& mkdir -p /go/manager-api/dag-to-lua \
&& mv -u ./dag-to-lua-1.1/lib/* /go/manager-api/dag-to-lua/

RUN wget https://github.com/apache/apisix/archive/master.zip \
&& apt-get update && apt-get install zip -y \
&& unzip master.zip \
&& rm -rf /go/manager-api/build-tools/apisix/ \
&& mkdir -p /go/manager-api/build-tools/apisix \
&& mv ./apisix-master/apisix/* /go/manager-api/build-tools/apisix/

FROM alpine:3.11

RUN mkdir -p /go/manager-api \
Expand All @@ -60,12 +54,6 @@ WORKDIR /go/manager-api
COPY --from=build-env /go/manager-api/ /go/manager-api/
COPY --from=build-env /usr/share/zoneinfo/Hongkong /etc/localtime

RUN cd /go/manager-api/build-tools \
&& lua schema-sync.lua > /go/manager-api/schema.json \
&& cd /go/manager-api/ \
&& rm -rf /go/manager-api/build-tools/
ADD ./dist /go/manager-api

EXPOSE 8080

RUN chmod +x ./entry.sh
Expand Down
6 changes: 3 additions & 3 deletions api/conf/conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ const (
EnvDEV = "dev"
EnvLOCAL = "local"

confPath = "/go/manager-api/conf.json"
schemaPath = "/go/manager-api/schema.json"
confJsonPath = "/go/manager-api/conf.json"
schemaPath = "/go/manager-api/schema.json"
)

var (
Expand Down Expand Up @@ -103,7 +103,7 @@ func configurationPath() string {
} else if ENV == EnvLOCAL {
return filepath.Join(filepath.Dir(basePath), "conf.json")
} else {
return confPath
return confJsonPath
}
}

Expand Down
18 changes: 1 addition & 17 deletions api/entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,6 @@
# limitations under the License.
#

pwd=`pwd`

# config
cp ${pwd}/api/conf/conf_preview.json ${pwd}/conf.json

# export APIX_DAG_LIB_PATH="${pwd}/dag-to-lua-1.1/lib/"
# export APIX_ETCD_ENDPOINTS="127.0.0.1:2379"

export SYSLOG_HOST=127.0.0.1

if [[ "$unamestr" == 'Darwin' ]]; then
sed -i '' -e "s%#syslogAddress#%`echo $SYSLOG_HOST`%g" ${pwd}/conf.json
else
sed -i -e "s%#syslogAddress#%`echo $SYSLOG_HOST`%g" ${pwd}/conf.json
fi

cp ${pwd}/conf.json ${pwd}/api/conf/conf.json
export ENV=prod

exec ./manager-api
Loading

0 comments on commit 93d38ee

Please sign in to comment.