I Tested the Database Away From the Database
By November, the shared Supabase backend was no longer just an architectural decision. It was something that the different applications expected to be there. That made experimentation with changes to it a much less casual affair.
A change can look sensible in a file and still fail when applied to a real database. A successful query can also be misleading: perhaps it worked only because the test used an account with permissions a normal learner would never have. Testing the backend without recreating the conditions of the backend misses a surprising amount.
I needed somewhere to carry out the experiments without treating the working project as the experiment.
An intentionally disposable environment
The integration work used temporary database environments containing the appropriate application history and synthetic content. They could be brought up, exercised and discarded. That made it practical to observe failures I would not deliberately provoke on the working platform.
One example was the publication of a set of questions. Suppose that the first item is accepted and a later item is invalid. If the operation leaves half of the set behind, retrying the batch becomes difficult. It may now collide with the material that survived, and nobody can tell from the original failure alone which parts exist.
In the isolated examination publication test, a late error was deliberately forced. The test checked that the earlier material from the same operation did not remain behind. A valid synthetic publication was subsequently tested as a separate operation.
I also wanted the normal learner's view of the result to be part of the test. It is useful to know that some data has arrived, but less useful if the application cannot issue the corresponding question, understand its format or record its answer. So the practice checks followed synthetic content through issuance, grading, retries and the final result, including attempts to cross account boundaries.
The exercises discovered genuine defects, including the examination recovery problem I described in the previous entry. An environment built only to demonstrate the intended behavior might have missed it.
Copying a project is not the same as creating a new authority
There are several applications in the ecosystem, and copies of database-related material naturally appear in more than one working folder. During the integration work I had to keep the actual shared migration history distinct from reference copies used to explain or test changes.
Otherwise, it becomes remarkably easy to have two apparently correct copies of the same platform evolving independently. One application might be tested against an assumption that another application no longer makes. The fact that both connect to Supabase doesn't resolve the disagreement.
Keeping one authoritative history meant that the temporary tests could start from a known point and a correction could be evaluated as a change to that point. Reference copies remained references. I could understand what had been tested without having to guess which folder happened to contain the most recent file.
Some successful tests were intentionally local. There was no hosted publication during the isolated November runs. The disposable environment was cleaned up afterward. Even the successful reports explicitly described what they had not tested, such as the complete browser workflow.
That discipline can feel a little slow when the change itself is small. But the alternative is to change the working database in order to discover whether the change was sensible. I prefer the inconvenience of creating another test environment to the inconvenience of explaining to a student why the platform's working history suddenly changed.