Skip to content

Add test of deterministic and non deterministic provider's methods#743

Merged
snuyanzin merged 3 commits into
datafaker-net:mainfrom
snuyanzin:deterministic
Mar 29, 2023
Merged

Add test of deterministic and non deterministic provider's methods#743
snuyanzin merged 3 commits into
datafaker-net:mainfrom
snuyanzin:deterministic

Conversation

@snuyanzin

Copy link
Copy Markdown
Collaborator

The PR is aiming to solve #741 for all the providers (not only OscarMovie)
E.g. it was detected that Mbti has same issue.

It retrieves all the declared public methods from provider with zero arg and invokes them several times.
The result is expected to be not the same at least for some of the invocations.

As an exception there Deterministic annotation added to mark methods which are expected to return same value for any number of invocations.

@what-the-diff

what-the-diff Bot commented Mar 29, 2023

Copy link
Copy Markdown

PR Summary

  • 🚀 New annotation @deterministic
    Added a new annotation to clearly mark deterministic methods
  • 🧪 Updated methods in Address, Drone, and Locality providers
    Annotated some methods with the new @deterministic annotation for clarity
  • 🔄 Modified Mbti provider to use Supplier
    Improved compatibility with the resolve method using the @deterministic annotation
  • New test case for deterministic and non-deterministic providers
    Ensures that deterministic methods always return the same values in repeated invocations

@snuyanzin snuyanzin changed the title Add test of deterministic and non deterministic methods Add test of deterministic and non deterministic provider's methods Mar 29, 2023

@kingthorin kingthorin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Since this is being added generically, remove it from Oscars?

LGTM

@snuyanzin

Copy link
Copy Markdown
Collaborator Author

yep, probably makes sense to remove it

@kingthorin

Copy link
Copy Markdown
Collaborator

DOH, needs a spotlessapply

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

Merging #743 (a8ce391) into main (d1992a1) will increase coverage by 0.03%.
The diff coverage is 100.00%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@             Coverage Diff              @@
##               main     #743      +/-   ##
============================================
+ Coverage     92.80%   92.84%   +0.03%     
- Complexity     2590     2592       +2     
============================================
  Files           281      281              
  Lines          5126     5126              
  Branches        530      530              
============================================
+ Hits           4757     4759       +2     
+ Misses          241      240       -1     
+ Partials        128      127       -1     
Impacted Files Coverage Δ
...ain/java/net/datafaker/providers/base/Address.java 97.14% <ø> (ø)
.../main/java/net/datafaker/providers/base/Drone.java 100.00% <ø> (ø)
...in/java/net/datafaker/providers/base/Locality.java 64.81% <ø> (ø)
...c/main/java/net/datafaker/providers/base/Mbti.java 100.00% <100.00%> (ø)

... and 3 files with indirect coverage changes

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

@snuyanzin snuyanzin merged commit f4699de into datafaker-net:main Mar 29, 2023
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