Skip to content

cmd/image-builder: mock simple integration tests (HMS-10857)#2473

Open
supakeen wants to merge 1 commit into
osbuild:mainfrom
supakeen:mock-unit-tests
Open

cmd/image-builder: mock simple integration tests (HMS-10857)#2473
supakeen wants to merge 1 commit into
osbuild:mainfrom
supakeen:mock-unit-tests

Conversation

@supakeen

Copy link
Copy Markdown
Member

Mock the integration tests that are easy and straightforward to mock. This reduces the test time significantly as we're not performing real dependency solving anymore in most of the tests.


Note this doesn't really make things faster that much. The test suite still takes long as almost every test calls main.Run() which loads distribution definitions which takes 2-3 seconds for every test.

We also can't make the tests parallel without rewriting the entire mocking strategy since we're mocking globals 🙁

@supakeen supakeen requested a review from a team as a code owner June 29, 2026 07:26
@supakeen supakeen requested review from achilleas-k, avitova and lzap June 29, 2026 07:26
achilleas-k
achilleas-k previously approved these changes Jun 29, 2026

@achilleas-k achilleas-k left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Very nice.

I'm sure we can get more improvements to the loading times once we're done with the merge and can focus on the loader.

@supakeen

Copy link
Copy Markdown
Member Author

It seems that with some (new?) tests we now have downstream failures in RPM builds or is this caused by this PR. I'll take a look in the morning.

@supakeen supakeen force-pushed the mock-unit-tests branch 3 times, most recently from ba5bac9 to 9693fa1 Compare July 3, 2026 13:45
Mock the integration tests that are easy and straightforward to mock.
This reduces the test time significantly as we're not performing real
dependency solving anymore in most of the tests.

The resolvers are duplicated here but could later be shared.

Signed-off-by: Simon de Vlieger <cmdr@supakeen.com>
@supakeen supakeen force-pushed the mock-unit-tests branch 2 times, most recently from c6bf538 to cc3c92e Compare July 4, 2026 07:13
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