Skip to content

RI-7632 Added RDI factories#5434

Open
valkirilov wants to merge 10 commits intofeature/RI-7632-rdi-api-v2-supportfrom
be/feature/RI-7632/rdi-factories
Open

RI-7632 Added RDI factories#5434
valkirilov wants to merge 10 commits intofeature/RI-7632-rdi-api-v2-supportfrom
be/feature/RI-7632/rdi-factories

Conversation

@valkirilov
Copy link
Member

@valkirilov valkirilov commented Feb 3, 2026

What

Added factories in the back-end

  • introduced factories for mocking test data
  • apply example factories to the new RDI API mocks

Testing

Simply run the tests.

Unit tests

yarn test:api -- --testPathPattern="rdi"

Integration tests

yarn test:api:integration

Note

Low Risk
Test-only changes that refactor mock data creation; low production risk, with a small chance of introducing flaky tests if random factory defaults leak into assertions.

Overview
Adds a centralized set of fishery/faker factories under src/__mocks__/factories/rdi to generate RDI domain models and V1/V2 API response shapes (info, pipeline, status, statistics, dry-run jobs).

Refactors existing RDI mocks (src/__mocks__/rdi.ts) and multiple RDI tests (V1 status transformer, V2 client, and pipeline status integration test) to build fixtures via these factories, keeping legacy exported mocks deterministic by overriding factory fields where needed.

Written by Cursor Bugbot for commit 632c6e5. This will update automatically on new commits. Configure here.

@valkirilov valkirilov marked this pull request as ready for review February 3, 2026 09:31
@valkirilov valkirilov self-assigned this Feb 3, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 3, 2026

Code Coverage - Backend unit tests

St.
Category Percentage Covered / Total
🟢 Statements 92.41% 14145/15306
🟡 Branches 74.79% 4405/5890
🟢 Functions 86.03% 2180/2534
🟢 Lines 92.22% 13521/14661

Test suite run success

3089 tests passing in 293 suites.

Report generated by 🧪jest coverage report action from 632c6e5

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

faker.number.int({ min: 1, max: 3 }),
),
}),
);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exported factories are never used in codebase

Low Severity

RdiPipelineStatusFactory and ComponentStatusFactory are defined and exported but never imported or used anywhere in the codebase. ComponentStatusFactory is only referenced internally by RdiPipelineStatusFactory, which itself has no usages. The tests use the V1/V2 API response factories instead of these domain model factories. These exported factories are dead code that could be removed or marked as intentional infrastructure for future tests.

Additional Locations (1)

Fix in Cursor Fix in Web

Base automatically changed from feature/RI-7632-rdi-api-v2-status-rework to feature/RI-7632-rdi-api-v2-support February 3, 2026 12:22
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