nic-chen opened a new issue #607:
URL: https://github.com/apache/apisix-dashboard/issues/607


   Hi, Community,
   here is a proposal about e2e test :
   
   
   # 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
   
   1. e2e test is divided into two parts, front-end e2e and back-end e2e
   
   2. Because the front-end only uses part of the interface of `manager api`, 
the front-end e2e only needs to ensure normal interaction with `manager api`
   
   3. 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/h2non/gock
   
   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
   
   1. route
    (1) 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 time
       Make sure that the `manager api` cannot be configured with wrong hosts 
and hosts, including illegal strings, too high length, wrong data types, etc.
   
    (2) 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
    
    (3) config route with not exist service_id or upstream_id
   
    (4) remote_addr, remote_addrs: v4 v6 format verification
    
    (5) uri, uris
       invalid value check
       empty value check
   
    (6) vars: args, cookie, header, different operators
       check combinations of different types of vars and operators
   
    (7) methods
       Wrong data type (not string array)
       Not in enumerated values
   
    (8) priority
       Customize different priority checks
       Custom and default priority verification
   
    (9) plugins
       Extract at least one plug-in from auth, limit, log, trace, metrics and 
other types respectively for verification
   
   
    (10) plugin orchestration check (normal and invalid check)
   
    (11) other fields: name, desc, create_time, update_time, labels, 
filter_func(can't verify in Go, TODO)
    
    (12) not exist field
    Confirm that the `manager api` can refuse to configure undefined fields
    
    (13) Verify routing correctness under multi routes
    
    (14) router engine: check radixtree_uri first, radixtree_host_uri TODO
   
   
   2. upstream
    (1) key: remote_addr, query_string, arg_xxx
    (2) hash_on: consumer, header, cookie, vars
    (3) node: ipv6, domain, array nodes (struct)
    (4) ewma: latency, frequency
    (5) roundrobin:, weight
    (6) timeout
    (7) retries
    (8) websocket
    (9) health check: active, passive, healthy, unhealthy
    (10) invalid conf
   
   3. ssl
    (1) cert + key + sni
    (2) cert + key + snis
    (3) certs + keys + snis
    (4) wildcard domain name
   
   4.consumer
    (1) missing auth plugin
    (2) two or more auth plugins
    (3) with plugins
   
   5. service
    (1) invalid route
    (2) route with empty service
   
   6. global rules
    (1) add 
    (2) update 
    (3) delete
    (4) cover by route plugins
   
   7. plugins merge
    (1) route + service
    (2) route + consumer
    (3) route + service + consumer
   
   ___
   
   
   The test cases only describe the route part in detail, and the other parts 
will be detailed in the issue later.
   
   
   What do you think? Any suggestion is welcome.


----------------------------------------------------------------
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:
[email protected]


Reply via email to