Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement docker-based testing in travis #81

Open
choubacha opened this issue Mar 28, 2018 · 0 comments
Open

Implement docker-based testing in travis #81

choubacha opened this issue Mar 28, 2018 · 0 comments
Assignees
Labels
hard Will likely require extra work and complexity to finish

Comments

@choubacha
Copy link
Owner

The way to by-pass the rate limits on the test net is to spin up our own test instance when building. This is relatively easily done using the stellar docker quickstart image:

https://hub.docker.com/r/stellar/quickstart/

docker run --rm -it -p "8000:8000" -p "11626:11626" --name stellar stellar/quickstart --testnet

We can run this in daemon mode following this travis guide:
https://docs.travis-ci.com/user/docker/

However, it takes time to catch up with the network so if it were to be used immediately after running the specs we'd have an issue with no data being present. To combat that we need to have a script that looks at the info end point and evaluates if it's caught up. If it's up to date it's exits, if it's not, then it sleeps a second and checks again:

$ curl localhost:11626/info
{
   "info" : {
      "UNSAFE_QUORUM" : "UNSAFE QUORUM ALLOWED",
      "build" : "v9.2.0",
      "ledger" : {
         "age" : 34244,
         "baseFee" : 100,
         "baseReserve" : 5000000,
         "closeTime" : 1522224377,
         "hash" : "f866e8db8927976e4f99e132cf2cfe941be9c76c0801e33d6b25076dd09a6dfb",
         "num" : 8144256,
         "version" : 9
      },
      "network" : "Test SDF Network ; September 2015",
      "peers" : {
         "authenticated_count" : 2,
         "pending_count" : 0
      },
      "protocol_version" : 9,
      "quorum" : {
         "8151103" : {
            "agree" : 3,
            "disagree" : 0,
            "fail_at" : 2,
            "hash" : "273af2",
            "missing" : 0,
            "phase" : "EXTERNALIZE"
         }
      },
      "startedOn" : "2018-03-28T17:32:44Z",
      "state" : "Catching up",
      "status" : [ "Catching up: Awaiting checkpoint (ETA: 4 seconds)" ]
   }
}

The easiest thing to do is to write this in rust so that it works with the current travis environment without needing to pull in something else. It might make sense to implement this in the CLI itself to pull up the info from a node. This has other benefits as well as it can allow people to introspect their own nodes via command line easily.

Once the script is done, it's just a matter of booting docker and then blocking.

@choubacha choubacha added the hard Will likely require extra work and complexity to finish label Mar 28, 2018
@choubacha choubacha added this to the v0.1.0 milestone Mar 28, 2018
@choubacha choubacha self-assigned this Mar 28, 2018
@choubacha choubacha removed this from the v0.1.0 milestone Apr 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hard Will likely require extra work and complexity to finish
Projects
None yet
Development

No branches or pull requests

1 participant