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

chore: add more testing around asset class #1753

Merged
merged 10 commits into from
Feb 4, 2025
Merged

chore: add more testing around asset class #1753

merged 10 commits into from
Feb 4, 2025

Conversation

cmwylie19
Copy link
Contributor

@cmwylie19 cmwylie19 commented Jan 31, 2025

Description

The assets class does not have unit tests. The purpose of this PR is to add coverage to ensure the class is working as expected.

Due to the use of dependency injection we are loosely helper functions with the method and functions on the assets class that rely on members of the assets class. Due to that, the intent of this PR is to ensure those injected functions are being with the correct members of the assets class and to hedge against accidentally change by ensuring certain functions are called a certain number of times.

Related Issue

Fixes #1655

Relates to #

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Other (security config, docs update, etc)

Checklist before merging

Signed-off-by: Case Wylie <cmwylie19@defenseunicorns.com>
Copy link

codecov bot commented Jan 31, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.04%. Comparing base (4a85ad0) to head (542ab0c).
Report is 3 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1753      +/-   ##
==========================================
+ Coverage   81.10%   82.04%   +0.94%     
==========================================
  Files          50       51       +1     
  Lines        2127     2211      +84     
  Branches      430      436       +6     
==========================================
+ Hits         1725     1814      +89     
+ Misses        400      395       -5     
  Partials        2        2              
Files with missing lines Coverage Δ
src/lib/assets/assets.ts 100.00% <ø> (ø)
src/lib/assets/index.ts 76.47% <ø> (ø)

... and 2 files with indirect coverage changes

Signed-off-by: Case Wylie <cmwylie19@defenseunicorns.com>
Signed-off-by: Case Wylie <cmwylie19@defenseunicorns.com>
Signed-off-by: Case Wylie <cmwylie19@defenseunicorns.com>
@cmwylie19 cmwylie19 marked this pull request as ready for review February 3, 2025 20:51
@cmwylie19 cmwylie19 requested a review from a team as a code owner February 3, 2025 20:51
src/lib/assets/assets.ts Outdated Show resolved Hide resolved
Signed-off-by: Case Wylie <cmwylie19@defenseunicorns.com>
@cmwylie19 cmwylie19 changed the title chore: add more testing around assets chore: add more testing around asset class Feb 4, 2025
Copy link
Contributor

@samayer12 samayer12 left a comment

Choose a reason for hiding this comment

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

There's room for improvement around how we generate test data, and some of the tests may run the risk of being tied too closely to implementations. However, this is an improvement over previously untested code. Any future refactors of the test suite will have a good starting point 👍

@cmwylie19 cmwylie19 added this pull request to the merge queue Feb 4, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 4, 2025
@cmwylie19 cmwylie19 added this pull request to the merge queue Feb 4, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 4, 2025
@cmwylie19 cmwylie19 added this pull request to the merge queue Feb 4, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 4, 2025
@samayer12 samayer12 added this pull request to the merge queue Feb 4, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 4, 2025
@samayer12 samayer12 added this pull request to the merge queue Feb 4, 2025
Merged via the queue into main with commit 90ebb6a Feb 4, 2025
48 checks passed
@samayer12 samayer12 deleted the 1655 branch February 4, 2025 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

Improve test coverage in src/lib/assets/yaml
2 participants