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

Fix g8Testing #137

Merged
merged 1 commit into from
Apr 12, 2024
Merged

Fix g8Testing #137

merged 1 commit into from
Apr 12, 2024

Conversation

TonioGela
Copy link
Member

So, apparently giter8 recently introduced some kind of regression, or at least now there's a required change in all g8Templates that is to remove .enablePlugins(ScriptedPlugin) from the project, as was found out and reported here.

The sad side effect of this regression is that now g8Test is a no-op, and taking a look recent builds confirms that.

This PR removes that plugin and fixes the scripted tests

@TonioGela TonioGela requested a review from valencik April 8, 2024 20:59
@valencik
Copy link
Member

valencik commented Apr 9, 2024

Hey @TonioGela thanks for this.
Could you say more about the "and fixes the scripted tests" bit?

So g8Test is still a no-op until something is fixed upstream?

@TonioGela
Copy link
Member Author

TonioGela commented Apr 9, 2024

So g8Test is still a no-op until something is fixed upstream?

Yes. To the best of my understanding what happened is this:

  • The field scriptedDependencies of the Giter8Plugin is set to compile the template and place the compiled artifacts under target/sbt-test
  • When g8Test runs, it should honor what's present in scriptedDependencies, so compile the template and then invoke the ScriptedPlugin testing command to run the test present under targe/sbt-test
  • Something between sbt 1.9.6 and 1.9.7 (AFAIK, ScriptedPlugin is part of sbt itself) either changed the evaluation strategy of the settings' overrides or (more probably) moved the setting scriptedDependencies in the ScriptedPlugin from being a global property to a project property (or something similar).
  • [EDIT] This commit possibly changed the plugins evaluation order: sbt/sbt@7beb23e?diff=unified&w=1
  • The net result is that if you now add to your giter8 template build .enablePlugins(ScriptedPlugin) what will happen is that the scriptedDependencies value set in ScriptedPlugin will override the one in Giter8Plugin, so the template won't compile and the scripted tests will simply turn into a no-op
  • Removing the .enablePlugins(ScriptedPlugin) declaration in the template's build fixes the problem as (I assume) Giter8Plugin now it's the one that directly invokes the scripted test after having compiled the template.

I can't tell if upstream will get fixed or if the new standard for g8 plugins will become not declaring the ScriptedPlugin, what I can tell you is that I amended the giter8's giter8 official template in this PR and Eugene merged it already.

Copy link
Member

@valencik valencik left a comment

Choose a reason for hiding this comment

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

Thanks for the detailed walk through!

@valencik valencik merged commit 67ee77a into typelevel:main Apr 12, 2024
5 checks passed
@TonioGela TonioGela deleted the fixg8Tests branch April 12, 2024 11:26
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.

2 participants