apache / apache/apisix-ingress-controller
Add e2e test cases for plugins
- Dominant language
- Go
- Stars
- 1.1k
- Forks
- 390
- Avg merge
- 3d 7h
- Merged PRs (30d)
- 12
Description
### Issue description
We don't cover plugins in e2e test suites, although we support them already. Here I want to initiate a plan to add test cases for most of all plugins in Apache APISIX.
- [ ] [batch-requests](http://apisix.apache.org/docs/apisix/plugins/batch-requests)
- [x] [serverless](http://apisix.apache.org/docs/apisix/plugins/serverless)
- [x] [redirect](http://apisix.apache.org/docs/apisix/plugins/redirect)
- [x] [echo](http://apisix.apache.org/docs/apisix/plugins/echo)
- [x] [server-info](http://apisix.apache.org/docs/apisix/plugins/server-info)
- [x] [response-rewrite](http://apisix.apache.org/docs/apisix/plugins/response-rewrite)
- [x] [proxy-rewrite](http://apisix.apache.org/docs/apisix/plugins/proxy-rewrite)
- [ ] [grpc-transcode](http://apisix.apache.org/docs/apisix/plugins/grpc-transcode)
- [x] [fault-injection](http://apisix.apache.org/docs/apisix/plugins/fault-injection)
- [x] [key-auth](http://apisix.apache.org/docs/apisix/plugins/key-auth)
- [ ] [jwt-auth](http://apisix.apache.org/docs/apisix/plugins/jwt-auth)
- [x] [basic-auth](http://apisix.apache.org/docs/apisix/plugins/basic-auth)
- [ ] [authz-keycloak](http://apisix.apache.org/docs/apisix/plugins/authz-keycloak)
- [x] [wolf-rbac](http://apisix.apache.org/docs/apisix/plugins/wolf-rbac)
- [ ] [openid-connect](http://apisix.apache.org/docs/apisix/plugins/openid-connect/)
- [x] [hmac-auth](http://apisix.apache.org/docs/apisix/plugins/hmac-auth)
- [x] [cors](http://apisix.apache.org/docs/apisix/plugins/cors)
- [x] [uri-blocker](http://apisix.apache.org/docs/apisix/plugins/uri-blocker)
- [x] [ip-restriction](http://apisix.apache.org/docs/apisix/plugins/ip-restriction)
- [x] [referer-restriction](http://apisix.apache.org/docs/apisix/plugins/referer-restriction)
- [x] [consumer-restriction](http://apisix.apache.org/docs/apisix/plugins/consumer-restriction)
- [ ] [limit-req](http://apisix.apache.org/docs/apisix/plugins/limit-req)
- [ ] [limit-conn](http://apisix.apache.org/docs/apisix/plugins/limit-conn)
- [x] [limit-count](http://apisix.apache.org/docs/apisix/plugins/limit-count)
- [ ] [proxy-cache](http://apisix.apache.org/docs/apisix/plugins/proxy-cache)
- [x] [request-validation](http://apisix.apache.org/docs/apisix/plugins/request-validation)
- [ ] [proxy-mirror](http://apisix.apache.org/docs/apisix/plugins/proxy-mirror)
- [x] [api-breaker](http://apisix.apache.org/docs/apisix/plugins/api-breaker)
- [x] [traffic-split](http://apisix.apache.org/docs/apisix/plugins/traffic-split), supported by ApisixRoute in first-class.
- [x] [request-id](http://apisix.apache.org/docs/apisix/plugins/request-id)
- [x] [prometheus](http://apisix.apache.org/docs/apisix/plugins/prometheus)
- [ ] [zipkin](http://apisix.apache.org/docs/apisix/plugins/zipkin)
- [ ] [skywalking](http://apisix.apache.org/docs/apisix/plugins/skywalking)
- [ ] [node-status](http://apisix.apache.org/docs/apisix/plugins/node-status)
- [ ] [http-logger](http://apisix.apache.org/docs/apisix/plugins/http-logger)
- [ ] [tcp-logger](http://apisix.apache.org/docs/apisix/plugins/tcp-logger)
- [ ] [kafka-logger](http://apisix.apache.org/docs/apisix/plugins/kafka-logger)
- [ ] [udp-logger](http://apisix.apache.org/docs/apisix/plugins/udp-logger)
- [ ] [syslog](http://apisix.apache.org/docs/apisix/plugins/syslog)
- [ ] [log-rotate](http://apisix.apache.org/docs/apisix/plugins/log-rotate)
- [ ] [error-log-logger](http://apisix.apache.org/docs/apisix/plugins/error-log-logger)
- [ ] [sls-logger](http://apisix.apache.org/docs/apisix/plugins/sls-logger)
- [ ] [dubbo-proxy](http://apisix.apache.org/docs/apisix/plugins/dubbo-proxy)
- [ ] [mqtt-proxy](http://apisix.apache.org/docs/apisix/plugins/mqtt-proxy)
- [ ] [ua-restriction](https://apisix.apache.org/docs/apisix/plugins/ua-restriction)
If you're interested in writing some test cases for several plugins, please writing comments like:
```
I'd like to write e2e test cases for plugin "fault-injection".
```
Then, I'll create a dedicated issue and assign it to you. After the PR is merged, the checkbox in this description will be clicked.
Test case samples are here:
* https://github.com/apache/apisix-ingress-controller/blob/2486c0f5cce43c3554d61b88f2aa97db35e6c70c/test/e2e/plugins/fault_injection.go
* https://github.com/apache/apisix-ingress-controller/blob/2486c0f5cce43c3554d61b88f2aa97db35e6c70c/test/e2e/plugins/redirect.go
You may have to learn some usages about [ginkgo](https://github.com/onsi/ginkgo).
A test case should be a complete e2e case, it contains the configuration create/update/delete on "control plane" (in our case is applying k8s resources like ApisixRoute, ApisixUpstream to Kubernetes), then waiting for it to be effective, and sending requests to "data plane" (APISIX), asserting the response is valid.
When you want to run these cases on your local environment, be sure a Kubernetes cluster is installed, you can create a kubernetes cluster with [minikube](https://minikube.sigs.k8s.io/docs/start/) or [kind](https://kind.sigs.k8s.io/).
You may try to push images in advance or your cases might be timed out when first run. Related images are:
* apache/apisix-ingress-controller:dev
* apache/apisix:dev
* bitnami/etcd:3.4.14-debian-10-r0
* kennethreitz/httpbin
You can change the `Describe` or `It` block in your case to `FDescribe` or `FIt` so only these cases will be run when you executing `make e2e-test` directive. By default `make e2e-test` will build apisix-ingress-controller from scratch, you can add `E2E_SKIP_BUILD=1` to skip this step, and using `E2E_CONCURRENCY` to control the concurrency of cases.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.