Skip to content

System Testing

Isaac Beckman edited this page Jul 3, 2019 · 9 revisions

System Testing

We execute system testing on top of Kubernetes cluster

Setup a Kubernetes cluster

  1. locally using Minikube
  2. on GCE with a single click in the web UI
  3. on AWS using Kubernetes Operations

Please refer to The official documentation for overview and comparison of different options.

Running tests on Google Cloud Engine (GCE)

Connect to GCE

Now you should be able to run kubectl command to interact with the cluster.

Running the tests

There are 2 options:

  1. Setup test execution framework on your desktop

    • Install Python 3.7
    • Install pip3
    • Install required python libraries ([Requirements](https://github.com/spacemeshos/go-spacemesh/wiki/Python- required-libraries))

      Run the tests

      We use pytest framework to run the tests
      1. Tests are are located in ....
      2. export ElasticSearch password as environment variable.
        • Run export ES_PASSWD=<YOUR_PASSWORD>
      3. Set environment variable: GOOGLE_APPLICATION_CREDENTIALS. This environment variable should hold a path to a json file that holds the service account credentials to access google cloud. export GOOGLE_APPLICATION_CREDENTIALS="[PATH]"
      4. Run pytest -s -v --tc-file=config.yaml --tc-format=yaml test_bs.py
  2. Run tests on Docker container

    • Expose Environment variables
    export GCLOUD_KEY=`cat <GCLOUD_KEY_JSON_PATH> | base64`
    export PROJECT_NAME=<PROJECT_NAME>
    export CLUSTER_NAME=<CLUSTER_NAME>
    export CLUSTER_ZONE=<CLUSTER_ZONE>
    export ES_PASSWD=<ELASTIC_SEARCH_PASSWORD>
    
    • Activate service account. Run: gcloud auth activate-service-account $GCLOUD_EMAIL --key-file <PATH_TO_KEY_FILE>

    • Tests:

      • p2p tests: Run make dockertest-p2p
      • mining tests: Run make dockertest-mining
      • hare tests: Run make dockertests-hare
      • sync tests: Run make dockertests-sync

      Run all tests sequencly make dockerrun-all