Accounts from the CI job
When the job’s own script creates the test users — a seeded database, an admin and a member made for this run — their accounts need not be typed into the plan. The job writes them to a file, --accounts points the run at it, and the runner reads the file and types the passwords itself. Only the names of the people go to Trawler; the passwords stay in the job.
It works only with an own runner: a hosted runner is not in the job and cannot read its files. --accounts with --runner hosted is refused by the command, and accounts with "hosted" by the Run API.
The file
Section titled “The file”A JSON object whose keys are the names of people of the plan, and whose values hold the account:
{ "Daniel": { "username": "daniel@ci.test", "password": "a-long-random-password" }, "Priya": { "username": "priya@ci.test", "password": "another-long-random-password" }}node apps/ci/src/main.ts run --project "$TRAWLER_PROJECT" --url http://localhost:3000 --runner own --accounts accounts.json| Limit | |
|---|---|
| People | 1 to 20 |
| A name | 1 to 100 characters, and exactly the person’s name on the plan — capitals and spaces included |
username |
1 to 320 characters |
password |
1 to 1,000 characters |
| The file | 64,000 bytes |
A file that breaks these is refused before any run starts, with exit code 2 and –accounts accounts.json cannot be used: followed by the reason: the accounts file is not valid JSON, the accounts file is larger than 64000 bytes, or the accounts file must map each person’s name to {“username”, “password”}: and what is wrong. A path that cannot be read is refused the same way.
Whom it applies to
Section titled “Whom it applies to”The run takes the people the file names, and uses the account for each one that has no account stored in the plan. That includes a person who has no account because the plan has them sign up: with an account from the job they sign in instead.
| A person of the plan | If the file names them | If it does not |
|---|---|---|
| Signs in with an account stored in the plan | The file is ignored for them: they keep the plan’s account | They keep the plan’s account |
| Has to sign in, with no account stored | They sign in with the account from the file | The run is refused: Maya needs a test account to sign in. |
| Signs up as a new user | They sign in with the account from the file, and do not sign up, unless the lead decides otherwise: see below | They sign up, as ever |
A name that is not a person of the plan is ignored. The replay of a defect that person reported signs in with the same account.
When the pull request is about accounts
Section titled “When the pull request is about accounts”For a run planned for a pull request, the lead decides how people get their accounts. For almost every pull request everyone who has an account uses it, as the table above says. When the pull request’s title, description or changed files clearly show that it changes how people sign up, sign in, are invited, reset passwords, or get roles or permissions, the lead names the people who go through the real flow instead: they sign up, and do not take the account from the file, even when the file names them. Only a person who would sign up on the plan can be named. Everyone else keeps using their account. See How people get their accounts.
What happens to the passwords
Section titled “What happens to the passwords”- Where they go.
trawler-cireads the file to check it and sends Trawler the names, nothing else. It starts the runner withTRAWLER_ACCOUNTS_FILEset to the file’s path. The runner reads the file and, for each job of a person named in it, adds the account to the job in memory. - Typed, not read. As with any test account, the model never sees the password: the runner types it into the password field the person points at.
- Masked. The runner replaces the passwords with
•••in everything it reports to Trawler, like the passwords of stored accounts. A password shorter than 8 characters is masked only in the field it is typed into; see Test accounts. - Not checked first. A run checks the sign-in of the plan’s stored accounts before the people start, see Before anyone starts. Accounts from the job are not checked that way: a person who cannot sign in finds out when they try.
What the run page says
Section titled “What the run page says”On the run page’s Details tab, under Accounts, naming the people the run took accounts from: Daniel, Priya sign in with accounts provided by the CI job. — Daniel signs in with an account provided by the CI job. for one. A person of the plan who keeps their stored account is not named. A person who goes through the real sign-up is named under Sign-up: This pull request touches how people get accounts, so Daniel goes through the real sign-up instead of using the CI account.
When something is wrong
Section titled “When something is wrong”- The runner has no account for a name. If the run was started with a person named, but the runner reads a file that lacks their name — a different file, or a different spelling — that person’s session ends as Could not finish, and a replay of their defect fails, with Priya signs in with an account from the CI job, but this runner has none for Priya; add it to the file given to trawler-ci –accounts, under that exact name.
- The person cannot sign in. The account does not exist in the product, or its password is wrong. The person reports it as the sign-in fails, and a defect that depends on it is inconclusive when its replay is refused too.