No description or website provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
container Install dep Aug 8, 2018
.gitignore Init Mar 2, 2017
.travis.yml Test pending response, rearchitecture tests Jun 13, 2018
README.md Bridge monorepo (#2) Jul 2, 2018
container1.env Bridge monorepo (#2) Jul 2, 2018
container2.env Bridge monorepo (#2) Jul 2, 2018
diagram.png README Mar 2, 2017
docker-compose.yml Bridge monorepo (#2) Jul 2, 2018
monitor.js Test pending response, rearchitecture tests Jun 13, 2018
ngrok.tpl.yml Init Mar 2, 2017
package.json Init Mar 2, 2017
script.sh Make commands less verbose Mar 2, 2017

README.md

Build Status

Stellar Integration Tests

This repository contains script responsible for performing integration tests of different components of the Stellar network.

Architecture

This section describes the architecture of integration tests.

Architecture Diagram

Diagram

Components

Monitor

Monitor (monitor.js) is the main app run by travis. It's responsible for:

  • Starting tests when both FI server are online.
  • Checking the current status of tests and returning the correct exit code if tests succeed/fail/timeout.

ngrok

ngrok allows creating http/https tunnels to Docker containers. This allows us to expose stellar.toml, federation server and auth server to the internet so other FI can access them.

FI Container

FI Container is built from docker image that can be found in container directory. It consists of:

  • Bridge server,
  • Compliance server,
  • Custom FI server (index.js). It provides:
    • Callbacks for bridge and compliance servers.
    • Callbacks for monitor to start tests and check tests status.
    • Proxy to compliance auth server (to allow creating a single tunnel to docker container).
    • Tests code.

Services are listening on the following ports within a docker container:

Service Port Exposed to docker host?
bridge 8000 No
compliance external 8001 No
compliance internal 8002 No
FI server with proxy to compliance auth server 8003 Yes

DB Container

Docker container with a DB server that provides storage for bridge and compliance servers.

Configuration

Docker cluster is defined in docker-compose.yml and can be started using docker-compose command.

docker-compose is using environment variables defined in container1.env, container2.env and secret variables set in Travis. The list of environment variables can be found below:

Description Scope Name Value
Ngrok Auth Token Global NGROK_AUTH_TOKEN secret
F1 Domain Global FI1_DOMAIN random
F2 Domain Global FI2_DOMAIN random
F1 Bridge version Global FI1_BRIDGE_VERSION Defined in .travis.yml: master - master branch, other values define release version
F2 Bridge version Global FI2_BRIDGE_VERSION Defined in .travis.yml: master - master branch, other values define release version
FI1 Receiving account container1.env RECEIVING_ACCOUNT GAAJKG3WQKHWZJ5RGVVZMVV6X3XYU7QUH2YVATQ2KBVR2ZJYLG35Z65A
FI1 Receiving secret Global FI1_RECEIVING_SEED secret
FI1 Signing account container1.env SIGNING_ACCOUNT GBAPTLS2A72RGEQIK6GQ4F74AIYFS2N7WIQ7LZOYKOJT4KD6MUQEHOEU
FI1 Signing secret Global FI1_SIGNING_SEED secret
FI2 Receiving account container2.env RECEIVING_ACCOUNT GCNP7JE6KR5CKHMVVFTZJUSP7ALAXWP62SK6IMIY4IF3JCHEZKBJKDZF
FI2 Receiving secret Global FI2_RECEIVING_SEED secret
FI2 Signing account container2.env SIGNING_ACCOUNT GD4SMSFNFASBHPMCOJAOVYH47OXQM5BGSHFLKHO5BGRGUK6ZOAVDG54B
FI2 Signing secret Global FI2_SIGNING_SEED secret
Issuing account container*.env ISSUING_ACCOUNT GDNFUWF2EO4OWXYLI4TDEH4DXUCN6PB24R6XQW4VATORK6WGMHGRXJVB

Tests flow

See script.sh.

  1. Build container docker image using files in container directory.
  2. Generate random ngrok subdomains for FIs and start ngrok.
  3. Start a cluster by docker-compose up.
  4. Start monitor app.
  5. Wait for both FIs to go online.
  6. When both FIs are working start tests.
  7. Monitor current status of tests.
  8. Print results and exit with correct (error) code.

TODO

  • More test scenarios.
  • Use docker-stellar-core-horizon instead of SDF's instances.