@beryl-so/cli 0.45.0 → 0.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/commands/projects.js +47 -0
- package/dist/commands/tests.js +4 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -175,6 +175,7 @@ Create and manage projects: a site Beryl explores, authors tests for, and runs.
|
|
|
175
175
|
| `beryl projects get` | Show one project, including its current exploration state | `projects_get` |
|
|
176
176
|
| `beryl projects create [url]` | Create a project. With a URL the agent starts exploring; with just --name an empty one | `projects_create` |
|
|
177
177
|
| `beryl projects rename <name>` | Rename a project | `projects_rename` |
|
|
178
|
+
| `beryl projects quarantine [state]` | Turn auto quarantine on or off and tune when it mutes and releases a test | `projects_quarantine` |
|
|
178
179
|
| `beryl projects delete` | Delete a project and all its tests and runs | `projects_delete` |
|
|
179
180
|
| `beryl projects re-explore` | Send the agent back in to run/heal existing tests and discover new flows | none |
|
|
180
181
|
| `beryl projects report` | Aggregate quality report across recent runs (pass rates, flaky tests, trend) | `projects_report` |
|
|
@@ -176,6 +176,53 @@ export const projectCommands = [
|
|
|
176
176
|
};
|
|
177
177
|
},
|
|
178
178
|
},
|
|
179
|
+
{
|
|
180
|
+
name: "projects quarantine",
|
|
181
|
+
summary: "Turn auto quarantine on or off and tune when it mutes and releases a test",
|
|
182
|
+
description: "With auto quarantine on, the end of every run checks the tests that ran: a test that " +
|
|
183
|
+
"failed --failures times in the last --days days with a pass in between is " +
|
|
184
|
+
"quarantined (straight failures are a regression and never are), and a quarantined " +
|
|
185
|
+
"test, manual or auto, is released after --passes first-attempt passes in a row. " +
|
|
186
|
+
"Pass on|off and/or any of the numbers; `projects get` shows the current values.",
|
|
187
|
+
scope: "project",
|
|
188
|
+
args: [{ name: "state", description: "on | off; omit to only tune the numbers" }],
|
|
189
|
+
flags: [
|
|
190
|
+
{ name: "failures", type: "number", description: "Failures in the window that quarantine a test (1-50, default 3)" },
|
|
191
|
+
{ name: "days", type: "number", description: "Window in days (1-90, default 7)" },
|
|
192
|
+
{ name: "passes", type: "number", description: "Passes in a row that release a test (1-50, default 5)" },
|
|
193
|
+
],
|
|
194
|
+
examples: [
|
|
195
|
+
"beryl projects quarantine on",
|
|
196
|
+
"beryl projects quarantine on --failures 3 --days 7 --passes 5",
|
|
197
|
+
"beryl projects quarantine --passes 3",
|
|
198
|
+
"beryl projects quarantine off",
|
|
199
|
+
],
|
|
200
|
+
async run(ctx, input) {
|
|
201
|
+
const { workspaceId, projectId } = await ctx.requireProject(input);
|
|
202
|
+
const body = {};
|
|
203
|
+
const state = input.args.state;
|
|
204
|
+
if (typeof state === "string" && state) {
|
|
205
|
+
const lower = state.toLowerCase();
|
|
206
|
+
if (lower !== "on" && lower !== "off") {
|
|
207
|
+
throw new UsageError(`Expected "on" or "off", got "${state}"`);
|
|
208
|
+
}
|
|
209
|
+
body.auto_quarantine = lower === "on";
|
|
210
|
+
}
|
|
211
|
+
const failures = flagNum(input, "failures");
|
|
212
|
+
const days = flagNum(input, "days");
|
|
213
|
+
const passes = flagNum(input, "passes");
|
|
214
|
+
if (failures !== undefined)
|
|
215
|
+
body.quarantine_failures = failures;
|
|
216
|
+
if (days !== undefined)
|
|
217
|
+
body.quarantine_days = days;
|
|
218
|
+
if (passes !== undefined)
|
|
219
|
+
body.quarantine_release_passes = passes;
|
|
220
|
+
if (Object.keys(body).length === 0) {
|
|
221
|
+
throw new UsageError("Pass on|off or at least one of --failures, --days, --passes");
|
|
222
|
+
}
|
|
223
|
+
return { data: await ctx.client.patch(projectPath(workspaceId, projectId), body) };
|
|
224
|
+
},
|
|
225
|
+
},
|
|
179
226
|
{
|
|
180
227
|
name: "projects delete",
|
|
181
228
|
summary: "Delete a project and all its tests and runs",
|
package/dist/commands/tests.js
CHANGED
|
@@ -587,9 +587,10 @@ export const testCommands = [
|
|
|
587
587
|
"red lands in the run's quarantined_count and gates neither the run's verdict nor exit " +
|
|
588
588
|
"codes, so it can't red-light a deploy. Use " +
|
|
589
589
|
"it on a persistently flaky test instead of deleting it (which destroys the history) or " +
|
|
590
|
-
"asking support to deactivate it (which stops it running at all). After
|
|
591
|
-
"
|
|
592
|
-
"
|
|
590
|
+
"asking support to deactivate it (which stops it running at all). After the project's " +
|
|
591
|
+
"release threshold of consecutive clean passes (default 5) the test reports " +
|
|
592
|
+
"rehab_ready: a suggestion while auto quarantine is off, the actual release once " +
|
|
593
|
+
"`projects quarantine on` has turned it on. `off` un-quarantines.",
|
|
593
594
|
scope: "project",
|
|
594
595
|
args: [
|
|
595
596
|
{ name: "test-id", description: "Test id", required: true },
|
package/package.json
CHANGED