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

refactor(test): provide better shaped junit extensions for testing runtimes #4234

Merged

Conversation

ndr-brt
Copy link
Member

@ndr-brt ndr-brt commented Jun 4, 2024

What this PR changes/adds

Extracts an EmbeddedRuntime, an extension of BaseRuntime that runs into a java thread and provides additional features like injectable ServiceExtensions and injectable services.
Provides 3 extensions:

  • RuntimeExtension: abstract extension that defines an embedded runtime to be executed in a junit test.
  • RuntimePerMethodExtension: start and stop the runtime on every test
  • RuntimePerClassExtension: start and stop the runtime once in a test class

Why it does that

test refactoring

Further notes

  • EdcExtension, EdcRuntimeExtension and EdcClassRuntimeExtension have been deprecated.
  • The new extensions have been applied only once per case, the replacement of all the deprecated extensions will happen in subsequent PRs (not necessarily done in the upcoming days)

Linked Issue(s)

Closes #4233

Please be sure to take a look at the contributing guidelines and our etiquette for pull requests.

@ndr-brt ndr-brt added the refactoring Cleaning up code and dependencies label Jun 4, 2024
@codecov-commenter
Copy link

codecov-commenter commented Jun 4, 2024

Codecov Report

Attention: Patch coverage is 8.58896% with 149 lines in your changes missing coverage. Please review.

Project coverage is 75.00%. Comparing base (7f20ba5) to head (4d78691).
Report is 289 commits behind head on main.

Files Patch % Lines
.../eclipse/edc/junit/extensions/EmbeddedRuntime.java 0.00% 72 Missing ⚠️
...eclipse/edc/junit/extensions/RuntimeExtension.java 0.00% 26 Missing ⚠️
...dc/junit/extensions/MultiSourceServiceLocator.java 0.00% 17 Missing ⚠️
...org/eclipse/edc/junit/extensions/EdcExtension.java 0.00% 14 Missing ⚠️
...edc/junit/extensions/RuntimePerClassExtension.java 0.00% 8 Missing ⚠️
...dc/junit/extensions/RuntimePerMethodExtension.java 0.00% 8 Missing ⚠️
...g/eclipse/edc/boot/system/runtime/BaseRuntime.java 82.35% 2 Missing and 1 partial ⚠️
...ipse/edc/junit/extensions/EdcRuntimeExtension.java 0.00% 1 Missing ⚠️

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

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4234      +/-   ##
==========================================
+ Coverage   71.74%   75.00%   +3.25%     
==========================================
  Files         919     1041     +122     
  Lines       18457    20735    +2278     
  Branches     1037     1164     +127     
==========================================
+ Hits        13242    15552    +2310     
+ Misses       4756     4673      -83     
- Partials      459      510      +51     

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

Copy link
Contributor

@wolf4ood wolf4ood left a comment

Choose a reason for hiding this comment

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

🚀

@ndr-brt ndr-brt force-pushed the 4233-refactor-junit-extensions branch from fe33f6f to 4d78691 Compare June 6, 2024 07:46
@ndr-brt ndr-brt merged commit c582647 into eclipse-edc:main Jun 6, 2024
16 checks passed
@ndr-brt ndr-brt deleted the 4233-refactor-junit-extensions branch June 6, 2024 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Cleaning up code and dependencies
Projects
None yet
Development

Successfully merging this pull request may close these issues.

refactor: test runtime extensions
3 participants