github.com/GoogleContainerTools/skaffold/v2@v2.13.2/examples/grpc-e2e-tests/Readme.md (about)

     1  
     2  ### Example: E2E environment and tests with Skaffold
     3  
     4  [![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://ssh.cloud.google.com/cloudshell/editor?cloudshell_git_repo=https://github.com/GoogleContainerTools/skaffold&cloudshell_open_in_editor=README.md&cloudshell_workspace=examples/grpc-e2e-tests)
     5  
     6  In this example:
     7  
     8  * Start a GRPC service(Visitor counter)
     9  * Start a cloud spanner emulator and initialize database/tables using startup script
    10  * Test locally
    11  * Execute end to end tests
    12  
    13  In the real world, Kubernetes deployments will consist of an application and a database for persisting any state. And write an E2E test which executes against local E2E environment.
    14  
    15  #### Running the example on minikube
    16  
    17  From this directory, run
    18  
    19  ```bash
    20  skaffold run
    21  ```
    22  
    23  Hit the service using [grpcurl](https://github.com/fullstorydev/grpcurl) command
    24  
    25  ```bash
    26  
    27  # Visit request
    28  $ grpcurl -plaintext -d '{"visitor": {"name": "testuser"}}'  $(minikube service visitor-counter --url | sed 's~http[s]*://~~g')  skaffold.examples.e2e.visitor.VisitorCounter/UpdateVisitor
    29  
    30  
    31  # Get visit count for an user'
    32  grpcurl -plaintext -d '{"visitor": {"name": "testuser"}}'  $(minikube service visitor-counter --url | sed 's~http[s]*://~~g')  skaffold.examples.e2e.visitor.VisitorCounter/GetVisitCount
    33  ```
    34  
    35  Run [Ginkgo](https://onsi.github.io/ginkgo/) E2E tests using command 
    36  ```bash
    37  export VISITOR_COUNTER_SERVICE=$(minikube service visitor-counter --url) & ginkgo tests
    38  
    39  ```