Skip to content

Launch your automated tests on Game Conductor

Once your build is uploaded on the Game Conductor platform, running the associated tests is fairly easy.

Run all the tests associated wih a build

In the previous chapter you uploaded your build to the Game Conductor platform and got a build_id. You can now use it to launch a new run:

curl -u <username>:<access-token> \
--request POST https://api.gameconductor.net/v1/runs/new?build_id=<build_id> \
--header "Content-Type: application/json" \
--data '{
    "name": "My Test Run"
}'

The response looks like this:

{
  "run_id": "0177687e-52cb-8a63-78f1-76144718c8c1",
  "name": "My Test Run",
  "queued_date": "2021-02-03T15:24:05.196489Z",
  "start_date": null,
  "end_date": null,
  "status": "queued",
  "test_names": [],
  "tests_results": {},
  "links": {
    "self": "https://api.gameconductor.net/v1/runs/0177687e-52cb-8a63-78f1-76144718c8c1",
    "build": "https://api.gameconductor.net/v1/builds/01776768-2392-36df-67b4-d7b082c09399"
  }
}

As you can see, the start_date is null because the run is queued before it is processed asynchronously.

If you need to check the status of a run you can request it via the API:

curl -u <username>:<access-token> --request GET  https://api.gameconductor.net/v1/runs/<run_id>

If the run is still queued or running, the response will be similar to the one above. Once the run is completed the status will be changed to passed, failed or error, and the tests_results will be populated.

Here is an example:

{
  "run_id": "0177687e-52cb-8a63-78f1-76144718c8c1",
  "name": "My Run",
  "queued_date": "2021-02-03T15:24:05.196489Z",
  "start_date": "2021-02-03T15:24:05.196489Z",
  "end_date": "2021-02-03T15:29:05.196489Z",
  "status": "passed",
  "test_names": [],
  "tests_results": {
    "n_passed": 5,
    "n_failed": 0,
    "n_total": 5,
    "results": {
      "Tests.NewTestScript.NewTestScriptSimplePasses": {
        "status": "passed",
        "duration": 0.0062009,
        "message": "",
        "stacktrace": ""
      },
      "Tests.NewTestScript.NewTestScriptWithEnumeratorPasses": {
        "status": "passed",
        "duration": 0.0330191,
        "message": "",
        "stacktrace": ""
      },
      "Tests.TestSuite.SlashDamagesSkeleton": {
        "status": "passed",
        "duration": 1.7287376,
        "message": "",
        "stacktrace": ""
      },
      "Tests.TestSuite.TelekinesisChargeAndAbort": {
        "status": "passed",
        "duration": 0.9721921,
        "message": "",
        "stacktrace": ""
      },
      "Tests.TestSuite.TelekinesisChargeAndRelease": {
        "status": "passed",
        "duration": 1.8776448,
        "message": "",
        "stacktrace": ""
      }
    }
  },
  "links": {
    "self": "https://api.gameconductor.net/v1/runs/0177687e-52cb-8a63-78f1-76144718c8c1",
    "build": "https://api.gameconductor.net/v1/builds/01774da2-a5e1-7cd2-4c63-fe610937db47"
  }
}

You can also view a corresponding test report by opening a browser to https://gameconductor.net/runs/<run_id>

Congratulation

Well done! You successfuly ran your first tests on Game Conductor.

Run only a subset of the tests

If you want to run only a subset of your test suite, you can provide an explicit list of the test you want to run:

curl -u <username>:<access-token> \
--request POST https://api.gameconductor.net/v1/runs/new?build_id=<build_id> \
--header "Content-Type: application/json" \
--data '{
    "name": "My Run",
    "test_names": [
        "Tests.TestSuite.MyFirstTest",
        "Tests.TestSuite.MySecondTest"
    ]
}'

The name of the tests need to follow this convention: <TestAssembly>.<TestClass>.<TestMethod>.

Next steps

At this point you've completed the tutorial. You might want to check the following pages: