sdods record on our Linux build agent: codegen exited with code 1 and produced no spec
Asked 16,210 views3 answers
44votes
We moved recording onto the same Linux build agent that runs the nightly suite so nobody has to install browsers locally. It dies before a browser ever appears.
bash
sdods record -p demo-shop -e staging --name checkout --user standard
text
✖ RUN_FAILED: playwright codegen exited with code 1 and produced no spec.
hint: Codegen needs a display. On a headless machine, record on your workstation or import an existing spec into recorded/.
sdods run -p demo-shop -e staging -l ui -b chromium passes on that same agent, so the browsers are installed. Is there a headless recording mode, or a flag I have missed?
There is no headless recording mode and there will not be one. sdods record shells out to playwright codegen, which opens two windows: the browser you drive and the inspector that writes the code as you click. Running a suite headless is fine because the run has nothing to show. Recording is the opposite — the window is the whole feature.
The exit code is the tell. Codegen came up, could not open a display, exited 1 and never wrote the output file, so SDODS has nothing to post-process and says so rather than leaving you a half spec.
Two things that do work.
Record on a workstation and commit the spec. It travels: post-processing rewrites absolute URLs on the environment origin into relative paths, so a flow recorded against local runs against staging.
Or import a spec you already have. Put it under projects/demo-shop/recorded/ and give it the three things post-processing would have added — the fixtures import, relative routes, and the describe wrapper with the tags:
Worth adding because it is the next thing you will try: hosting the web UI on that agent does not get you around it either. The Recorder page spawns sdods record on the server, so the display it needs is the server's, not your laptop's. The page says so under its own title.
What you can move between machines is the login, not the session. sdods auth capture writes projects/demo-shop/.auth/staging/standard-0.json and the recorder loads it, so you record locally and still start signed in as a pool user.
We spent an afternoon on the virtual-framebuffer route before admitting defeat. You can get the inspector to start that way, and then there is nobody sitting in front of it to click through the flow, which is the actual constraint. Recording is a human activity.
Where we landed: recordings are made locally and reviewed like any other code, and CI only ever runs -l recorded.