scripted test steps #104
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I watched an agent.test.unit agent run and it really faliled around before it figured out the tests, which leads me to realize it would be possible for the step to miss tests. I think the user should have the ability to switch this step to scripted, and select their test suite and how to run it. agent by default is fine, scripted for more advanced users. This should also apply to agent.test.browser.
Shipped in
47aace1, as the OpenSpec changescripted-test-steps. It is now archived (9d27890). Its requirements are the newscripted-testsspec, andnew-run,browser-checkandpipeline-stepsare updated.Chosen in New Run. For a pipeline with test steps, the wizard's Tests step offers Agent (the default) or Script with a command, for the unit tests and for the browser check. It also takes an optional App command, which is how the browser check serves the app.
GET /api/repo-profilereports astests.POST /api/runstakes the choice astestsand keeps only what differs from the agents. Anything malformed is refused with 400 and the reason..osf/brief.json.Scripted steps beside the agent ones.
script.test.unitandscript.test.browsersit besideagent.test.unitandagent.test.browserin every built-in pipeline that tests. Conditions pick one of each pair; the other is skipped, with the command as the reason. A scripted step:PREVIEW_PORT;.osf/test/unit.jsonor.osf/test/browser-script.json;It judges and does not repair: a red suite fails the step.
Verified on production with run 33 (
run_01M3P3GXYAS552B7G7EYPNV8KV), whose unit tests were scripted ascd backend && .venv/bin/python -m pytest -q && cd ../frontend && npm test:agent.test.unitwas skipped as not needed.script.test.unitwas green in 15.7 s, with the suite's output (the backend's pytest, then 57 vitest tests) as the step's output.Also checked in a real browser against a local osfd: the Tests step, a started run's brief, and a scripted browser suite whose exit code 1 failed its step.