From 0199dc41764667d0529d18bbf68e278e3f2617a5 Mon Sep 17 00:00:00 2001 From: Dmitry Petrashko Date: Wed, 20 May 2015 00:52:37 +0200 Subject: [PATCH 1/5] Integrating with scala-infra for CI. See https://github.com/scala/scala-jenkins-infra/pull/56 --- scripts/common | 13 +++++++++++++ scripts/jobs/validate/junit | 6 ++++++ scripts/jobs/validate/partest | 6 ++++++ scripts/jobs/validate/scalastyle | 6 ++++++ 4 files changed, 31 insertions(+) create mode 100755 scripts/common create mode 100755 scripts/jobs/validate/junit create mode 100755 scripts/jobs/validate/partest create mode 100755 scripts/jobs/validate/scalastyle diff --git a/scripts/common b/scripts/common new file mode 100755 index 000000000000..c9453506dff4 --- /dev/null +++ b/scripts/common @@ -0,0 +1,13 @@ +update() { + [[ -d $baseDir ]] || mkdir -p $baseDir + cd $baseDir + + if [ ! -d $baseDir/$2 ]; then git clone "https://github.com/$1/$2.git"; fi + + cd $2 + + git fetch --tags "https://github.com/$1/$2.git" + (git fetch "https://github.com/$1/$2.git" $3 && git checkout -fq FETCH_HEAD) #|| git checkout -fq $3 # || fallback is for local testing on tag + git reset --hard +} + diff --git a/scripts/jobs/validate/junit b/scripts/jobs/validate/junit new file mode 100755 index 000000000000..9b84430205e4 --- /dev/null +++ b/scripts/jobs/validate/junit @@ -0,0 +1,6 @@ +baseDir=${WORKSPACE-`pwd`} +scriptsDir="$baseDir/scripts" +. $scriptsDir/common + +update scala scala +sbt -Ddotty.travis.build=yes update compile test diff --git a/scripts/jobs/validate/partest b/scripts/jobs/validate/partest new file mode 100755 index 000000000000..7ff8764a7698 --- /dev/null +++ b/scripts/jobs/validate/partest @@ -0,0 +1,6 @@ +baseDir=${WORKSPACE-`pwd`} +scriptsDir="$baseDir/scripts" +. $scriptsDir/common + +sbt -Ddotty.travis.build=yes update compile "partest run" + diff --git a/scripts/jobs/validate/scalastyle b/scripts/jobs/validate/scalastyle new file mode 100755 index 000000000000..14c1c206a510 --- /dev/null +++ b/scripts/jobs/validate/scalastyle @@ -0,0 +1,6 @@ +baseDir=${WORKSPACE-`pwd`} +scriptsDir="$baseDir/scripts" +. $scriptsDir/common + +sbt scalastyle + From b67142410d2f91d670e0be573d9ff5b6d76e0a8b Mon Sep 17 00:00:00 2001 From: Dmitry Petrashko Date: Wed, 20 May 2015 00:56:54 +0200 Subject: [PATCH 2/5] Move `scala/scala` sources to ./scala/ from ../scala/ Needed for scala-infra. --- test/test/ScannerTest.scala | 2 +- test/test/desugarPackage.scala | 2 +- test/test/parsePackage.scala | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/test/ScannerTest.scala b/test/test/ScannerTest.scala index 15ae41c1c6ed..38835e4a0f53 100644 --- a/test/test/ScannerTest.scala +++ b/test/test/ScannerTest.scala @@ -58,6 +58,6 @@ class ScannerTest extends DottyTest { @Test def scanScala() = { - scanDir("../scala/src") + scanDir("./scala/src") } } diff --git a/test/test/desugarPackage.scala b/test/test/desugarPackage.scala index d38669e7b950..b93dcb3e4afa 100644 --- a/test/test/desugarPackage.scala +++ b/test/test/desugarPackage.scala @@ -11,7 +11,7 @@ object desugarPackage extends DeSugarTest { val start = System.nanoTime() val startNodes = Trees.ntrees parseDir("./src") - parseDir("../scala/src") + parseDir("./scala/src") val ms1 = (System.nanoTime() - start)/1000000 val nodes = Trees.ntrees val buf = parsedTrees map desugarTree diff --git a/test/test/parsePackage.scala b/test/test/parsePackage.scala index ceebadd0db04..0bbf1e9c3b88 100644 --- a/test/test/parsePackage.scala +++ b/test/test/parsePackage.scala @@ -66,7 +66,7 @@ object parsePackage extends ParserTest { nodes = 0 val start = System.nanoTime() parseDir("./src") - parseDir("../scala/src") + parseDir("./scala/src") val ms1 = (System.nanoTime() - start)/1000000 val buf = parsedTrees map transformer.transform val ms2 = (System.nanoTime() - start)/1000000 From 6b1cd332579feb2a6c79568b72d568ec6b2ccbc4 Mon Sep 17 00:00:00 2001 From: Dmitry Petrashko Date: Wed, 20 May 2015 00:59:16 +0200 Subject: [PATCH 3/5] Disable byNameVarargs. Kills JVM. --- tests/{ => pending}/run/byNameVarargs/i499.scala | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tests/{ => pending}/run/byNameVarargs/i499.scala (100%) diff --git a/tests/run/byNameVarargs/i499.scala b/tests/pending/run/byNameVarargs/i499.scala similarity index 100% rename from tests/run/byNameVarargs/i499.scala rename to tests/pending/run/byNameVarargs/i499.scala From e0c2c423e8a399fd00090bf23e37d335a1a46029 Mon Sep 17 00:00:00 2001 From: Dmitry Petrashko Date: Wed, 20 May 2015 02:05:25 +0200 Subject: [PATCH 4/5] Run builds in parallel on the same machine. Allows sbts not to lock on the same ivy cache. --- scripts/common | 1 + scripts/jobs/validate/junit | 2 +- scripts/jobs/validate/partest | 2 +- scripts/jobs/validate/scalastyle | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/common b/scripts/common index c9453506dff4..1c7be04f286a 100755 --- a/scripts/common +++ b/scripts/common @@ -11,3 +11,4 @@ update() { git reset --hard } +sbtArgs="-Ddotty.travis.build=yes -ivy $baseDir/ivy2 -Dsbt.global.base=$HOME/.sbt/0.13 -sbt-dir $HOME/.sbt/0.13" diff --git a/scripts/jobs/validate/junit b/scripts/jobs/validate/junit index 9b84430205e4..f6c4369a5bda 100755 --- a/scripts/jobs/validate/junit +++ b/scripts/jobs/validate/junit @@ -3,4 +3,4 @@ scriptsDir="$baseDir/scripts" . $scriptsDir/common update scala scala -sbt -Ddotty.travis.build=yes update compile test +sbt $sbtArgs update compile test diff --git a/scripts/jobs/validate/partest b/scripts/jobs/validate/partest index 7ff8764a7698..4fd67f1b88b1 100755 --- a/scripts/jobs/validate/partest +++ b/scripts/jobs/validate/partest @@ -2,5 +2,5 @@ baseDir=${WORKSPACE-`pwd`} scriptsDir="$baseDir/scripts" . $scriptsDir/common -sbt -Ddotty.travis.build=yes update compile "partest run" +sbt $sbtArgs update compile "partest run" diff --git a/scripts/jobs/validate/scalastyle b/scripts/jobs/validate/scalastyle index 14c1c206a510..dff202e8b9b8 100755 --- a/scripts/jobs/validate/scalastyle +++ b/scripts/jobs/validate/scalastyle @@ -2,5 +2,5 @@ baseDir=${WORKSPACE-`pwd`} scriptsDir="$baseDir/scripts" . $scriptsDir/common -sbt scalastyle +sbt $sbtArgs scalastyle From 371a60cd9b131fd30b9a64cd757a4d59995ffdf0 Mon Sep 17 00:00:00 2001 From: Dmitry Petrashko Date: Wed, 20 May 2015 11:05:06 +0200 Subject: [PATCH 5/5] Add -e to bash options in scripts. See discussion in #591 --- scripts/jobs/validate/junit | 2 ++ scripts/jobs/validate/partest | 2 ++ scripts/jobs/validate/scalastyle | 2 ++ 3 files changed, 6 insertions(+) diff --git a/scripts/jobs/validate/junit b/scripts/jobs/validate/junit index f6c4369a5bda..9748c3f5fc39 100755 --- a/scripts/jobs/validate/junit +++ b/scripts/jobs/validate/junit @@ -1,3 +1,5 @@ +#!/bin/bash -e + baseDir=${WORKSPACE-`pwd`} scriptsDir="$baseDir/scripts" . $scriptsDir/common diff --git a/scripts/jobs/validate/partest b/scripts/jobs/validate/partest index 4fd67f1b88b1..9c3c6254d2b7 100755 --- a/scripts/jobs/validate/partest +++ b/scripts/jobs/validate/partest @@ -1,3 +1,5 @@ +#!/bin/bash -e + baseDir=${WORKSPACE-`pwd`} scriptsDir="$baseDir/scripts" . $scriptsDir/common diff --git a/scripts/jobs/validate/scalastyle b/scripts/jobs/validate/scalastyle index dff202e8b9b8..31ace83bae0c 100755 --- a/scripts/jobs/validate/scalastyle +++ b/scripts/jobs/validate/scalastyle @@ -1,3 +1,5 @@ +#!/bin/bash -e + baseDir=${WORKSPACE-`pwd`} scriptsDir="$baseDir/scripts" . $scriptsDir/common