-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ci): add e2e test framework #72
Merged
Merged
Changes from 13 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
6359477
feat: add e2e test framework
Chever-John 81bbec6
feat: update plugins_stop_test.go
Chever-John 5adbb49
feat(e2e): fix golang-lint error
Chever-John 55b9db1
feat(e2e): update go version
Chever-John 4ecfa2a
feat(ci): fix golang lint error
Chever-John eaccc51
feat(ci): finish runner-e2e.yml
Chever-John da6de08
feat(ci): finish plugins_rewrite_test.go
Chever-John f3ec297
feat(ci): try my guess
Chever-John 16f4a06
feat(ci): small changes
Chever-John a282c6d
feat(ci): plugins_say_test.go passed all tests
Chever-John f6a0a1f
feat(ci): plugins_limit_req_test.go passed all tests
Chever-John 795f98d
feat(ci): plugins_fault_injection_test.go passed all tests
Chever-John 201f806
feat: add docker-compose
Chever-John 5aed666
feat: add a non-503 test in plugins_limit_req_test.go
Chever-John d8587c6
feat(ci): fix docker-compose error
Chever-John f37c071
feat: format code
Chever-John c404215
feat(ci): fix goimport and some unsure tests
Chever-John f45b767
feat: Optimize tests description
Chever-John ebf4a9f
feat: a little mistake
Chever-John cc96b24
feat: try to fix problem in plugins_limit_req
Chever-John d3fe333
feat: finish
Chever-John File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# | ||
# 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. | ||
# | ||
|
||
name: Runner E2E Test | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
run-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: setup go | ||
uses: actions/setup-go@v2.1.5 | ||
with: | ||
go-version: '1.17' | ||
|
||
- name: build runner | ||
run: | | ||
make build | ||
|
||
- name: startup runner | ||
run: | | ||
APISIX_LISTEN_ADDRESS=unix:/tmp/runner.sock APISIX_CONF_EXPIRE_TIME=3600 ./go-runner run & | ||
|
||
- name: startup apisix | ||
run: | | ||
docker-compose -f ci/docker-compose.yml up -d | ||
sleep 5 | ||
|
||
- name: install ginkgo cli | ||
run: go install github.com/onsi/ginkgo/ginkgo@v1.16.5 | ||
|
||
- name: run tests | ||
working-directory: ./tests/e2e | ||
run: ginkgo -r |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# | ||
# 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. | ||
# | ||
|
||
apisix: | ||
allow_admin: | ||
- 0.0.0.0/0 | ||
enable_control: true | ||
control: | ||
ip: "0.0.0.0" | ||
port: 9092 | ||
admin_key: | ||
- name: admin | ||
key: edd1c9f034335f136f87ad84b625c8f1 | ||
role: admin | ||
etcd: | ||
host: | ||
- http://etcd:2379 | ||
prefix: "/apisix" | ||
timeout: 30 | ||
ext-plugin: | ||
path_for_test: /tmp/runner.sock | ||
nginx_config: | ||
user: root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# | ||
# 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: "3" | ||
|
||
services: | ||
apisix: | ||
image: apache/apisix:dev | ||
restart: always | ||
volumes: | ||
- ./apisix/config.yaml:/usr/local/apisix/conf/config.yaml:ro | ||
- /tmp/runner.sock:/tmp/runner.sock | ||
depends_on: | ||
- etcd | ||
ports: | ||
- "9080:9080/tcp" | ||
- "9091:9091/tcp" | ||
- "9443:9443/tcp" | ||
- "9092:9092/tcp" | ||
networks: | ||
apisix: | ||
|
||
etcd: | ||
image: bitnami/etcd:3.4.9 | ||
restart: always | ||
environment: | ||
ETCD_ENABLE_V2: "true" | ||
ALLOW_NONE_AUTHENTICATION: "yes" | ||
ETCD_ADVERTISE_CLIENT_URLS: "http://0.0.0.0:2379" | ||
ETCD_LISTEN_CLIENT_URLS: "http://0.0.0.0:2379" | ||
ports: | ||
- "2379:2379/tcp" | ||
networks: | ||
apisix: | ||
|
||
web: | ||
image: mendhak/http-https-echo | ||
environment: | ||
HTTP_PORT: 8888 | ||
HTTPS_PORT: 9999 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The HTTPS port is unused. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Clear! |
||
restart: unless-stopped | ||
ports: | ||
- "8888:8888" | ||
- "9999:9999" | ||
networks: | ||
apisix: | ||
|
||
networks: | ||
apisix: | ||
driver: bridge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
module github.com/apache/apisix-go-plugin-runner/tests/e2e | ||
|
||
go 1.17 | ||
|
||
require ( | ||
github.com/gavv/httpexpect/v2 v2.3.1 | ||
github.com/onsi/ginkgo v1.16.5 | ||
github.com/onsi/gomega v1.18.1 | ||
) | ||
|
||
require ( | ||
github.com/ajg/form v1.5.1 // indirect | ||
github.com/andybalholm/brotli v1.0.2 // indirect | ||
github.com/davecgh/go-spew v1.1.1 // indirect | ||
github.com/fatih/structs v1.0.0 // indirect | ||
github.com/fsnotify/fsnotify v1.4.9 // indirect | ||
github.com/google/go-querystring v1.0.0 // indirect | ||
github.com/gorilla/websocket v1.4.2 // indirect | ||
github.com/imkira/go-interpol v1.0.0 // indirect | ||
github.com/klauspost/compress v1.12.2 // indirect | ||
github.com/nxadm/tail v1.4.8 // indirect | ||
github.com/pmezard/go-difflib v1.0.0 // indirect | ||
github.com/sergi/go-diff v1.0.0 // indirect | ||
github.com/stretchr/testify v1.5.1 // indirect | ||
github.com/valyala/bytebufferpool v1.0.0 // indirect | ||
github.com/valyala/fasthttp v1.27.0 // indirect | ||
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect | ||
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect | ||
github.com/xeipuuv/gojsonschema v1.1.0 // indirect | ||
github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0 // indirect | ||
github.com/yudai/gojsondiff v1.0.0 // indirect | ||
github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 // indirect | ||
golang.org/x/net v0.0.0-20210510120150-4163338589ed // indirect | ||
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect | ||
golang.org/x/text v0.3.6 // indirect | ||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect | ||
gopkg.in/yaml.v2 v2.4.0 // indirect | ||
moul.io/http2curl v1.0.1-0.20190925090545-5cd742060b0e // indirect | ||
) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to let APISIX manage the go-runner, just like in the product environment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will solve it by creating a new PR.