Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 10, 2026

The test fails because OCP\Snowflake\IGenerator was removed from Nextcloud. The JobList constructor no longer requires this parameter.

Changes:

  • Replace concrete OC\BackgroundJob\JobList with OCP\BackgroundJob\IJobList interface
  • Remove IGenerator mock and property
  • Simplify test setup: $this->jobList = $this->createMock(IJobList::class)
  • Remove obsolete database and query builder mocks

Before:

$this->generator = $this->createMock(IGenerator::class);
$this->jobList = new JobList(
    $connectionMock,
    $configMock,
    $timeFactoryMock,
    $this->logger,
    $this->generator
);

After:

$this->jobList = $this->createMock(IJobList::class);

Aligns with current Nextcloud server test patterns.

Original prompt

Fix the test from https://github.com/R0Wi-DEV/workflow_ocr/actions/runs/20837498510


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

The test was failing because it tried to mock OCP\Snowflake\IGenerator which no longer exists in recent Nextcloud versions. The JobList constructor signature has changed and no longer requires this parameter.

Changes:
- Removed import of OCP\Snowflake\IGenerator
- Changed from concrete JobList class to IJobList interface
- Removed unnecessary mocks for IConfig, ITimeFactory, IDBConnection, IQueryBuilder, IExpressionBuilder
- Simplified test setup to just create a mock of IJobList
- Removed IGenerator property and related setup code

This aligns the test with how other Nextcloud server tests handle JobList mocking.

Co-authored-by: R0Wi <19730957+R0Wi@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix test issue in workflow OCR Fix ProcessFileJobTest by removing deprecated OCP\Snowflake\IGenerator dependency Jan 10, 2026
Copilot AI requested a review from R0Wi January 10, 2026 07:25
@sonarqubecloud
Copy link

@R0Wi R0Wi marked this pull request as ready for review January 10, 2026 09:56
@R0Wi R0Wi merged commit 814132a into master Jan 10, 2026
17 checks passed
@R0Wi R0Wi deleted the copilot/fix-test-issue branch January 10, 2026 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants