Skip to content

Navigation Menu

Sign in
Sign up

test(files_external): call parent::setUp() in BackendServiceTest - #64174

Open
solracsf wants to merge 1 commit into
master from
fix/files-external-backendservicetest-setup
Open

test(files_external): call parent::setUp() in BackendServiceTest #64174
solracsf wants to merge 1 commit into
master from
fix/files-external-backendservicetest-setup

Conversation

@solracsf

@solracsf solracsf commented Sep 10, 2026

Copy link
Copy Markdown
Member

BackendServiceTest skipped parent::setUp() but still ran TestCase::tearDown(), which re-registers IDBConnection as TestCase::$realDatabase. That property is only set in the parent setUp(), so when this test is the first non-DB test in a run it stays null and every later test gets a null database connection.

CI doesn't hit this because the full files_external suite runs other tests first. Running apps/files_external/tests/Service on its own reproduces it: 112 of 138 tests error with IDBConnection, null given without this change, and all pass with it, on MariaDB 11.8 and PostgreSQL 16.

BackendServiceTest overrode setUp() without calling the parent, but
still ran TestCase::tearDown(). For a test outside the DB group that
tearDown re-registers IDBConnection as TestCase::$realDatabase, which
only the parent setUp() initialises. When BackendServiceTest was the
first non-DB test in a run, $realDatabase stayed null and every later
test in the process got a null database connection.
This showed up when running apps/files_external/tests/Service on its
own: 112 of 138 tests errored with "IDBConnection, null given". The
full files_external suite hides it because earlier tests set
$realDatabase first.
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
solracsf requested a review from a team as a code owner September 10, 2026 10:18
solracsf requested review from Altahrim, come-nc, icewind1991 and leftybournes and removed request for a team September 10, 2026 10:18
@solracsf solracsf added 3. to review Waiting for reviews tests Related to tests labels Sep 10, 2026
@solracsf solracsf added this to the Nextcloud 36 milestone Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@CarlSchwan CarlSchwan CarlSchwan approved these changes
@come-nc come-nc come-nc approved these changes
@icewind1991 icewind1991 Awaiting requested review from icewind1991 icewind1991 is a code owner automatically assigned from nextcloud/server-backend
@Altahrim Altahrim Awaiting requested review from Altahrim Altahrim is a code owner automatically assigned from nextcloud/server-backend
@leftybournes leftybournes Awaiting requested review from leftybournes leftybournes is a code owner automatically assigned from nextcloud/server-backend

Assignees

No one assigned

Labels

3. to review Waiting for reviews tests Related to tests

Projects

None yet

Milestone

Nextcloud 36

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /