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

Feature api refactoring Issue #45 #78

Merged
merged 7 commits into from
Aug 10, 2021
Merged

Conversation

JanSchankin
Copy link
Contributor

No description provided.

# Conflicts:
#	deepsampler-provider/src/testFixtures/java/de/ppi/deepsampler/provider/common/SamplerAspectTest.java
+ non-persistent samples are ignored while loading samples from file
@JanSchankin JanSchankin added the enhancement New feature or request label Aug 2, 2021
@JanSchankin JanSchankin added this to the v2.0.0 milestone Aug 2, 2021
@JanSchankin JanSchankin added this to To do in Dev via automation Aug 2, 2021
@sonarcloud
Copy link

sonarcloud bot commented Aug 2, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

98.5% 98.5% Coverage
0.0% 0.0% Duplication

Copy link
Contributor

@rcschrg rcschrg left a comment

Choose a reason for hiding this comment

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

It would be possible to separate persistent/non-persistent samples more consequently, but it would come with introducing redundancy + a bit overengineering (i guess u would need new record handler + repo + addon-mechanism for external repos. (see PR as approved, comment are meant as ideas to think about, actually I dont know whats better in terms of long time maintainability)

@@ -16,6 +16,7 @@
private List<ParameterMatcher<?>> parameterMatchers = new ArrayList<>();
private Answer<Throwable> answer;
private String sampleId;
private boolean isMarkedForPersistence;
Copy link
Contributor

Choose a reason for hiding this comment

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

I dont know if I like this, it might be better just to create another repository for persistent samples? So samples wont get mixed and you dont have to change core for adjusting persistence features? On the down side, it would introduce more redundancy and it would have been necessary to have a possibility to add external repositories in core, I think that would have some kind of charm.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm using this marker only to find inconsistencies in the Samplers, so that we can throw Exceptions with precise and meaningfull messages.

I also was thinking about introducing a new separated repository. I think this would lead to a cleaner and saver separation. I also like the idea of open extendable repositories. I didn't build something like this, because I think that this would have rather complex consequences and I honestly don't find the time for such big changes right now. Since the flag is only used for validation, I thought that a flag would be enough, at least for now.

Maybe we can reconsider separated repositories in version 3.0.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

BTW: THX for the review 💯

@JanSchankin JanSchankin merged commit 8013cf7 into dev Aug 10, 2021
Dev automation moved this from To do to Done Aug 10, 2021
@JanSchankin JanSchankin deleted the feature-api-refactoring branch December 5, 2021 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Dev
  
Done
Development

Successfully merging this pull request may close these issues.

Seperation of marking the sample for persistence and stubbing the sampled method
2 participants