Step by step¶
Checklist¶
Setting up ETOS is a daunting task when you are doing it the first time around. But it is also easy to miss a few steps that are required for it to work.
For this reason we have created a checklist in order to keep track of what needs to be done so that no steps are forgotten.
Set up a Kubernetes cluster (ETOS runs in Kubernetes)
Set up an Execution Space (Execute test runner containers)
Set up a Log Area (Storing logs after execution)
Deploy MongoDB (Event storage DB)
Deploy Redis Sentinel (ETOS internal communications)
Deploy RabbitMQ (must be accessible outside of kubernetes as well)
Deploy Eiffel GraphQL API
- Deploy an Eiffel event storage tool. Example
Deploy ETOS helm chart: Installation
Configure ETOS Environment Provider
Create an ETOS Test Collection
- Upload the ETOS Test Collection to an area with no required authorization.
Generate an ArtC
Generate an ArtP
Verify that the ArtC and ArtP events exist in the Eiffel GraphQL API.
Set Environment variables for ETOS Client
Test ETOS deployment using ETOS Client
Installing ETOS Client on a workstation¶
This section will guide you through the process of setting up ETOS Client.
ETOS Client is the default tool for executing the test suites with. We always recommend using the client.
Setting up a Jenkins delegation job¶
This page describes how to set up delegation jobs for ETOS. A delegation job’s function is described here
Note that a delegation job can be created just the way you want to (as long as it follows the instructions from the execution space), this is just a sample of how you could implement it.
Prerequisites¶
Example setup¶
- Create a pipeline job.
- Recommended to set cleanup policy for the job.
- Add multi-line string parameter named ‘docker’.
- Configure Execution Space to send the ‘docker’ parameter to Jenkins.
- Add script to delegation
node() {
stage('ETOS') {
def jsonslurper = new groovy.json.JsonSlurper()
def json = params.docker
def dockerJSON = jsonslurper.parseText(json)
def environmentJSON = dockerJSON["environment"]
def parametersJSON = dockerJSON["parameters"]
def dockerName
if (parametersJSON.containsKey("--name")) {
dockerName = parametersJSON["--name"]
} else {
dockerName = UUID.randomUUID().toString()
parametersJSON["--name"] = dockerName
}
env.DOCKERNAME = dockerName
def environment = ""
def parameters = ""
environmentJSON.each{entry -> environment += "-e $entry.key=$entry.value "}
parametersJSON.each{entry -> parameters += "$entry.key $entry.value "}
def image = dockerJSON["image"]
def command = "docker run --rm " + environment + parameters + image + " &"
/*
Write a bash file which will trap interrupts so that the docker container
is properly removed when canceling a build.
*/
writeFile file: 'run.sh', text: (
'_terminate() {\n'
+ ' echo "Stopping container"\n'
+ " docker stop $dockerName\n"
+ '}\n'
+ 'trap _terminate SIGTERM\n'
+ "$command \n"
+ 'child=$!\n'
+ 'wait "$child"\n'
)
sh "docker pull $image || true"
sh """
bash run.sh
docker rm $dockerName || true
"""
sh "rm run.sh"
}
}
Example execution space provider¶
Checkout any number of static execution spaces. More information about execution space providers here
{
"execution_space": {
"id": "jenkins",
"list": {
"possible": {
"$expand": {
"value": {
"request": {
"url": "https://jenkins/job/DELEGATION/build",
"method": "POST",
"headers": {
"Accept": "application/json"
},
"data": {
"json": {
"$json_dumps": {
"parameter": [
{ "name": "docker", "value": {
"$json_dumps": "$execution_space_instructions"
}
}
]
}
}
}
}
},
"to": "$amount"
}
},
"available": "$this.possible"
}
}
}