Skip to content

Conversation

booxter
Copy link
Contributor

@booxter booxter commented Apr 19, 2024

Test code was writing {} in the file but this results in an empty dict() produced by json.load, which would later fail with KeyError('user') in make_data.

The reason why this doesn't show up in the test runs is because make_data is mocked out. This test bug was noticed while working on another fix for the test suite where mocks were not effective [1].

While the test suite was not failing (because of mocks), it's still better to inject data that conforms to loader expectations.

[1] #890

Test code was writing {} in the file but this results in an empty dict()
produced by json.load, which would later fail with KeyError('user') in
make_data.

The reason why this doesn't show up in the test runs is because
make_data is mocked out. This test bug was noticed while working on
another fix for the test suite where mocks were not effective [1].

While the test suite was not failing (because of mocks), it's still
better to inject data that conforms to loader expectations.

[1] instructlab#890

Signed-off-by: Ihar Hrachyshka <ihrachys@redhat.com>
@github-actions github-actions bot added the testing Relates to testing label Apr 19, 2024
@russellb russellb merged commit 288d83c into instructlab:main Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing Relates to testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants