← All Solo, Not Alone posts

ai-coding testing

Recording a Line Broke the Tests

Earfh's PA announcer plays a recorded voice take when one exists and shows a subtitle when it does not. Adding the first batch of recordings failed the announcer tests, because two of them used a line that was now recorded as their example of one that was not.

Earfh's announcer has a simple rule. A PA line plays its recorded take if the file exists, and shows its subtitle regardless. The first batch of 41 prepared takes landed on October 18, and the announcer tests that had been passing went red.

The commit that fixed it explains why in two sentences. A recorded take leaves the voice playing, and the announcer drops a normal line while a voice is still going, so the tests now stop the voice whenever they move the clock. Two tests also used a recorded line as their example of an unrecorded one, and they switched to a line that has no take.

A fixture that quietly changed

Neither test was wrong when it was written. Every line was silent then, so a line picked at random was an unrecorded line, and nothing in the test said so. The assumption lived in the data. When the data changed, the test kept asserting the same thing about a line that no longer fit the description.

A test that needs "a line with no recording" should name one on purpose, and fail loudly if someone records it.

What changed

The two tests now use a specific line, pa_printer_01, as their unrecorded example. The others stop the voice before they advance the clock.

The announcer has 73 lines, and each recording round changes which of them are silent. That is the reason to name the example and not leave it to chance.

← All Solo, Not Alone posts