You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The repository contains the scaffolding for automated tests, but in practice there are no working tests and no running CI. As the app takes on dependency and Nextcloud-version updates, this makes every change hard to verify and risky to merge. This issue documents the current state and proposes an incremental path to a working, low-maintenance safety net.
Current state
PHPUnit scaffolding exists but is empty of real tests.phpunit.xml, phpunit.integration.xml, and tests/bootstrap.php are present.
The only test is default template boilerplate.tests/Unit/Controller/PageControllerTest.php only asserts that the index page returns a TemplateResponse named index — it was generated by the Nextcloud app skeleton and tests none of the app's actual behaviour.
That single test can no longer run. It uses PHPUnit_Framework_TestCase and an untyped setUp(), which is PHPUnit 5-era syntax. It is incompatible with modern PHPUnit (class renamed in 6+, void return type required in 8+), so make test does not produce a passing baseline.
No coverage of the logic-heavy code. There are no tests for controllers, services, or the Db mappers — including the report query building, which is the most complex and most bug-prone part of the app (see the recent grouped-report / GROUP BY compatibility problem raised in fixes mtierltd/timetracker#234 #245).
CI is defunct..travis.yml is pinned to PHP 5.6–7.1, Nextcloud stable14, and MariaDB 10.1. Travis CI's free open-source service has been shut down for years, so CI has not run in a very long time.
No GitHub Actions. There is no .github/workflows/ directory.
No JS test tooling. There is no package.json; the gulp/karma references in the Makefile are leftover template comments.
Why this matters
Incoming dependency bumps and Nextcloud max-version updates are, by nature, "does everything still work?" changes — exactly the kind of change automated checks verify cheaply and repeatedly. Without them, each such PR has to be validated by hand.
A concrete recent example: the change proposed in #245 would break grouped reports on PostgreSQL and on MySQL with ONLY_FULL_GROUP_BY (the modern default), because it selects a non-aggregated column under a GROUP BY. Nothing in the current repo would have caught that.
Proposed solutions (incremental, ordered by leverage)
1. Restore CI with GitHub Actions (replace Travis). Start with the cheap, high-value checks that require almost no test-writing: php -l linting, composer validate/install, and static analysis (Psalm or PHPStan). Nextcloud publishes reusable workflow templates (in nextcloud/.github) that can largely be dropped in.
2. Establish a green baseline. Modernise the existing test (PHPUnit\Framework\TestCase, setUp(): void) or replace it, so make test passes again and CI has something to run.
3. Add targeted unit tests for the highest-risk logic first. Prioritise the Db mappers and report query building — the multi-database SQL where bugs are silent and engine-specific.
4. Add integration tests against multiple databases (later). Spin up Nextcloud against SQLite, MySQL, and PostgreSQL to catch cross-database SQL issues like the GROUP BY case above. Higher setup cost, but the strongest guarantee for this app's SQL.
Land a minimal green CI (lint + static analysis + PHPUnit)before merging the pending dependency-update PRs, so that every subsequent PR is checked automatically instead of by hand.
Summary
The repository contains the scaffolding for automated tests, but in practice there are no working tests and no running CI. As the app takes on dependency and Nextcloud-version updates, this makes every change hard to verify and risky to merge. This issue documents the current state and proposes an incremental path to a working, low-maintenance safety net.
Current state
phpunit.xml,phpunit.integration.xml, andtests/bootstrap.phpare present.tests/Unit/Controller/PageControllerTest.phponly asserts that the index page returns aTemplateResponsenamedindex— it was generated by the Nextcloud app skeleton and tests none of the app's actual behaviour.PHPUnit_Framework_TestCaseand an untypedsetUp(), which is PHPUnit 5-era syntax. It is incompatible with modern PHPUnit (class renamed in 6+,voidreturn type required in 8+), somake testdoes not produce a passing baseline.Dbmappers — including the report query building, which is the most complex and most bug-prone part of the app (see the recent grouped-report /GROUP BYcompatibility problem raised in fixes mtierltd/timetracker#234 #245)..travis.ymlis pinned to PHP 5.6–7.1, Nextcloudstable14, and MariaDB 10.1. Travis CI's free open-source service has been shut down for years, so CI has not run in a very long time..github/workflows/directory.package.json; thegulp/karmareferences in theMakefileare leftover template comments.Why this matters
Incoming dependency bumps and Nextcloud max-version updates are, by nature, "does everything still work?" changes — exactly the kind of change automated checks verify cheaply and repeatedly. Without them, each such PR has to be validated by hand.
A concrete recent example: the change proposed in #245 would break grouped reports on PostgreSQL and on MySQL with
ONLY_FULL_GROUP_BY(the modern default), because it selects a non-aggregated column under aGROUP BY. Nothing in the current repo would have caught that.Proposed solutions (incremental, ordered by leverage)
php -llinting,composer validate/install, and static analysis (Psalm or PHPStan). Nextcloud publishes reusable workflow templates (innextcloud/.github) that can largely be dropped in.PHPUnit\Framework\TestCase,setUp(): void) or replace it, somake testpasses again and CI has something to run.Dbmappers and report query building — the multi-database SQL where bugs are silent and engine-specific.GROUP BYcase above. Higher setup cost, but the strongest guarantee for this app's SQL.package.jsonare reintroduced. -> this will not be done because of Migrate the frontend to the Nextcloud UI framework (@nextcloud/vue) — staged epic #259Suggested first step
Land a minimal green CI (lint + static analysis + PHPUnit) before merging the pending dependency-update PRs, so that every subsequent PR is checked automatically instead of by hand.