Skip to main content
A repository’s tests often need more than the code: a database running beside them, a value CI sets, a token to install private packages. A run sets the repository up the way its CI does. What CI is handed and a run is not, you give the project once, by name.

Services

When the repository declares a service in its CI workflow, its devcontainer or its compose file, the run starts it before the tests run. You do not have to write anything. Reaching a service at localhost needs python3 in the run’s image. Without it the name still works, and the run says so. A service that does not start, or is not ready in time, does not end the run, because the task may not need it. The timeline says what happened, so a test that fails for want of the service can be read as that. The run’s page lists the services it started, with their images. A service’s environment variables are listed by name only.
The Environment card on a run's page, listing the two services the run started from the CI workflow and the settings it was given

Say it yourself: sensei.yaml

A file named sensei.yaml at the root of the repository says how to set it up. Every key is optional.
A service’s name is the host name the tests reach it by: letters, digits, - and _, starting with a letter. ready is a command run inside the service that exits 0 once it can be used. A key the file does not know, or a part that cannot be read, is left out. The run goes on with the rest and says which part it did not use. A definition can carry the same services, setup, env and secrets for one agent. See the definition reference.

Which one is used

The run’s timeline names the source of each choice. services: {} in a definition or in sensei.yaml says the tests need no service, whatever the repository’s other files declare.

Settings and secrets

A project gives its runs two kinds of value.
Open Runs, click Connections and go to Settings and secrets. Add a name and a value, and turn Secret, setup only on for a token.The same section lists the names recent runs needed and did not get, each with an Add button.
A name is letters, digits and _, up to 64 characters, and does not start with a digit. PATH, HOME, PWD, SHELL, USER, HOSTNAME, LD_PRELOAD and LD_LIBRARY_PATH are set by the run and cannot be given. A value is up to 16,000 characters. An account can keep 200 settings and secrets. A value saved on the dashboard is for the whole account. One saved with a key is for that key’s project, and a project’s value is used in place of the account’s. A setting is used in place of a value the repository’s CI or devcontainer writes out. A value written in sensei.yaml or in a definition is used in place of the setting.

How a secret is used

A secret reaches a run only when the run names it:
The setup commands run in a computer of their own, with the secret in their environment. That computer is saved as an image and switched off, and the work starts in a new computer made from the image. No process from the setup is still running there, and no command of the work is given the secret. The secret’s value is replaced in everything the run prints, before the model reads it and before it reaches the timeline. Two things follow from that. What setup installs and what it writes in the repository’s folder are in the image. A file it writes under /tmp is not: the work starts with an empty /tmp. A value the tests themselves read is a setting. A secret by the same name does not reach them.

When a run is missing a value

A CI workflow hands its tests values from the repository’s own settings, such as ${{ secrets.REPORTS_BUCKET }}. A run reads the workflow, so it knows which names the tests are handed. In the API such a run has error: "missing_setting" and the names in result.missing.