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

refactor: internal/helper/image_unit_test : use table driven tests #838

Conversation

PapePathe
Copy link
Contributor

@PapePathe PapePathe commented Oct 1, 2023

Fixes #832

Unit tests were spread across various functions, but most of them can be organized into table driven test cases.

@PapePathe PapePathe requested a review from a team as a code owner October 1, 2023 23:18
@PapePathe PapePathe changed the title refactor internal/helper/image_unit_test : use table driven tests refactor: internal/helper/image_unit_test : use table driven tests Oct 1, 2023
Copy link
Contributor

@nandor-magyar nandor-magyar left a comment

Choose a reason for hiding this comment

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

Hey! Thank You for your contribution. Nice and clean solution, minor things to be changed and it is good to be merged.

golang/internal/helper/image/image_unit_test.go Outdated Show resolved Hide resolved
Unit tests were spread across various functions, but most of them
can be organized into table driven test cases.
…ction

Promot NewPTR as a general helper function .
@PapePathe PapePathe force-pushed the test/add_table_testing_to_images_unit_test branch from 96d3839 to 732dcd0 Compare October 3, 2023 01:10
@codecov
Copy link

codecov bot commented Oct 8, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (c7d2a60) 24.29% compared to head (4cc765e) 24.31%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #838      +/-   ##
===========================================
+ Coverage    24.29%   24.31%   +0.02%     
===========================================
  Files           62       63       +1     
  Lines         5994     5996       +2     
===========================================
+ Hits          1456     1458       +2     
  Misses        4432     4432              
  Partials       106      106              
Files Coverage Δ
golang/internal/pointer/pointer.go 100.00% <100.00%> (ø)

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

Copy link
Contributor

@nandor-magyar nandor-magyar left a comment

Choose a reason for hiding this comment

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

Looks, nice! Thank You for your efforts! 💯 👍

@nandor-magyar
Copy link
Contributor

One other thing is missing here, that I should've noticed earlier, we require all commits to be signed: https://github.com/dyrector-io/dyrectorio/blob/develop/CONTRIBUTING.md#commit-signatures

@polaroi8d polaroi8d merged commit 487d114 into dyrector-io:develop Oct 9, 2023
6 checks passed
chandhuDev pushed a commit to chandhuDev/dyrectorio that referenced this pull request Nov 7, 2023
…yrector-io#838)

* refactor internal/helper/image_unit_test : use table driven tests

Unit tests were spread across various functions, but most of them
can be organized into table driven test cases.

* refactor internal/helper/image/image_unit_test.go extract utility function

Promot NewPTR as a general helper function .

* refactor: internal/helper/image_unit_test : add name to table tests

* feat: add tests to pointer module

---------

Co-authored-by: Nandor Magyar <[email protected]>
Co-authored-by: Levente Orban <[email protected]>
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.

Refactor agent image url parse helper unit tests
3 participants