-
Notifications
You must be signed in to change notification settings - Fork 542
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
proposal: e2e test #607
Comments
it will be best if add checkbox for each test case |
OK |
Just added this issue to 2.1, feel free to adjust it. |
Is there a small PR as a sample? For example, test the And we can run it in CI, confirm the manager works fine. BTW, running e2e use cases, can we get the latest code coverage results? |
# run APISIX and ETCD
$ cd api/test/docker && docker-compose up -d
# run test
$ export APIX_ETCD_ENDPOINTS=127.0.0.1:2379,127.0.0.1:3379,127.0.0.1:4379
$ cd ../e2e && go test
|
please add tag for those small issues. |
put it to next milestone to continue this job. |
Background
Manager api no longer interacts with admin api, but writes data directly to etcd.
At present, we do not have the e2e test cases that cover from dashboard, manager api to Apache APISIX.
Plan
e2e test is divided into two parts, front-end e2e and back-end e2e
Because the front-end only uses part of the interface of
manager api
, the front-end e2e only needs to ensure normal interaction withmanager api
Back-end e2e, APISIX is started through docker, Go calls manager api to configure routing and other resources, then access APISIX for verification.
Details
Development language: Go
Test library: https://github.com/gavv/httpexpect
Test environment: Start with docker-compose, a 3-node ETCD cluster, and 2-node APISIX cluster (2 nodes need to be verified at the same time).
Since APISIX already has complete test cases, we plan to migrate the test cases under the APISIX t directory.
Because of the huge workload, I will first migrate the test cases under t/node/ and t/router/, and leave other use cases to others who have time, or migrate later when I have time to complete the coverage.
Test cases
host:
Configure the correct host and hosts through the
manager api
, including wildcard domain name, and verify the correctness of the route by accessing APISIX.Confirm that the
manager api
cannot configure host and hosts at the same timeMake sure that the
manager api
cannot be configured with wrong hosts and hosts, including illegal strings, too high length, wrong data types, etc.invalid conf
Confirm that the
manager api
verifies the correctness of each field. include:String: length check, regular expression check
IP: v4 v6 format verification
int, float, bool and other types check
config route with not exist service_id or upstream_id
remote_addr, remote_addrs: v4 v6 format verification
uri, uris
invalid value check
empty value check
vars: args, cookie, header, different operators
check combinations of different types of vars and operators
methods
Wrong data type (not string array)
Not in enumerated values
priority
Customize different priority checks
Custom and default priority verification
plugins
Extract at least one plug-in from auth, limit, log, trace, metrics and other types respectively for verification
plugin orchestration check (normal and invalid check)
other fields: name, desc, create_time, update_time, labels, filter_func(can't verify in Go, TODO)
not exist field
Confirm that the
manager api
can refuse to configure undefined fieldsVerify routing correctness under multi routes
router engine: check radixtree_uri first, radixtree_host_uri TODO
4.consumer
The test cases only describe the route part in detail, and the other parts will be detailed in the issue later.
The text was updated successfully, but these errors were encountered: