Skip to content
This repository was archived by the owner on May 29, 2026. It is now read-only.
This repository was archived by the owner on May 29, 2026. It is now read-only.

fix(tests): PHPUnit integration tests and Newman fail due to OpenRegister migration issue #225

Description

@rubenvdlinde

Problem

All three test suites — `quality / PHPUnit (PHP 8.3, NC stable32)`, `quality / PHPUnit (PHP 8.4, NC stable32)`, and `quality / Integration Tests (Newman)` — are failing on every branch including `development` itself (confirmed on the `development` run after PR #223 merged on 2026-05-10).

These failures are not caused by any feature branch change; they represent a baseline regression.

Root causes identified

1. PHPUnit — `oc_openregister_objects` table does not exist (27 errors)

All 27 `KoppelingenGebruikIntegrationTest` failures share the same error:

```
GuzzleHttp\Exception\ConnectException: cURL error 7: Failed to connect to localhost port 80
for http://localhost/index.php/apps/softwarecatalog/api/voorzieningen/config
```

The Postgres logs show the real cause — OpenRegister's migration tries to create indexes on `oc_openregister_objects` before the table itself exists:

```
ERROR: relation "oc_openregister_objects" does not exist
STATEMENT: CREATE INDEX objects_published_depublished_idx ON oc_openregister_objects (published, depublished)
```

The Nextcloud log also shows:
```
"Blob migration not complete — skipping openregister_objects table drop"
```

The OpenRegister blob migration guard prevents table (re-)creation, so the objects table never exists, causing the entire softwarecatalog app setup to fail — Nextcloud starts but the app is misconfigured.

2. PHPUnit unit failures (2 failures: `testPasswordChangeWithInvalidUser`, `testAddUserToGroupWithCheck`)

Likely cascading from the same setup failure.

3. Newman — all endpoints return 404 with HTML response

```
AssertionError: Status code is 200 or 201 — expected 404 to be one of [200, 201]
JSONError: Unexpected token '<' at 1:1
```

Newman calls `/configurations?force=true`, `/registers?slug=voorzieningen`, `/schemas?slug=module` and `/registers/{{register_id}}/import` — all return 404 HTML because the softwarecatalog routes were never seeded (OpenRegister install failure). Nextcloud log confirms:

```
"Invalid voorzieningen_register data provided to provideInitialState by softwarecatalog"
```

Fix direction

  1. Investigate OpenRegister's blob migration guard in `lib/Migration/Version1Date20260313120000.php` — the `migrationComplete` check prevents the objects table from being created in a CI fresh-install scenario.
  2. The index migration must either skip gracefully when the table doesn't exist, or table creation must be ordered before the index migration step.
  3. Once OpenRegister installs cleanly in CI, re-verify Newman against a fresh NC environment.

Evidence

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions