E2E tests are designed for verifying the functional correctness by replicating end-user behavior from app deployment. This describes how to run e2e tests in local dev environment and run them through CI
- Set up Dapr development environment
- Create your DockerHub ID
- Create dapr-tests namespace
kubectl create namespace dapr-tests
- Set the environment variables
export DAPR_TEST_REGISTRY=docker.io/your_dockerhub_id export DAPR_TEST_TAG=dev export DAPR_NAMESPACE=dapr-tests # Do not set DAPR_TEST_ENV if you do not use minikube export DAPR_TEST_ENV=minikube # Set the below environment variables if you want to use the different registry and tag for test apps # export DAPR_TEST_REGISTRY=docker.io/your_dockerhub_id # export DARP_TEST_TAG=dev
- Install redis and kafka for state, pubsub, and binding building block
make setup-helm-init make setup-test-env-redis # This may take a few minutes. You can skip kafka install if you do not use bindings for your tests. make setup-test-env-kafka
Run the below commands to build and deploy dapr from your local disk
# Build Linux binaries
make build-linux
# Build Docker image with Linux binaries
make docker-build
# Push docker image to your dockerhub registry
make docker-push
# Deploy Dapr runtime to your cluster
make docker-deploy-k8s
make setup-test-config
make setup-test-components
Build docker images from apps and push the images to test docker hub
# build e2e apps docker image under apps/
make build-e2e-app-all
# push e2e apps docker image to docker hub
make push-e2e-app-all
Run end-to-end tests
# start e2e test
make test-e2e-all
To keep the build infrastructure simple, Dapr uses dapr-test GitHub Actions Workflow to run e2e tests using one of AKS clusters.
Once a contributor creates pull request, maintainer can start E2E tests by adding /ok-to-test
comment to Pull Request.