Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move test data from test code to data files #75

Merged
merged 1 commit into from
Jan 19, 2024
Merged

Move test data from test code to data files #75

merged 1 commit into from
Jan 19, 2024

Conversation

per1234
Copy link
Collaborator

@per1234 per1234 commented Jan 19, 2024

The test_get_sketches_reports unit test makes assertions of the data the function will return given a set of input report files. Previously, the assertion data was defined in the test code. That was a significant amount of data, which added a lot of code to the test that is not of interest to the test code maintainer. This will become much more problematic if additional variants of the test are added in the future to provide coverage for other conditions.

The problem is solved by moving the data to a JSON file. The test loads the data from the file when making the assertion.

The test_get_sketches_reports unit test makes assertions of the data the function will return given a set of input
report files. Previously, the assertion data was defined in the test code. That was a significant amount of data, which
added a lot of code to the test that is not of interest to the test code maintainer. This will become much more
problematic if additional variants of the test are added in the future to provide coverage for other conditions.

The problem is solved by moving the data to a JSON file. The test loads the data from the file when making the
assertion.
@per1234 per1234 added type: enhancement Proposed improvement topic: infrastructure Related to project infrastructure labels Jan 19, 2024
@per1234 per1234 self-assigned this Jan 19, 2024
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c41445b) 100.00% compared to head (76c9ec1) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #75   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         2           
  Lines          729       731    +2     
=========================================
+ Hits           729       731    +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@per1234 per1234 merged commit 0a1ccf1 into arduino:main Jan 19, 2024
13 checks passed
@per1234 per1234 deleted the move-test-data branch January 20, 2024 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: infrastructure Related to project infrastructure type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants