coderetreat

Automatically run your tests, and connect to the Code Retreat Game of Life server to be part of the bigger picture

code-retreat-js

Javascript runner for code retreat

The first step is to run the script bin/addToPath.sh. This will add the JavaScript, Ruby and Python wrappers to your PATH for your current session.

  • Run coderetreat NAMEOFMYFILE
  • Edit file in your editor, add some tests
  • Save!
  • Look at the terminal output for test results
  • Rinse and repeat

This project welcomes pull requests! We also love issues and generally knowing that this project is (or at least could be) useful! Reach out to us in comments, issues or on Twitter.

You can use netcat to simulate the server and send messages:

netcat -lp 8787

The coderetreat wrapper communicates with a central stats-collecting server using simple stream connections and JSON payloads.

Whenever a test is run the stats are posted to the server in the following format:

{
  "action": "consumeTestsResults",
  "payload": {
    "testsRun": 10,
    "testsFailed": 5,
    "testsIgnored": 2
  }
}

This is the only unsolicited transmission from client.

The server requests an iteration:

{
  "action": "processIteration",
  "payload": {
    "generation0": "000011101010101110111101101"
  }
}

The client responds with the next iteration:

{
  "respondingTo": "processIteration",
  "payload": {
    "generation0": "000100100111101011101011010101",
    "generation1": "000100100111101011101011010101",
  }
}

or an error:

{
  "respondingTo": "processIteration",
  "payload": {
    "error": "The function could not be executed."
  }
}

To build a running commentary of who has worked on which session/table, the server requests the team information:

{
  "action": "getClientInfo",
}

In turn the client responds with information about the team members:

{
  "respondingTo": "getClientInfo",
  "payload": {
    "team": [
      {"name": "Ryan Brooks"},
      {"name": "Ben Foxall"}
    ],
    "session": 0,
    "language": "javascript",
  }
}