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: move resource generation out from onLoad #1708

Merged
merged 1 commit into from
Apr 5, 2022

Conversation

dos65
Copy link
Collaborator

@dos65 dos65 commented Apr 1, 2022

No description provided.

@dos65 dos65 force-pushed the frontnd_test_res_gen branch 4 times, most recently from 687516d to e71dc1b Compare April 1, 2022 20:06
@dos65 dos65 marked this pull request as ready for review April 1, 2022 21:26
@kpodsiad
Copy link
Collaborator

kpodsiad commented Apr 2, 2022

@dos65 so this will run generate files lazily?
These resources are also used in bridges' tests, will your fix work too for bridges?

@dos65
Copy link
Collaborator Author

dos65 commented Apr 4, 2022

so this will run generate files lazily?

Kind of. Probably not perfect, in this case they will be generated at the moment of computing test resources that is part of import-build. I can move their generation into test and testOnly but in this case running tests from Metals won't work.

These resources are also used in bridges' tests, will your fix work too for bridges?
Is it about jsBridge and becnhmarkBridge ?
Could you specify commands that requires these resources too?

I'm not familiar fully with all these aspects. My plan was to check that frontend/test works and CI pass

@kpodsiad
Copy link
Collaborator

kpodsiad commented Apr 4, 2022

These resources are also used in bridges' tests, will your fix work too for bridges?
Is it about jsBridge and becnhmarkBridge ?
Could you specify commands that requires these resources too?

I'm not familiar fully with all these aspects. My plan was to check that frontend/test works and CI pass

So, the best part, frontend/test resources aren't used only in frontend/test module :) They are used also in ScalaJsToolchainSpec, which is part of the jsBridge06 and jsBridge1. (nativeBridge04 tests aren't tested on CI.

I wonder if adding a similar trick to these modules will be good enough?

@dos65
Copy link
Collaborator Author

dos65 commented Apr 4, 2022

So, the best part, frontend/test resources aren't used only in frontend/test module :) They are used also in ScalaJsToolchainSpec, which is part of the jsBridge06 and jsBridge1. (nativeBridge04 tests aren't tested on CI.

These project that you mentioned depends on frontend including its test axis.
No additional changes is needed.

Copy link
Collaborator

@kpodsiad kpodsiad left a comment

Choose a reason for hiding this comment

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

These project that you mentioned depends on frontend including its test axis.
No additional changes is needed.

Ok, you're right. Awesome!

Few nitpicks, but it looks good!

Comment on lines 431 to 432
baseDir: File,
log: Logger,
Copy link
Collaborator

Choose a reason for hiding this comment

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

format

@@ -322,7 +323,7 @@ object BuildImplementation {
BuildKeys.schemaVersion := "4.2-refresh-3",
(Test / Keys.testOptions) += sbt.Tests.Argument("-oD"),
Keys.onLoadMessage := Header.intro,
Keys.onLoad := BuildDefaults.bloopOnLoad.value,
//Keys.onLoad := BuildDefaults.bloopOnLoad.value,
Copy link
Collaborator

Choose a reason for hiding this comment

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

leftover

val exitGenerate = Process(cmd, projectDir).!
if (exitGenerate != 0)
throw new sbt.MessageOnlyException(
s"Failed to generate bloop config for ${projectDir}."
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
s"Failed to generate bloop config for ${projectDir}."
s"Failed to generate bloop config for resource project: ${projectDir}."

@dos65 dos65 force-pushed the frontnd_test_res_gen branch from e71dc1b to 5e1596e Compare April 4, 2022 17:33
Copy link
Collaborator

@kpodsiad kpodsiad left a comment

Choose a reason for hiding this comment

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

Works like a charm!

@kpodsiad kpodsiad merged commit ebf0cf4 into scalacenter:main Apr 5, 2022
@kpodsiad kpodsiad mentioned this pull request Apr 9, 2022
16 tasks
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