-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added test to ensure the integration continues to work.
- Loading branch information
Showing
8 changed files
with
142 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
echo "Running nailgun integration test..." | ||
|
||
sbt "cli/pack" | ||
cwd=$(pwd) | ||
cd cli/target/pack | ||
make install | ||
cd $cwd | ||
|
||
echoOriginalContents() { | ||
cat << EOF | ||
object app { | ||
def main() { | ||
println(1) | ||
} | ||
} | ||
EOF | ||
} | ||
|
||
echoExpectedContents() { | ||
cat << EOF | ||
object app { | ||
def main(): Unit = { | ||
println(1) | ||
} | ||
} | ||
EOF | ||
} | ||
original=target/original.scala | ||
expected=target/expected.scala | ||
|
||
mkdir -p target | ||
echoOriginalContents > ${original} | ||
echoExpectedContents > ${expected} | ||
./bin/scalafix_ng -i ${original} | ||
|
||
# Assert there is no diff | ||
diff ${original} ${expected} | ||
|
||
echo "Done!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
function assert-installed() { | ||
binary=$1 | ||
command -v ${binary} >/dev/null 2>&1 || { echo >&2 "Missing dependency ${binary}, exiting."; exit 1; } | ||
} | ||
|
||
NAILGUN="ng" | ||
if ! type "${NAILGUN}" > /dev/null; then | ||
NAILGUN="ng-nailgun" | ||
fi | ||
|
||
assert-installed $NAILGUN | ||
assert-installed scalafix_ng_server | ||
assert-installed entr | ||
|
||
startNailgun() { | ||
echo "Starting nailgun..." | ||
scalafix_ng_server & | ||
sleep 1 | ||
$NAILGUN ng-alias scalafix scalafix.cli.Cli | ||
} | ||
|
||
|
||
if [ "$1" = "restart" ]; then | ||
$NAILGUN ng-stop || true | ||
sleep 1 | ||
startNailgun | ||
else | ||
$NAILGUN ng-stats &> /dev/null || startNailgun | ||
$NAILGUN scalafix "$@" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
sbt clean coverage test | ||
sbt "; publishLocal ; scripted" | ||
sbt coverageAggregate | ||
#sbt clean coverage test | ||
#sbt "; publishLocal ; scripted" | ||
#sbt coverageAggregate | ||
|
||
# Integration tests | ||
./bin/nailgun_integration_test.sh | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters