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

Replacing several test util function with a generic version #404

Merged
merged 4 commits into from
Oct 7, 2024

Conversation

safaci2000
Copy link
Contributor

ChangeLog:

  • updated several test utils with a generic PtrOf
  • updated references using iotils (Deprecated) with os equivalent import.

ChangeLog:
  - updated several test utils with a generic PtrOf
  - updated references using iotils (Deprecated) with os equivalent import.
@safaci2000
Copy link
Contributor Author

This is mostly fixing up the test tooling instead of using multiple implementation of BoolPtr, StringPtr etc, I removed all of them in favor of a PtroOf that uses generics. Also, ioutils is deprecated so fixed up the imports. All the functions have the same signature.

@go-jet
Copy link
Owner

go-jet commented Oct 6, 2024

Good catch. To eliminate testutils from the name we can go with a new package ptr that will contain just one method Of, so we would write then ptr.Of(false). Also this method isn't specific just for test, so we can move the package to https://github.com/go-jet/jet/tree/master/internal/utils.

@codecov-commenter
Copy link

codecov-commenter commented Oct 6, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.

Project coverage is 90.46%. Comparing base (6a0798e) to head (a77ecc3).
Report is 12 commits behind head on master.

Files with missing lines Patch % Lines
internal/testutils/test_utils.go 75.00% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #404      +/-   ##
==========================================
- Coverage   90.49%   90.46%   -0.04%     
==========================================
  Files         125      126       +1     
  Lines        7458     7432      -26     
==========================================
- Hits         6749     6723      -26     
  Misses        550      550              
  Partials      159      159              
Flag Coverage Δ
?

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@safaci2000
Copy link
Contributor Author

Good catch. To eliminate testutils from the name we can go with a new package ptr that will contain just one method Of, so we would write then ptr.Of(false). Also this method isn't specific just for test, so we can move the package to https://github.com/go-jet/jet/tree/master/internal/utils.

Done

@go-jet
Copy link
Owner

go-jet commented Oct 7, 2024

LGTM. It seems some tests are now failing because of changes in jet-test-data.

@safaci2000
Copy link
Contributor Author

That's odd, that seems to go against how submodule are supposed to work. Do you mind if I just comment out the line:

checkout-testdata:
   git submodule init
   git submodule update
# cd ./testdata && git fetch && git checkout master && git pull

if we're using submodule, it should have a commit ID that the testdata should honor. That line ignores all of it and always pulls master.

@go-jet
Copy link
Owner

go-jet commented Oct 7, 2024

That's odd, that seems to go against how submodule are supposed to work. Do you mind if I just comment out the line:

checkout-testdata:
   git submodule init
   git submodule update
# cd ./testdata && git fetch && git checkout master && git pull

if we're using submodule, it should have a commit ID that the testdata should honor. That line ignores all of it and always pulls master.

Yeah, you are right. Maybe move that line into checkout-latest-testdat.

@safaci2000
Copy link
Contributor Author

Yeah, you are right. Maybe move that line into checkout-latest-testdat.

Done

@go-jet go-jet merged commit 31a6b95 into go-jet:master Oct 7, 2024
3 checks passed
@safaci2000 safaci2000 deleted the feature/testTools branch October 7, 2024 18:08
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.

3 participants