Skip to content
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

WIP: issue-76 #156

Closed
wants to merge 13 commits into from
2 changes: 1 addition & 1 deletion .bazel-installer-linux-x86_64.sh.sha256
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2744447c9999ceea3dc0b90013dcdfbc3683ebb416eb45287c98049bb7a1c6a8 bazel-0.3.2-installer-linux-x86_64.sh
90a8500cad30f2972113ef1ec45cb1e51210d240039742f8954d3271321a6f51 bazel-0.4.4-installer-linux-x86_64.sh
3 changes: 3 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build --strategy=Scalac=worker
test --strategy=Scalac=worker
build --experimental_repository_cache=/tmp/.bazelcache
2 changes: 1 addition & 1 deletion .bazelrc.travis
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ build --verbose_failures
# in a container (unless you require sudo in your .travis.yml) this
# fails to run tests.
build --spawn_strategy=standalone --genrule_strategy=standalone
test --test_strategy=standalone
test --test_strategy=standalone --test_output=errors

# Below this line, .travis.yml will cat the default bazelrc.
# This is needed so Bazel starts with the base workspace in its
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ bazel-*
*.idea
hash1
hash2
*.iml
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ jdk:
- oraclejdk8

before_install:
- wget 'https://github.com/bazelbuild/bazel/releases/download/0.3.2/bazel-0.3.2-installer-linux-x86_64.sh'
- wget 'https://github.com/bazelbuild/bazel/releases/download/0.4.4/bazel-0.4.4-installer-linux-x86_64.sh'
- sha256sum -c .bazel-installer-linux-x86_64.sh.sha256
- chmod +x bazel-0.3.2-installer-linux-x86_64.sh
- ./bazel-0.3.2-installer-linux-x86_64.sh --user
- mv .bazelrc.travis .bazelrc
- chmod +x bazel-0.4.4-installer-linux-x86_64.sh
- ./bazel-0.4.4-installer-linux-x86_64.sh --user
- cat .bazelrc.travis >> .bazelrc

script:
- bash test_run.sh
- bazel test test/integration-tests/...
Copy link
Member

Choose a reason for hiding this comment

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

why not bazel test test/...?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In previous solution it would only run the test_sh.sh which is the integration tests.
Inside the integration tests in runs the bazel test test/...

7 changes: 7 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
filegroup(
name = "sources",
data = ["WORKSPACE",".bazelrc"],
visibility = ["//visibility:public"]
)


5 changes: 5 additions & 0 deletions scala/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
filegroup(
name = "sources",
data = glob(["**"]),
visibility = ["//visibility:public"]
)
6 changes: 6 additions & 0 deletions scala/support/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,9 @@ scala_library(name = "test_reporter",
deps = ["@scalatest//file", "//src/scala:scala_xml"],
visibility = ["//visibility:public"],
)

filegroup(
name = "sources",
data = glob(["**"]),
visibility = ["//visibility:public"]
)
5 changes: 5 additions & 0 deletions src/java/com/google/devtools/build/lib/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,8 @@ java_library(
"@scalac_rules_protobuf_java//jar",
],
)
filegroup(
name = "sources",
data = glob(["**"]),
visibility = ["//visibility:public"]
)
6 changes: 6 additions & 0 deletions src/java/io/bazel/rulesscala/io_utils/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@ java_library(
srcs = glob(["*.java"]),
visibility = ["//visibility:public"],
)

filegroup(
name = "sources",
data = glob(["**"]),
visibility = ["//visibility:public"]
)
6 changes: 6 additions & 0 deletions src/java/io/bazel/rulesscala/jar/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,9 @@ java_binary(name = "binary",
main_class = "io.bazel.rulesscala.jar.JarCreator",
visibility = ["//visibility:public"],
)

filegroup(
name = "sources",
data = glob(["**"]),
visibility = ["//visibility:public"]
)
6 changes: 6 additions & 0 deletions src/java/io/bazel/rulesscala/scalac/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@ java_binary(name = "scalac",
],
visibility = ["//visibility:public"],
)

filegroup(
name = "sources",
data = glob(["**"]),
visibility = ["//visibility:public"]
)
6 changes: 6 additions & 0 deletions src/java/io/bazel/rulesscala/worker/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,9 @@ java_library(name = "worker",
],
visibility = ["//visibility:public"],
)

filegroup(
name = "sources",
data = glob(["**"]),
visibility = ["//visibility:public"]
)
5 changes: 5 additions & 0 deletions src/scala/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,8 @@ java_import(
visibility = ["//visibility:public"],
)

filegroup(
name = "sources",
data = glob(["**"]),
visibility = ["//visibility:public"]
)
6 changes: 6 additions & 0 deletions src/scala/io/bazel/rules_scala/scrooge_support/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,9 @@ scala_library(
],
visibility = ["//visibility:public"],
)

filegroup(
name = "sources",
data = glob(["**"]),
visibility = ["//visibility:public"]
)
6 changes: 6 additions & 0 deletions src/scala/io/bazel/rules_scala/tut_support/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,9 @@ scala_binary(
deps = [":tut_compiler_lib"],
visibility = ["//visibility:public"],
)

filegroup(
name = "sources",
data = glob(["**"]),
visibility = ["//visibility:public"]
)
6 changes: 6 additions & 0 deletions src/scala/scripts/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,9 @@ scala_binary(
],
visibility = ["//visibility:public"],
)

filegroup(
name = "sources",
data = glob(["**"]),
visibility = ["//visibility:public"]
)
6 changes: 6 additions & 0 deletions test/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -216,3 +216,9 @@ scala_binary(
srcs = ["src/main/scala/scala/test/only_java/Alpha.java"],
main_class = "scala.test.Alpha",
)

filegroup(
name = "sources",
data = glob(["**"]),
visibility = ["//visibility:public"]
)
6 changes: 6 additions & 0 deletions test/data/BUILD
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
exports_files(["some.txt", "more.txt", "foo.txt"])

filegroup(
name = "sources",
data = glob(["**"]),
visibility = ["//visibility:public"]
)
129 changes: 129 additions & 0 deletions test/integration-tests/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
repo = ["//:sources",
"//scala:sources",
"//scala/support:sources",
"//src/java/com/google/devtools/build/lib:sources",
"//src/java/io/bazel/rulesscala/io_utils:sources",
"//src/java/io/bazel/rulesscala/jar:sources",
"//src/java/io/bazel/rulesscala/scalac:sources",
"//src/java/io/bazel/rulesscala/worker:sources",
"//src/scala:sources",
"//src/scala/io/bazel/rules_scala/scrooge_support:sources",
"//src/scala/io/bazel/rules_scala/tut_support:sources",
"//src/scala/scripts:sources",
"//test:sources",
"//test/data:sources",
"//test/src/main/resources/scala/test:sources",
"//test/src/main/scala/scala/test/srcjars:sources",
"//test/src/main/scala/scala/test/twitter_scrooge:sources",
"//test/src/main/scala/scala/test/twitter_scrooge/thrift:sources",
"//test/src/main/scala/scala/test/twitter_scrooge/thrift/thrift2:sources",
"//test/src/main/scala/scala/test/twitter_scrooge/thrift/thrift2/thrift3:sources",
"//test/src/main/scala/scala/test/twitter_scrooge/thrift/thrift2/thrift4:sources",
"//test/tut:sources",
"//test_expect_failure/disappearing_class:sources",
"//test_expect_failure/scala_library_suite:sources",
"//test_expect_failure/transitive/java_to_scala:sources",
"//test_expect_failure/transitive/scala_to_java:sources",
"//test_expect_failure/transitive/scala_to_scala:sources",
"//thrift:sources",
"//tut_rule:sources",
"//twitter_scrooge:sources"]

sh_test(
name = "build_targets_under_tests_package",
size = "large",
data = repo,
srcs = ["test_run.sh"],
args = ["bazel","build","test/..."])

sh_test(
name = "run_tests_under_tests_package",
size = "large",
data = repo,
srcs = ["test_run.sh"],
args = ["bazel","test","test/..."] )

sh_test(
name = "run_justscrooges",
size = "medium",
data = repo,
srcs = ["test_run.sh"],
args = ["bazel","run","test/src/main/scala/scala/test/twitter_scrooge:justscrooges"] )

sh_test(
name = "run_JavaBinary",
size = "large",
data = repo + ["@local_jdk//:jdk"],
srcs = ["test_run.sh"],
args = ["bazel","run","test:JavaBinary"] )

sh_test(
name = "run_JavaBinary2",
size = "large",
data = repo + ["@local_jdk//:jdk"],
srcs = ["test_run.sh"],
args = ["bazel","run","test:JavaBinary2"] )

sh_test(
name = "MixJavaScalaLibBinary",
size = "medium",
data = repo,
srcs = ["test_run.sh"],
args = ["bazel","run","test:MixJavaScalaLibBinary"] )

sh_test(
name = "run_ScalaBinary",
size = "medium",
data = repo,
srcs = ["test_run.sh"],
args = ["bazel","run","test:ScalaBinary"] )


sh_test(
name = "test_disappearing_class",
size = "medium",
data = repo,
srcs = ["test_run.sh"],
args = ["test_disappearing_class"] )


sh_test(
name = "run_ScalaLibBinary",
size = "medium",
data = repo,
srcs = ["test_run.sh"],
args = ["bazel","run","test:ScalaLibBinary"] )

sh_test(
name = "JavaOnlySources",
size = "medium",
data = repo,
srcs = ["test_run.sh"],
args = ["bazel","run","test:JavaOnlySources"] )


sh_test(
name = "test_build_is_identical",
size = "large",
data = repo,
srcs = ["test_run.sh"],
args = ["test_build_is_identical"] )


sh_test(
name = "test_transitive_deps",
size = "medium",
data = repo,
srcs = ["test_run.sh"],
args = ["test_transitive_deps"] )


sh_test(
name = "test_scala_library_suite",
size = "medium",
data = repo,
srcs = ["test_run.sh"],
args = ["test_scala_library_suite"] )



Loading