Skip to content

Latest commit

 

History

History
96 lines (68 loc) · 2.91 KB

running-e2e-test.md

File metadata and controls

96 lines (68 loc) · 2.91 KB

Running End-To-End Tests

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

Run E2E tests in local dev environment

Prerequisites

  • 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

Deploy your dapr runtime change

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

Optional: Apply this configuration to disable mTLS

make setup-test-config

Register the default component configurations for testing

make setup-test-components

Build and push test apps to docker hub

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 test

Run end-to-end tests

# start e2e test
make test-e2e-all

Run E2E tests through GitHub Actions

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.