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

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

Merged
merged 3 commits into from Mar 29, 2023

Conversation

snuyanzin
Copy link
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
Copy link

what-the-diff bot commented Mar 29, 2023

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
Copy link
Collaborator

@kingthorin kingthorin left a comment

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
Collaborator Author

yep, probably makes sense to remove it

@kingthorin
Copy link
Collaborator

DOH, needs a spotlessapply

@codecov-commenter
Copy link

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
8 checks passed
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.

None yet

3 participants