For the love of god and sanity...stop asserting gigantic array dumps in tests

Created on 7 July 2025, about 19 hours ago

Overview

People, I just had the worst time trying to fix the tests in ✨ Integrate with Search API Active . Why? Because I innocently added a couple of new SDCs to xb_test_sdc.

That broke several cases of SingleDirectoryComponentTest, which is filled with pernicious assertions of gigantic array dumps. To update those dumps (or add new ones), I had to embark on a nutty Homer's Odyssey of pain trying to extract the proper information from the new components, then reformatting them to match coding standards, then figuring out exactly where and how they should fit into existing assertions...

It was a shitshow. And it's unsustainable. These kinds of tests will heavily discourage contribution, because you can barely even fix a bug, or add a new test case, without it possibly breaking an existing test in an inscrutable way. Nobody will fix bugs in XB if fixing bugs is this painful.

The problem is that asserting gigantic array dumps -- or worse yet, an array of gigantic array dumps -- is awful. It very tightly couples the test to the internals, and means that you're testing all kinds of stuff you probably don't care about, or could be test more clearly in smaller, isolated test cases.

Proposed resolution

Refactor the worst tests (probably ComponentSourceTestBase and its children) so that they no longer contain assertions of dumped arrays which extend into the thousands-of-lines department.

πŸ“Œ Task
Status

Active

Version

0.0

Component

… to be triaged

Created by

πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024