FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

chore: fix jacoco coverage minimum, throw in memory provider by toddbaert · Pull Request #561 · open-feature/java-sdk · GitHub

chore: fix jacoco coverage minimum, throw in memory provider - #561

Merged
toddbaert merged 1 commit into
mainfrom
chore/fix-codecov
Aug 16, 2023
Merged

chore: fix jacoco coverage minimum, throw in memory provider#561
toddbaert merged 1 commit into
mainfrom
chore/fix-codecov

Conversation

toddbaert commented Aug 15, 2023
edited
Loading

Copy link
Copy Markdown
Member

Small changes to satisfy jacoco coverage failing in main (bring above 80%).

Also throwing in the new in-memory provider instead of returning error resolutions.

cc @liran2000 I missed these small things on your PR. I hope they make sense.

toddbaert requested a review from a team as a code owner August 15, 2023 20:04
if (ProviderState.ERROR.equals(state)) {
errorCode = ErrorCode.GENERAL;
if (ProviderState.NOT_READY.equals(state)) {
throw new ProviderNotReadyError("provider not yet initialized");

toddbaert Aug 15, 2023
edited
Loading

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@liran2000 throwing like this ends in the same result, but it's a bit easier to trace, and also simpler to write. This is how we generally recommend it's done. There is a small performance cost in serialization of the exception, but I think it's worth it.

Comment on lines +89 to +101
@Test
void notFound() {
assertThrows(FlagNotFoundError.class, () -> {
provider.getBooleanEvaluation("not-found-flag", false, new ImmutableContext());
});
}

@Test
void typeMismatch() {
assertThrows(TypeMismatchError.class, () -> {
provider.getBooleanEvaluation("string-flag", false, new ImmutableContext());
});
}

toddbaert Aug 15, 2023
edited
Loading

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

These bring coverage of the new package up to 80%+ to fix the failure in main.

Signed-off-by: Todd Baert <todd.baert@dynatrace.com>

codecov Bot commented Aug 15, 2023
edited
Loading

Copy link
Copy Markdown

Codecov Report

Merging #561 (8f4d50a) into main (6c52ee4) will decrease coverage by 0.63%.
Report is 2 commits behind head on main.
The diff coverage is 88.31%.

@@             Coverage Diff              @@
##               main     #561      +/-   ##
============================================
- Coverage     95.11%   94.49%   -0.63%     
- Complexity      329      357      +28     
============================================
  Files            31       32       +1     
  Lines           758      835      +77     
  Branches         37       50      +13     
============================================
+ Hits            721      789      +68     
- Misses           20       26       +6     
- Partials         17       20       +3     
Flag Coverage Δ
unittests 94.49% <88.31%> (-0.63%) ⬇️

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

Files Changed Coverage Δ
src/main/java/dev/openfeature/sdk/Value.java 90.09% <82.60%> (-1.96%) ⬇️
...feature/sdk/providers/memory/InMemoryProvider.java 90.00% <90.00%> (ø)
...ava/dev/openfeature/sdk/FlagEvaluationDetails.java 100.00% <100.00%> (ø)
src/main/java/dev/openfeature/sdk/Structure.java 88.37% <100.00%> (+0.87%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

toddbaert changed the title chore: fix codecov, throw in memory provider chore: fix jacoco coverage minimum, throw in memory provider Aug 15, 2023

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!   

0 Bugs
0 Vulnerabilities
0 Security Hotspots
1 Code Smell

No Coverage information
0.0% Duplication

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL