Skip to content

Conversation

@gustavobtflores
Copy link
Contributor

Description

Adds missing unit tests for HardwareDetailsCommitHistoryView and increases the coverage on this file to 100%

Related

Part of #1519

@gustavobtflores gustavobtflores self-assigned this Jan 21, 2026
@gustavobtflores gustavobtflores added the CI/CD Most or all of the changes are about automated tests / Github's CI label Jan 21, 2026
Copy link
Collaborator

@MarceloRobert MarceloRobert left a comment

Choose a reason for hiding this comment

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

All good, just some nits but I'll pre-approve

@patch(
"kernelCI_app.views.hardwareDetailsCommitHistoryView.get_hardware_commit_history"
)
def test_get_hardware_details_commit_history_returns_table_when_rows_valid(
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: this should be the first test since it is a real "succes" test, and also it's currently in the middle of "response error" test cases

)
response = self.view.post(request, hardware_id="1")

self.assertEqual(response.status_code, 200)
Copy link
Collaborator

Choose a reason for hiding this comment

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

very nit: you could use HTTPStatus.OK or HTTPStatus.BAD_REQUEST for the response codes instead of magic numbers

@gustavobtflores gustavobtflores force-pushed the test/hardware-details-commit-history branch from 8116f49 to 3acf4fd Compare January 21, 2026 20:19
@gustavobtflores gustavobtflores added this pull request to the merge queue Jan 21, 2026
Merged via the queue into kernelci:main with commit 93bccc1 Jan 21, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI/CD Most or all of the changes are about automated tests / Github's CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants