Skip to content

Instantly share code, notes, and snippets.

@greggdonovan
Last active October 16, 2017 14:58
Show Gist options
  • Save greggdonovan/7e20ae53a086c9c11270bfb57d589518 to your computer and use it in GitHub Desktop.
Save greggdonovan/7e20ae53a086c9c11270bfb57d589518 to your computer and use it in GitHub Desktop.
Integrate intellij scala aspect integration testing into rules_scala by manually cloning intellij. This is opposed to using a submodule.
diff --git a/.travis.yml b/.travis.yml
index e4cf4ff..46f5bdc 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -38,6 +38,7 @@ before_install:
./install.sh --user
rm -f install.sh
- cat .bazelrc.travis >> .bazelrc
+ - git clone git@github.com:bazelbuild/intellij.git
script:
- bash test_run.sh ci
diff --git a/test_run.sh b/test_run.sh
index e5bc24f..9b54489 100755
--- a/test_run.sh
+++ b/test_run.sh
@@ -525,6 +525,23 @@ revert_change() {
mv $1/$2.bak $1/$2
}
+test_intellij_aspect() {
+ intellij_git_tag=$1
+ rules_scala_dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
+
+ if [[ "$runner" == "run_test_ci" ]]; then
+ # ci: intellij is checked out with full git history in `.travis.yaml`
+ cd intellij
+ else
+ # local: update or checkout a sibling dir.
+ cd "${rules_scala_dir}/../"
+ test -d "intellij/.git" || git clone git@github.com:bazelbuild/intellij.git
+ cd intellij && git fetch && git pull
+ fi
+ git checkout "${intellij_git_tag}"
+ bazel test --test_output=errors --incompatible_disallow_set_constructor=false --override_repository io_bazel_rules_scala=${rules_scala_dir} //aspect/testing/tests/src/com/google/idea/blaze/aspect/scala/...
+}
+
if [ "$1" != "ci" ]; then
runner="run_test_local"
else
@@ -583,3 +600,5 @@ $runner test_scala_library_expect_no_recompilation_on_internal_change_of_java_de
$runner test_scala_library_expect_no_java_recompilation_on_internal_change_of_scala_sibling
$runner test_scala_library_expect_failure_on_missing_direct_java
$runner bazel run test:test_scala_proto_server
+$runner test_intellij_aspect ac2bb7 #TODO(https://github.com/bazelbuild/intellij/issues/146): replace with release tag when fixed.
+$runner test_intellij_aspect master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment