Skip to content

Enable parallel execution of scripted in the plugin#3657

Closed
jvican wants to merge 3 commits intosbt:1.xfrom
scalacenter:scripted-parallel
Closed

Enable parallel execution of scripted in the plugin#3657
jvican wants to merge 3 commits intosbt:1.xfrom
scalacenter:scripted-parallel

Conversation

@jvican
Copy link
Member

@jvican jvican commented Oct 20, 2017

Enable parallel execution of scripted in the plugin

The change to enable batched and parallel execution for scripted was done
only for the scripted-sbt project. This pull request enables it for
scripted-plugin, so that all sbt plugins in 1.x. can benefit from it.

By default, it configures a number of parallel instances of 1 and batch
execution is disabled. Users can change the number of parallel sbt hosts
running scripted tests via the scriptedParallelInstances setting.

In some plugins scripted tests', batch execution can cause issues because
the first time > commands are executed they assume sbt starts up. This
error can be fixed by doing reload before running the > command.

Note that the current scripted plugin does not allow parallel execution
in non-batched mode.

eed3si9n and others added 2 commits October 20, 2017 00:23
Uses Scala 2.12.4 for the build definition. This includes fix for runtime reflection of empty package members under Java 9.

Fixes sbt#3587
@jvican jvican force-pushed the scripted-parallel branch 2 times, most recently from 24c183f to 3229eae Compare October 21, 2017 08:39
The change to enable batched and parallel execution for scripted was
done only for the scripted-sbt project. This pull request enables it for
scripted-plugin, so that all sbt plugins in 1.x. can benefit from it.

By default, it configures a number of parallel instances of 1 and batch
execution is disabled. Users can change the number of parallel sbt hosts
running scripted tests via the `scriptedParallelInstances` setting.

In some plugins scripted tests', batch execution can cause issues
because the first time `>` commands are executed they assume sbt starts
up. This error can be fixed by doing `reload` before running the `>`
command.

Note that the current scripted plugin does not allow parallel execution
in non-batched mode.
@jvican jvican force-pushed the scripted-parallel branch from 3229eae to f644936 Compare October 21, 2017 08:52
@jvican
Copy link
Member Author

jvican commented Oct 21, 2017

To be sure this does not cause any problem in the future, I have tested that scripted runs correctly with both batch execution enabled and disabled in sbt-native-packager.

@jvican
Copy link
Member Author

jvican commented Oct 24, 2017

@eed3si9n Can you please review this?

Copy link
Member

@eed3si9n eed3si9n left a comment

Choose a reason for hiding this comment

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

Overall LGTM, but I think this should target 1.x branch since it's a feature addition.

private[this] val bCls = classOf[Boolean]
private[this] val asCls = classOf[Array[String]]
private[this] val lfCls = classOf[java.util.List[File]]
private[this] val iCls = classOf[Integer]
Copy link
Member

Choose a reason for hiding this comment

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

Any particular reason these aren't defined inside scriptedRunTask?

IIUC there's no computation done for these; they're just class literals.

bootProps: File,
launchOpts: Array[String],
prescripted: java.util.List[File],
instances: Integer
Copy link
Member

Choose a reason for hiding this comment

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

Why Integer and not Int?

@dwijnand dwijnand changed the base branch from 1.0.x to 1.x October 25, 2017 21:21
Copy link
Member

@dwijnand dwijnand left a comment

Choose a reason for hiding this comment

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

LGTM. Just a couple of minor questions.

@dwijnand
Copy link
Member

Rebased in #3891.

@dwijnand dwijnand closed this Jan 17, 2018
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.

3 participants