Skip to content

Make tests depend on environment variables for classpath jars #1738

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

Conversation

felixmulder
Copy link
Contributor

@felixmulder felixmulder commented Nov 23, 2016

sbt adds the correct jars to classpath and the tests depend on
packageAll which creates these. When using something else, however,
these together with sbt-interfaces do not get propagated from the
build.

To remedy this and make the testing a bit more flexible, we now
take these from sys.props instead, see tests/dotty/Jars.scala.

If the props aren't defined we fall back to the ones default to sbt.

review by: @odersky

private val dottyLibrary =
new java.io.File("../library/target/scala-2.11/dotty-library_2.11-0.1-SNAPSHOT.jar").getPath
new java.io.File(Jars.dottyLib).getPath
Copy link
Member

@smarter smarter Nov 23, 2016

Choose a reason for hiding this comment

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

Note that the whole point of this test and InterfaceEntryPointsTest is to give an example of how to use the compilers entry points for external projects; so relying on extra files and/or hardcoded path is not great.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, but do you have an alternative?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@@ -15,6 +15,7 @@ object DottyBuild extends Build {
val isNightly = sys.env.get("NIGHTLYBUILD") == Some("yes")

val jenkinsMemLimit = List("-Xmx1500m")
val ciLimitedThreads = List("-Ddotty.tests.limitedThreads=2")
Copy link
Member

Choose a reason for hiding this comment

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

Is this necessary if this is the default?

* in `project/Build.scala`.
*/
def limitResourceFlags = List("-Ytest-pickler")
private val limitedThreads = sys.props.get("dotty.tests.limitedThreads").getOrElse("2")
Copy link
Member

Choose a reason for hiding this comment

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

You should make sure that limitedThreads is always less than or equal to partest.threads


NestUI.echo(s"## we will run ${sequentialTests.length} tests using ${PartestDefaults.numThreads} thread(s)")
val res = super.runTestsForFiles(sequentialTests, kind)
NestUI.echo(s"## we will run ${limitResourceTests.length} tests using ${PartestDefaults.numThreads} thread(s)")
Copy link
Member

Choose a reason for hiding this comment

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

This message is slightly different from the message below, either add in parallel here or remove it below

@felixmulder felixmulder force-pushed the topic/environmentally-friendly-tests branch 2 times, most recently from e05afde to 2f839d2 Compare November 23, 2016 16:17
sbt adds the correct jars to classpath and the tests depend on
`packageAll` which creates these. When using something else however,
these together with `sbt-interfaces` do not get propagated from the
build.

To remedy this and make the testing a bit more flexible, we now
take these from `sys.props` instead, see `tests/dotty/Jars.scala`.

If the props aren't defined we fall back to the ones default to sbt.
@felixmulder felixmulder force-pushed the topic/environmentally-friendly-tests branch from 2f839d2 to ede2d53 Compare November 23, 2016 17:08
@felixmulder
Copy link
Contributor Author

Superseded by #1739 sot that Martin can add his fixes for Eclipse

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