Skip to content

Don't bootstrap on non-bootstrap CI job #5025

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ pipeline:
commands:
- cp -R . /tmp/2/ && cd /tmp/2/
- ./project/scripts/sbt ";dotty-bootstrapped/compile ;dotty-bootstrapped/test"
- ./project/scripts/bootstrapCmdTests

test_sbt:
group: test
Expand Down
37 changes: 37 additions & 0 deletions project/scripts/bootstrapCmdTests
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env bash

source $(dirname $0)/cmdTestsCommon.inc.sh

# check that benchmarks can run
"$SBT" "dotty-bench/jmh:run 1 1 tests/pos/alias.scala"
# The above is here as it relies on the bootstrapped library.
"$SBT" "dotty-bench-bootstrapped/jmh:run 1 1 tests/pos/alias.scala"
"$SBT" "dotty-bench-bootstrapped/jmh:run 1 1 -with-compiler compiler/src/dotty/tools/dotc/core/Types.scala"

echo "testing scala.quoted.Expr.run from sbt dotr"
"$SBT" ";dotty-compiler-bootstrapped/dotc tests/run-with-compiler/quote-run.scala; dotty-compiler-bootstrapped/dotr -with-compiler Test" > "$tmp"
grep -qe "val a: scala.Int = 3" "$tmp"


# setup for `dotc`/`dotr` script tests
"$SBT" dist-bootstrapped/pack

# check that `dotc` compiles and `dotr` runs it
echo "testing ./bin/dotc and ./bin/dotr"
clear_out "$OUT"
./bin/dotc "$SOURCE" -d "$OUT"
./bin/dotr -classpath "$OUT" "$MAIN" > "$tmp"
test "$EXPECTED_OUTPUT" = "$(cat "$tmp")"

# check that `dotc -from-tasty` compiles and `dotr` runs it
echo "testing ./bin/dotc -from-tasty and dotr -classpath"
clear_out "$OUT1"
./bin/dotc -from-tasty -classpath "$OUT" -d "$OUT1" "$MAIN"
./bin/dotr -classpath "$OUT1" "$MAIN" > "$tmp"
test "$EXPECTED_OUTPUT" = "$(cat "$tmp")"

# echo ":quit" | ./dist-bootstrapped/target/pack/bin/dotr # not supported by CI

echo "testing ./bin/dotd"
clear_out "$OUT"
./bin/dotd -project Hello -siteroot "$OUT" "$SOURCE"
52 changes: 1 addition & 51 deletions project/scripts/cmdTests
Original file line number Diff line number Diff line change
@@ -1,28 +1,6 @@
#!/usr/bin/env bash

set -eux

SBT="./project/scripts/sbt" # if run on CI
# SBT="sbt" # if run locally

SOURCE="tests/pos/HelloWorld.scala"
MAIN="HelloWorld"
EXPECTED_OUTPUT="hello world"

# check that benchmarks can run
"$SBT" "dotty-bench/jmh:run 1 1 tests/pos/alias.scala"
"$SBT" "dotty-bench-bootstrapped/jmh:run 1 1 tests/pos/alias.scala"
"$SBT" "dotty-bench-bootstrapped/jmh:run 1 1 -with-compiler compiler/src/dotty/tools/dotc/core/Types.scala"

OUT=$(mktemp -d)
OUT1=$(mktemp -d)
tmp=$(mktemp)

clear_out()
{
local out="$1"
rm -rf "$out/*"
}
source $(dirname $0)/cmdTestsCommon.inc.sh

# check that `sbt dotc` compiles and `sbt dotr` runs it
echo "testing sbt dotc and dotr"
Expand Down Expand Up @@ -50,34 +28,6 @@ clear_out "$OUT"
"$SBT" ";dotc -d $OUT/out.jar $SOURCE; dotc -decompile -classpath $OUT/out.jar -color:never $MAIN" > "$tmp"
grep -qe "def main(args: scala.Array\[scala.Predef.String\]): scala.Unit =" "$tmp"

echo "testing scala.quoted.Expr.run from sbt dotr"
"$SBT" ";dotty-compiler-bootstrapped/dotc tests/run-with-compiler/quote-run.scala; dotty-compiler-bootstrapped/dotr -with-compiler Test" > "$tmp"
grep -qe "val a: scala.Int = 3" "$tmp"


# setup for `dotc`/`dotr` script tests
"$SBT" dist-bootstrapped/pack

# check that `dotc` compiles and `dotr` runs it
echo "testing ./bin/dotc and ./bin/dotr"
clear_out "$OUT"
./bin/dotc "$SOURCE" -d "$OUT"
./bin/dotr -classpath "$OUT" "$MAIN" > "$tmp"
test "$EXPECTED_OUTPUT" = "$(cat "$tmp")"

# check that `dotc -from-tasty` compiles and `dotr` runs it
echo "testing ./bin/dotc -from-tasty and dotr -classpath"
clear_out "$OUT1"
./bin/dotc -from-tasty -classpath "$OUT" -d "$OUT1" "$MAIN"
./bin/dotr -classpath "$OUT1" "$MAIN" > "$tmp"
test "$EXPECTED_OUTPUT" = "$(cat "$tmp")"

# echo ":quit" | ./dist-bootstrapped/target/pack/bin/dotr # not supported by CI

echo "testing ./bin/dotd"
clear_out "$OUT"
./bin/dotd -project Hello -siteroot "$OUT" "$SOURCE"

## Disabled because of flakeyness, should be changed to not depend on sbt
# echo "running Vulpix meta test"
# tmp=$(mktemp)
Expand Down
18 changes: 18 additions & 0 deletions project/scripts/cmdTestsCommon.inc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
set -eux

SBT="./project/scripts/sbt" # if run on CI
# SBT="sbt" # if run locally

SOURCE="tests/pos/HelloWorld.scala"
MAIN="HelloWorld"
EXPECTED_OUTPUT="hello world"

OUT=$(mktemp -d)
OUT1=$(mktemp -d)
tmp=$(mktemp)

clear_out()
{
local out="$1"
rm -rf "$out/*"
}