mirror of
https://github.com/cmur2/kube-stale-resources.git
synced 2025-06-29 00:30:25 +02:00
ci: add e2e tests using kind + k8s
This commit is contained in:
20
Makefile
20
Makefile
@ -18,6 +18,26 @@ lint: ## Lint all source code
|
||||
poetry run pylint *.py
|
||||
poetry run mypy *.py
|
||||
|
||||
.PHONY: e2e-with-kind
|
||||
e2e-with-kind: ## Run E2E tests against running kind (K8s in Docker) instance
|
||||
function cleanup {
|
||||
(kubectl delete namespace e2e || true)
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
# no resources and empty cluster should have no stale resources
|
||||
poetry run python kube-stale-resources.py --blacklist e2e/blacklist-kind-empty.txt -f e2e/resources-kind-empty.yml
|
||||
|
||||
# some resources in VCS and empty cluster should have no stale resources
|
||||
kubectl apply -f e2e/resources-kind-one.yml
|
||||
poetry run python kube-stale-resources.py --blacklist e2e/blacklist-kind-empty.txt -f e2e/resources-kind-one.yml
|
||||
cleanup
|
||||
|
||||
# some resources NOT in VCS and empty cluster should have stale resources
|
||||
kubectl apply -f e2e/resources-kind-one.yml
|
||||
(poetry run python kube-stale-resources.py --blacklist e2e/blacklist-kind-empty.txt -f e2e/resources-kind-empty.yml && exit 1 || exit 0)
|
||||
cleanup
|
||||
|
||||
.PHONY: help
|
||||
help: ## Print this help text
|
||||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}'
|
||||
|
Reference in New Issue
Block a user