Repository navigation
Play a run as a film in tomato ui, and stop the app when a run is interrupted - #238
Merged
Merged
Conversation
alileza
force-pushed
the
feat/ui-run-movie
branch
from
October 23, 2026 04:51
61536d7 to
211c154
Compare
3 tasks done
Starting a run from tomato ui folds the panes away and plays the run on
the whole window: the containers pulsing on the topology until they are
ready, the app coming up, every scenario's traffic over the topology step
by step with the steps ticked off beside the narration, and a report at
the end with the verdict, where the time went, each feature's failures,
the slowest scenarios and what the app cost. The film follows the run a
beat behind, can be paused, stepped and replayed, and a past run can be
watched again from the Runs tab or with ?watch=<run>&beat=<n>.
Behind it, tomato run reports how it comes up in the tomato event format
(phase, container and app events, with how long each took) and prints
each container's check as it is ready; tomato ui relays them, with the
feature, run_error and summary events, through one function that a
replay endpoint (GET /api/runs/{run}/events) reuses to rebuild a run's
feed from its tomato.log.
Based on feat/profile-on-main: the report's performance section reads
the per-scenario profile.
…e the next Ctrl+C, or the UI's Stop, ended tomato before its defers ran: Docker reaped the containers, but the app runs in its own process group, so nothing reached it, and it held the app port and failed the next run with "app port 8099 is already in use by another process". - `tomato run` catches SIGINT and SIGTERM, stops the app, then the resources, then the containers, and exits with 130; a second signal quits at once. Keep-alive waits through the same handler. - The UI's Stop sends SIGTERM and only kills the run if it is still there 45 seconds later. - A run that finds its port busy looks for an app an earlier run left running — each run records its app's process group in app.pid while the app is up — and stops it, as long as that run's tomato is gone and the process still runs the app command, then carries on.
alileza
force-pushed
the
feat/ui-run-movie
branch
from
October 23, 2026 05:04
211c154 to
ab074a6
Compare
Contributor
🍅 Coverage
Code coverage is unit tests and the integration suite ( Step coverage by resource
Code coverage by resource file (
|
| File | Statements | Coverage |
|---|---|---|
aws/aws.go |
128 / 141 | 90.8% |
browser/browser.go |
174 / 196 | 88.8% |
browser/steps.go |
359 / 407 | 88.2% |
cassandra/cassandra.go |
228 / 306 | 74.5% |
grpcclient/grpc.go |
152 / 202 | 75.2% |
grpcclient/grpc_reflect.go |
101 / 148 | 68.2% |
grpcserver/grpc_server.go |
429 / 465 | 92.3% |
httpclient/concurrent.go |
90 / 90 | 100.0% |
httpclient/http_client.go |
246 / 321 | 76.6% |
httpclient/sse.go |
316 / 316 | 100.0% |
httpserver/http_server.go |
248 / 262 | 94.7% |
kafka/glue.go |
175 / 180 | 97.2% |
kafka/kafka.go |
363 / 458 | 79.3% |
kafka/kafka_groups.go |
74 / 101 | 73.3% |
kafka/kafka_topics.go |
18 / 19 | 94.7% |
kafka/schema_registry.go |
93 / 115 | 80.9% |
lifecycle/lifecycle.go |
106 / 110 | 96.4% |
network/gate.go |
32 / 33 | 97.0% |
network/meter.go |
56 / 58 | 96.6% |
network/network.go |
200 / 223 | 89.7% |
network/steps.go |
112 / 134 | 83.6% |
network_events.go |
30 / 30 | 100.0% |
pdf/cmap.go |
139 / 146 | 95.2% |
pdf/document.go |
122 / 131 | 93.1% |
pdf/encodings.go |
35 / 35 | 100.0% |
pdf/fonts.go |
218 / 232 | 94.0% |
pdf/lexer.go |
179 / 189 | 94.7% |
pdf/pdf.go |
231 / 245 | 94.3% |
pdf/text.go |
129 / 139 | 92.8% |
pdf/verapdf.go |
89 / 96 | 92.7% |
poll.go |
7 / 7 | 100.0% |
postgres/postgres.go |
222 / 269 | 82.5% |
rabbitmq/rabbitmq.go |
203 / 295 | 68.8% |
redis/redis.go |
143 / 221 | 64.7% |
s3/s3.go |
274 / 361 | 75.9% |
screenshots.go |
8 / 8 | 100.0% |
shell/shell.go |
98 / 119 | 82.4% |
stepdef.go |
22 / 25 | 88.0% |
variables.go |
55 / 58 | 94.8% |
websocket/client.go |
165 / 252 | 65.5% |
websocket/server.go |
128 / 136 | 94.1% |
Code coverage by package
| Package | Statements | Coverage |
|---|---|---|
. |
6 / 6 | 100.0% |
command |
1250 / 2355 | 53.1% |
internal/apprunner |
451 / 534 | 84.5% |
internal/awsid |
6 / 6 | 100.0% |
internal/config |
407 / 432 | 94.2% |
internal/container |
369 / 475 | 77.7% |
internal/feature |
37 / 47 | 78.7% |
internal/formatter |
88 / 115 | 76.5% |
internal/grpcfixture |
30 / 31 | 96.8% |
internal/grpcschema |
101 / 108 | 93.5% |
internal/jsonmatch |
207 / 220 | 94.1% |
internal/pdffixture |
140 / 147 | 95.2% |
internal/profile |
181 / 193 | 93.8% |
internal/registry |
152 / 164 | 92.7% |
internal/resource/aws |
128 / 141 | 90.8% |
internal/resource/browser |
533 / 603 | 88.4% |
internal/resource/cassandra |
228 / 306 | 74.5% |
internal/resource/grpcclient |
253 / 350 | 72.3% |
internal/resource/grpcserver |
429 / 465 | 92.3% |
internal/resource/httpclient |
652 / 727 | 89.7% |
internal/resource/httpserver |
248 / 262 | 94.7% |
internal/resource/kafka |
723 / 873 | 82.8% |
internal/resource/lifecycle |
106 / 110 | 96.4% |
internal/resource/network |
400 / 448 | 89.3% |
internal/resource/pdf |
1142 / 1213 | 94.1% |
internal/resource/postgres |
222 / 269 | 82.5% |
internal/resource/rabbitmq |
203 / 295 | 68.8% |
internal/resource/redis |
143 / 221 | 64.7% |
internal/resource/s3 |
274 / 361 | 75.9% |
internal/resource/shell |
98 / 119 | 82.4% |
internal/resource/websocket |
293 / 388 | 75.5% |
internal/resource |
122 / 128 | 95.3% |
internal/runlog |
37 / 58 | 63.8% |
internal/runner |
177 / 186 | 95.2% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two changes, both about what happens when you run the suite from
tomato ui.1. Stop the app when a run is interrupted, and a leftover one before the next
A run interrupted with Ctrl+C, or stopped from
tomato ui, left the app it started running: tomato exited before its defers ran, andgo run ./cmd/appsits in its own process group, so nothing reached the compiled app. It kept the app port, and every run after it failed withapp port 8099 is already in use by another processuntil someone killed it by hand.tomato runhandles SIGINT/SIGTERM: it stops the app, then the resources, then the containers, and exits with 130. A second signal quits at once. Keep-alive waits through the same handler.app.pidwhile the app is up. A run that finds its port busy stops an earlier run's app when that run's tomato is gone and the process still runs the configured app command (a reused pid, or a run in progress, is left alone), printsstopped the app left running by run <id>, and carries on.2. Play a run as a film, from the dependencies to the report
Starting a run from the UI folds the tree, the inspector and the console away and plays the run on the whole window, in four acts:
wait_foranswers, then green with the time it took.It follows the run a beat behind, can be paused, stepped (
←/→,space) and replayed;mbrings it back,escleaves it and restores the panes. A past run can be watched again from the Runs tab, and?watch=<run>&beat=<n>links to a moment of one.Behind it,
tomato runemitsphase,containerandappevents in thetomatoformat (documented),tomato uirelays them through onewsMessagesForfunction, andGET /api/runs/{run}/eventsreuses it to rebuild a run's feed from itstomato.log.Test plan
main(after feat(profile): bring the per-scenario profile to main #236); no conflicts with it.go test ./...passes; 83 UI tests pass;make ui-checksays the committed bundle is up to date.-race);wsMessagesFor, the replay endpoint and the new formatter events; 17 for the reel.?watch=.Supersedes #237.
🤖 Generated with Claude Code