Git Product home page Git Product logo

bazel-integration-testing's Introduction

ARCHIVED: Bazel-integration-testing

NOTE: This repository has moved to https://github.com/bazel-contrib/rules_bazel_integration_test.

Because your build infra also needs build (and tests)

Bazel CI
Build status

Problem statement

Bazel-integration-testing aims to give confidence when developing code that is strongly dependent on Bazel.
It does so by allowing you to have isolated reproducible tests which run Bazel inside of them.
Happy path testing are often possible inside of bazel by adding examples of your usage but failing cases are much harder.
Few examples for such code can be Starlark plugins (both open and closed source), tools that augment Bazel/Bazel query and actually also Bazel itself.
This project was inspired by Bazel's own integration tests which were in bash at the time and were coupled inside.
Internally at Wix we use this to develop and test several internal rules, macros and also tools that need to run bazel query and bazel while bazel-watcher runs Bazel in its E2Es to verify its assumptions on bazel run amongst other things. All of these set up scratch workspaces isolated to the specific tests.

Target audience

  • Bazel Starlark rule developers (both open source and closed source)
  • Bazel ecosystem tool developers (both open source and closed source)
  • Bazel developers

Alternatives

For integration testing as of Jan'19 there is no alternative which is usable outside of Bazel.
For some use-cases and tests one can use bazel-skylib's unittest framework.
This is faster and might be easier to setup in the test (smaller scope) but has the built-in limitations of unit testing where you make assumptions about the environment.
To be clear it's usually a good idea to have a mix of unit tests and integration tests for your feedback loop and confidence.

Architecture

The project is built from repository rules, build rules and test drivers.
The build rules are per stack (currently JVM, go, python) and are essentially a wrapper over the $stack_test rule. For every bazel version configured such a wrapper is generated along with a test_suite aggregate.
The JVM build rules are a bit more advanced in that they integrate with bazel_external_dependency_archive repository rule to support external dependencies in the test workspace.
Lastly each stack has a specific test driver which eases creation of scratch WORKSAPCE files, BUILD files, source files, running of Bazel and more.

Getting started

In order to use bazel_java_integration_test, bazel_go_integration_test, or bazel_py_integration_test, you must add the following to your WORKSPACE file:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "build_bazel_integration_testing",
    url = "https://github.com/bazelbuild/bazel-integration-testing/archive/3a6136e8f6287b04043217d94d97ba17edcb7feb.zip",
    type = "zip",
    strip_prefix= "bazel-integration-testing-3a6136e8f6287b04043217d94d97ba17edcb7feb",
    sha256 = "bfc43a94d42e08c89a26a4711ea396a0a594bd5d55394d76aae861b299628dca",
)


load("@build_bazel_integration_testing//tools:repositories.bzl", "bazel_binaries")
#depend on the Bazel binaries, also accepts an array of versions
bazel_binaries()

For JVM tests one would like to call the below instead of the above call to bazel_binaries since it does that plus more dependencies needed for java_test:

load("@build_bazel_integration_testing//tools:bazel_java_integration_test.bzl", "bazel_java_integration_test_deps")
bazel_java_integration_test_deps()

Usage

Go

rules_go already supports, natively, an integration testing framework for validating your rules. If you need to write integration tests, please refer to the godoc and associated go_bazel_test rule.. For example usage, rules_go itself is tested using this rule and many packages inside of the tests package can be used as examples.

Python

TODO

More info

Which bazel versions are supported

TODO

How to have external repositories in your scratch workspace

TODO

Remote execution support

We need to add more info (and also port a small configuration utility) but I'll just add that Wix uses this library on RBE successfully for a few good months.

State of the project

Active development?

The project is under active development.
Because the project solves many use cases right now and unfortunately because of capacity issues we're more in a reactive mode but we strongly encourage feedback in the form of issues and PRs.
Note that it is easier for us to review and assist when PRs are Small and especially when they are prefaced with an issue describing the need and possibly iterating there on the design.
We hope to have more capacity in the next few months to also ramp up the missing pieces below.

What is missing

  • More documentation (for go and python as well as much better documentation for the workspace drivers).
  • Adding external dependencies is possible in some cases (http_archive) but is not easy. We'd like to see if we can expand this support and make it easier.
  • More adoption by rule-sets (rules_docker, rules_scala, etc)
  • Up-to-date linting

Adopters

Here's a (non-exhaustive) list of companies and projects that use bazel-integration-testing. Don't see yours? You can add it in a PR!

bazel-integration-testing's People

Contributors

achew22 avatar aiuto avatar alexeagle avatar borkaehw avatar buchgr avatar cgrushko avatar damienmg avatar davidstanke avatar dslomov avatar edbaunton avatar gregmagolan avatar hchauvin avatar ittaiz avatar jin avatar laurentlb avatar maximn avatar meteorcloudy avatar natansil avatar or-shachar avatar philwo avatar renovate-bot avatar ulfjack avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bazel-integration-testing's Issues

[Refactoring] Remove static members in WorkspaceDriver and provide a @TestRule

I think that in terms of ergonomics:

  1. The static members in WorkspaceDriver should be moved to an Environment class that would be shared to different instances of WorkspaceDriver (through a constructor, e.g. WorkspaceDriver(Environment environment, String bazelVersion)).

  2. A default, shared Environment should be provided by a TestRule implementation of WorkspaceDriver (WorkspaceDriverTestRule) which would set up everything for a JUnit test. I do not advocate here for putting the Environment in a ClassRule, I was more thinking about a singleton.

  3. BazelBaseTestCase should be removed.

bazel_binary repository rule breaks if master rc is present on machine

Hi,
We build a docker image for our developers for several reasons the most significant one is maximizing cache hits. All of the bazel they run are inside the machine.
To maximize cache hits they share many of the flags our CI machines use including platforms/toolchains and more.
We have these flags setup in a master rc file which is baked into the image.
When running the bazel_binary rule inside the container this fails since it picks up the master rc in the first "sanity" check of bazel version.
I'll send a PR shortly that disables all rc files only for this first call of the repository rule (ignore_all_rc_files).
cc @damienmg

[Bug] bazel_java_integration_test doesn't pass tags to suite

If one sets tags on bazel_java_integration_test they are propagated to the individual targets but not set on the suite.
We saw this as a problem when we set the manual tag on the target but they still run (because the individual tests are depended upon by the suite which gets called in the label expansion).
It's basically here but the test will take me a bit and I'm in a different context.
https://github.com/bazelbuild/bazel-integration-testing/blob/master/tools/bazel_java_integration_test.bzl#L144

Flag --incompatible_no_implicit_file_export will break Bazel integration testing in Bazel 1.2.1

Incompatible flag --incompatible_no_implicit_file_export will break Bazel integration testing once Bazel 1.2.1 is released.

Please see the following CI builds for more information:

Questions? Please file an issue in https://github.com/bazelbuild/continuous-integration

Important: Please do NOT modify the issue title since that might break our tools.

Speed up local development with a global integration environment

So this is related to the download cache issue (#63) but operates at a different level. Here, the issue is not to improve performance in general, but only locally, in a development environment.

It would go like this:

  • With a "--define=BAZEL_INTEGRATION_TESTING_DIR=/tmp/foo" in the .bazelrc, the feature is activated and the global integration environment is set to "/tmp/foo".
  • A new JUnit rule can be used to make advantage of that. If the feature is activated, the JUnit rule can use the test name to set up a workspace at "/tmp/foo/workspace_" (the workspace can be deleted before each invocation). Since the output base is derived from an MD5 hash of the absolute path of the workspace, the output base will be reused across invocations, making use of caching. If the feature is not activated, a temporary workspace is created in TEST_TMPDIR as usual.

tests are failing

Here is a link to failing tests:

https://source.cloud.google.com/results/invocations/95c4e0f3-7031-424d-8020-32ec31df2708/targets

They all seem to fail with the same error

exec ${PAGER:-/usr/bin/less} "$0" || exit 1
-----------------------------------------------------------------------------
E
======================================================================
ERROR: testVersion (__main__.TestBaseTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ae2ce999b0cd1d5ac9dfb1981cea0c35/bazel-sandbox/4632248879510800545/execroot/build_bazel_integration_testing/bazel-out/k8-fastbuild/bin/bazel_integration_test/test_base_test/bazel0.10.0.runfiles/build_bazel_integration_testing/bazel_integration_test/test_base_test.py", line 26, in testVersion
    self.assertTrue(("release " + self.bazelVersion) in stdout[0])
IndexError: list index out of range

cc @ittaiz

Flag --incompatible_no_implicit_file_export will break Bazel integration testing in a future Bazel release

Incompatible flag --incompatible_no_implicit_file_export will be enabled by default in a future Bazel release [1], thus breaking Bazel integration testing.

The flag is documented here: bazelbuild/bazel#10225

Please check the following CI builds for build and test results:

Never heard of incompatible flags before? We have documentation that explains everything.

If you don't want to receive any future issues for Bazel integration testing or if you have any questions,
please file an issue in https://github.com/bazelbuild/continuous-integration

Important: Please do NOT modify the issue title since that might break our tools.

[1] The target release hasn't been determined yet. Our tool will update the issue title once the flag flip has been scheduled.

allow injecting environment variables to bazel runner

Currently we can only set the args given to bazel command line but it can be really helpful if we can set environment variables. This would help overriding properties of bazel wrappers to make it work against fake servers rather than real ones.

Permissions issue with repository cache

I'm trying to add an integration test to the IntelliJ plugin: bazelbuild/intellij#1096

I'm running into a permissions issue both locally and on CI: https://buildkite.com/bazel/intellij-plugin-aspect/builds/3659#d197a102-b8d4-4e09-81cc-229e93d68fec

FAILED: //aspect/testing/tests/src/com/google/idea/blaze/aspect/integration:BazelInvokingIntegrationTest/bazel0.28.1 (Summary)
--
ย  | /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/execroot/intellij_with_bazel/bazel-out/k8-fastbuild/testlogs/aspect/testing/tests/src/com/google/idea/blaze/aspect/integration/BazelInvokingIntegrationTest/bazel0.28.1/test.log
ย  | /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/execroot/intellij_with_bazel/bazel-out/k8-fastbuild/testlogs/aspect/testing/tests/src/com/google/idea/blaze/aspect/integration/BazelInvokingIntegrationTest/bazel0.28.1/test_attempts/attempt_1.log
ย  | /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/execroot/intellij_with_bazel/bazel-out/k8-fastbuild/testlogs/aspect/testing/tests/src/com/google/idea/blaze/aspect/integration/BazelInvokingIntegrationTest/bazel0.28.1/test_attempts/attempt_2.log
ย  | (01:34:12) INFO: From Testing //aspect/testing/tests/src/com/google/idea/blaze/aspect/integration:BazelInvokingIntegrationTest/bazel0.28.1:
ย  | ==================== Test output for //aspect/testing/tests/src/com/google/idea/blaze/aspect/integration:BazelInvokingIntegrationTest/bazel0.28.1:
ย  | JUnit4 Test Runner
ย  | .BAZEL COMMAND: [build, //foo:bar, --repository_cache="", --override_repository=intellij_aspect=/var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/763/execroot/intellij_with_bazel/bazel-out/k8-fastbuild/bin/aspect/testing/tests/src/com/google/idea/blaze/aspect/integration/BazelInvokingIntegrationTest/bazel0.28.1.runfiles/intellij_with_bazel/aspect, --define=ij_product=intellij-latest, --aspects=@intellij_aspect//:intellij_info_bundled.bzl%intellij_info_aspect, --output_groups=intellij-info-generic, --host_javabase=@bazel_tools//tools/jdk:absolute_javabase, --java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8, --define=ABSOLUTE_JAVABASE=/var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/763/execroot/intellij_with_bazel/bazel-out/k8-fastbuild/bin/aspect/testing/tests/src/com/google/idea/blaze/aspect/integration/BazelInvokingIntegrationTest/bazel0.28.1.runfiles/intellij_with_bazel/../local_jdk]
ย  | EXIT CODE: 1
ย  | STDOUT:
ย  | ย 
ย  | STDERR:
ย  | $TEST_TMPDIR defined: output root default is '/var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/763/execroot/intellij_with_bazel/_tmp/fa3dc2055d314af8b8ad824deea96141' and max_idle_secs default is '15'.
ย  | Starting local Bazel server and connecting to it...
ย  | Loading:
ย  | Loading: 0 packages loaded
ย  | Analyzing: target //foo:bar (1 packages loaded, 0 targets configured)
ย  | Analyzing: target //foo:bar (19 packages loaded, 123 targets configured)
ย  | INFO: Call stack for the definition of repository 'remote_coverage_tools' which is a http_archive (rule definition at /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/763/execroot/intellij_with_bazel/_tmp/fa3dc2055d314af8b8ad824deea96141/040144d309f814371a891e0e5703ac88/external/bazel_tools/tools/build_defs/repo/http.bzl:237:16):
ย  | - /DEFAULT.WORKSPACE.SUFFIX:5:1
ย  | ERROR: An error occurred during the fetch of repository 'remote_coverage_tools':
ย  | com.google.devtools.build.lib.vfs.FileAccessException: /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/763/execroot/intellij_with_bazel/_tmp/fa3dc2055d314af8b8ad824deea96141/cache/content_addressable/sha256/cc470e529fafb6165b5be3929ff2d99b38429b386ac100878687416603a67889 (Permission denied)
ย  | INFO: Call stack for the definition of repository 'remote_java_tools_linux' which is a http_archive (rule definition at /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/763/execroot/intellij_with_bazel/_tmp/fa3dc2055d314af8b8ad824deea96141/040144d309f814371a891e0e5703ac88/external/bazel_tools/tools/build_defs/repo/http.bzl:237:16):
ย  | - /DEFAULT.WORKSPACE.SUFFIX:239:1
ย  | ERROR: /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/763/execroot/intellij_with_bazel/_tmp/fa3dc2055d314af8b8ad824deea96141/040144d309f814371a891e0e5703ac88/external/bazel_tools/tools/test/CoverageOutputGenerator/java/com/google/devtools/coverageoutputgenerator/BUILD:3:1: @bazel_tools//tools/test/CoverageOutputGenerator/java/com/google/devtools/coverageoutputgenerator:all_lcov_merger_lib depends on @remote_coverage_tools//:all_lcov_merger_tools_deploy.jar in repository @remote_coverage_tools which failed to fetch. no such package '@remote_coverage_tools//': com.google.devtools.build.lib.vfs.FileAccessException: /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/763/execroot/intellij_with_bazel/_tmp/fa3dc2055d314af8b8ad824deea96141/cache/content_addressable/sha256/cc470e529fafb6165b5be3929ff2d99b38429b386ac100878687416603a67889 (Permission denied)
ย  | ERROR: Analysis of target '//foo:bar' failed; build aborted: no such package '@remote_coverage_tools//': com.google.devtools.build.lib.vfs.FileAccessException: /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/763/execroot/intellij_with_bazel/_tmp/fa3dc2055d314af8b8ad824deea96141/cache/content_addressable/sha256/cc470e529fafb6165b5be3929ff2d99b38429b386ac100878687416603a67889 (Permission denied)
ย  | INFO: Elapsed time: 3.437s
ย  | INFO: 0 processes.
ย  | FAILED: Build did NOT complete successfully (19 packages loaded, 123 targets configured)
ย  | FAILED: Build did NOT complete successfully (19 packages loaded, 123 targets configured)
ย  | WORKSPACE CONTENTS:
ย  | /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/763/execroot/intellij_with_bazel/_tmp/fa3dc2055d314af8b8ad824deea96141/workspace4287629176870102684
ย  | /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/763/execroot/intellij_with_bazel/_tmp/fa3dc2055d314af8b8ad824deea96141/workspace4287629176870102684/foo
ย  | /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/763/execroot/intellij_with_bazel/_tmp/fa3dc2055d314af8b8ad824deea96141/workspace4287629176870102684/foo/bar.sh
ย  | /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/763/execroot/intellij_with_bazel/_tmp/fa3dc2055d314af8b8ad824deea96141/workspace4287629176870102684/foo/BUILD
ย  | /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/763/execroot/intellij_with_bazel/_tmp/fa3dc2055d314af8b8ad824deea96141/workspace4287629176870102684/WORKSPACE

I managed to work around this by not calling repositoryCache.freeze() in WorkspaceDriver on Linux - it looks like the freeze operation did cause the repository to be un-writable on Linux,

if (OS.getCurrent() != OS.WINDOWS)
repositoryCache.freeze();
}

public void freeze() throws IOException {
try {
Files.walkFileTree(
// We do not freeze sha-1, which is out of scope for this cache, only sha256.
Files.createDirectories(cachePath.resolve(CAS_DIR).resolve(KEY_TYPE)),
new SimpleFileVisitor<Path>() {
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs)
throws IOException {
if (file.getFileSystem().isReadOnly()) return FileVisitResult.CONTINUE;
if (file.getFileSystem().supportedFileAttributeViews().contains("posix")) {
Set<PosixFilePermission> perms = new HashSet<>();
perms.add(PosixFilePermission.OWNER_READ);
Files.setPosixFilePermissions(file, perms);
}
return FileVisitResult.CONTINUE;
}
@Override
public FileVisitResult postVisitDirectory(Path dir, IOException exc)
throws IOException {
if (dir.getFileSystem().supportedFileAttributeViews().contains("posix")) {
Set<PosixFilePermission> perms = new HashSet<>();
perms.add(PosixFilePermission.OWNER_READ);
perms.add(PosixFilePermission.OWNER_EXECUTE); // For 'ls'
Files.setPosixFilePermissions(dir, perms);
}
return FileVisitResult.CONTINUE;
}
});
} catch (FileSystemException ignored) {
// Freezing does not work with the strong sandboxing on Linux.
}

and I can't disable the repository cache from building the Bazel command by adding --repository_cache= because the driver appends --experimental_repository_cache at the end of everything.

Flag --incompatible_load_java_rules_from_bzl will break Bazel integration testing in Bazel 1.2.1

Incompatible flag --incompatible_load_java_rules_from_bzl will break Bazel integration testing once Bazel 1.2.1 is released.

Please see the following CI builds for more information:

Questions? Please file an issue in https://github.com/bazelbuild/continuous-integration

Important: Please do NOT modify the issue title since that might break our tools.

Share the download cache with the invoking Bazel installation

... or have another way to share external dependencies.

Currently, the Bazel environment that is created by bazel-integration-testing has a download cache that is separated from the invoking Bazel installation (let's call it the "upstream" download cache). It is possible to have a download cache when developing by pinning the TEST_TMPDIR, but since the download cache is a content-addressable storage, wouldn't it make sense to simply use the upstream download cache as it would be safe anyway? In some cases this could greatly improve performance. Agreed, such external dependencies should be avoided when doing integration testing, but sometimes it is more convenient.

This is not something that could be added right away, though, as it would require Bazel to publish in some way the location of its download cache.

Flag --incompatible_restrict_string_escapes will break Bazel integration testing in Bazel 1.2.1

Incompatible flag --incompatible_restrict_string_escapes will break Bazel integration testing once Bazel 1.2.1 is released.

Please see the following CI builds for more information:

Questions? Please file an issue in https://github.com/bazelbuild/continuous-integration

Important: Please do NOT modify the issue title since that might break our tools.

bazel integration testing doesn't work with RBE

Due to the extraction optimization we do in the repository rule Bazel can't run on RBE.
I've worked around many of the parts by manipulating the mtime but there are more files needed (for example $INSTALL_BASE/_embedded_binaries/embedded_tools/platforms/BUILD).
I've experimented with using @damienmg's original unpacked version and it works on RBE.
We pay a cost of re-extracting bazel every test run which is currently ~10 seconds.
This is significant locally but trivial on CI given we can now parallelize (when one uses RBE the build server agents themselves are often weak and can't run many concurrent e2es) and cache hits.
Given the work in bazel on decreasing the binary size and decreasing extraction time it's reasonable to assume sometime in the next 6 months this cost will drop to 3-5 seconds.

@damienmg I want to remove the pre-extraction and just use the original bazel.
WDYT?

Executable and runfiles "teleportation"

Sorry in advance for the cheesy name :)

Imagine you want to write an integration test for a rule that depends on an executable with runfiles that is somewhat expensive to make (let's say, a rule for a language and you want to test some side effects of its compiler). One way to do that with speed while retaining a certain level of isolation and generality would be to:

  1. Build the executable in the invoking bazel environment.
  2. Gather all the runfiles in a runfile manifest.
  3. Add the manifest, the executable and the executable's runfiles as runfiles to, e.g., bazel_java_integration_test.
  4. Reproduce the runfile tree in the integration environment by symlinking with the information provided in 3.

Pseudo-code:

BUILD file:

java_binary(
    name = "bin",
    ...
)

teleportation_manifest(
    name = "bin_with_manifest",
    binary = ":bin",
)

bazel_java_integration_test(
    name = "test",
    data = [":bin_with_manifest"],
)

Test suite:

public class Test {
  ...

  @Before
  public void setUp() {
    driver.setUp();

    driver.teleportExecutable(
        WorkspaceDriver.getRunfile(".../bin_with_manifest.txt"),
        "to/some/package",
        "target");

    driver.scratchFile(
        "foo/BUILD",
        "sh_test(",
        "    ...,",
        "    data = [\"//to/some/package:target\"]",
        ")");
  }
}

Java runner isn't compatible with Bazel > 0.21

Sample run output: https://storage.googleapis.com/bazel-untrusted-buildkite-artifacts/57e26e8a-4dfe-4978-83eb-717a41f91849/javatests/build/bazel/tests/integration/BazelBaseTestCaseTest/bazel0.21.0/attempt_1.log

STDERR:
    $TEST_TMPDIR defined: output root default is '/home/bazel/.cache/bazel/_bazel_bazel/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/57/execroot/build_bazel_integration_testing/_tmp/5779ebb4e6ed1d2af99650167aeb7cfb' and max_idle_secs default is '15'.
    Starting local Bazel server and connecting to it...
    INFO: Invocation ID: 417d9c78-6445-403c-8056-d4b8deee9464
    Loading: 
    Loading: 0 packages loaded
    Loading: 0 packages loaded
    Analyzing: 13 targets (1 packages loaded)
    Analyzing: 13 targets (1 packages loaded, 0 targets configured)
    Analyzing: 13 targets (3 packages loaded, 16 targets configured)
    Analyzing: 13 targets (18 packages loaded, 353 targets configured)
    Analyzing: 13 targets (18 packages loaded, 353 targets configured)
    ERROR: /home/bazel/.cache/bazel/_bazel_bazel/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/57/execroot/build_bazel_integration_testing/_tmp/5779ebb4e6ed1d2af99650167aeb7cfb/0e3c39548b556d9f0eec702c5dd0dd08/external/bazel_tools/tools/jdk/BUILD:305:1: no such package '@remotejdk_linux//': com.google.devtools.build.lib.vfs.FileAccessException: /home/bazel/.cache/bazel/_bazel_bazel/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/57/execroot/build_bazel_integration_testing/_tmp/5779ebb4e6ed1d2af99650167aeb7cfb/cache/content_addressable/sha256/f27cb933de4f9e7fe9a703486cf44c84bc8e9f138be0c270c9e5716a32367e87 (Permission denied) and referenced by '@bazel_tools//tools/jdk:remote_jdk'
    ERROR: Analysis of target '//:IntegrationTestSuiteTest/bazel0.19.1' failed; build aborted: Analysis failed
    INFO: Elapsed time: 9.948s
    INFO: 0 processes.
    FAILED: Build did NOT complete successfully (18 packages loaded, 353 targets configured)
    ERROR: Couldn't start the build. Unable to run tests
    FAILED: Build did NOT complete successfully (18 packages loaded, 353 targets configured)
WORKSPACE CONTENTS:
    /home/bazel/.cache/bazel/_bazel_bazel/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/57/execroot/build_bazel_integration_testing/_tmp/5779ebb4e6ed1d2af99650167aeb7cfb/workspace4291130982696570630
    /home/bazel/.cache/bazel/_bazel_bazel/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/57/execroot/build_bazel_integration_testing/_tmp/5779ebb4e6ed1d2af99650167aeb7cfb/workspace4291130982696570630/java
    /home/bazel/.cache/bazel/_bazel_bazel/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/57/execroot/build_bazel_integration_testing/_tmp/5779ebb4e6ed1d2af99650167aeb7cfb/workspace4291130982696570630/java/build
    /home/bazel/.cache/bazel/_bazel_bazel/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/57/execroot/build_bazel_integration_testing/_tmp/5779ebb4e6ed1d2af99650167aeb7cfb/workspace4291130982696570630/java/build/bazel
    /home/bazel/.cache/bazel/_bazel_bazel/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/57/execroot/build_bazel_integration_testing/_tmp/5779ebb4e6ed1d2af99650167aeb7cfb/workspace4291130982696570630/java/build/bazel/tests
    /home/bazel/.cache/bazel/_bazel_bazel/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/57/execroot/build_bazel_integration_testing/_tmp/5779ebb4e6ed1d2af99650167aeb7cfb/workspace4291130982696570630/java/build/bazel/tests/integration
    /home/bazel/.cache/bazel/_bazel_bazel/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/57/execroot/build_bazel_integration_testing/_tmp/5779ebb4e6ed1d2af99650167aeb7cfb/workspace4291130982696570630/java/build/bazel/tests/integration/libworkspace_driver.jar
    /home/bazel/.cache/bazel/_bazel_bazel/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/57/execroot/build_bazel_integration_testing/_tmp/5779ebb4e6ed1d2af99650167aeb7cfb/workspace4291130982696570630/java/build/bazel/tests/integration/BUILD.bazel
    /home/bazel/.cache/bazel/_bazel_bazel/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/57/execroot/build_bazel_integration_testing/_tmp/5779ebb4e6ed1d2af99650167aeb7cfb/workspace4291130982696570630/IntegrationTestSuiteTest.java
    /home/bazel/.cache/bazel/_bazel_bazel/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/57/execroot/build_bazel_integration_testing/_tmp/5779ebb4e6ed1d2af99650167aeb7cfb/workspace4291130982696570630/WORKSPACE
    /home/bazel/.cache/bazel/_bazel_bazel/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/57/execroot/build_bazel_integration_testing/_tmp/5779ebb4e6ed1d2af99650167aeb7cfb/workspace4291130982696570630/BUILD
    /home/bazel/.cache/bazel/_bazel_bazel/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/57/execroot/build_bazel_integration_testing/_tmp/5779ebb4e6ed1d2af99650167aeb7cfb/workspace4291130982696570630/go
    /home/bazel/.cache/bazel/_bazel_bazel/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/57/execroot/build_bazel_integration_testing/_tmp/5779ebb4e6ed1d2af99650167aeb7cfb/workspace4291130982696570630/go/bazel_integration_test.bzl
    /home/bazel/.cache/bazel/_bazel_bazel/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/57/execroot/build_bazel_integration_testing/_tmp/5779ebb4e6ed1d2af99650167aeb7cfb/workspace4291130982696570630/go/BUILD.bazel
    /home/bazel/.cache/bazel/_bazel_bazel/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/57/execroot/build_bazel_integration_testing/_tmp/5779ebb4e6ed1d2af99650167aeb7cfb/workspace4291130982696570630/tools
    /home/bazel/.cache/bazel/_bazel_bazel/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/57/execroot/build_bazel_integration_testing/_tmp/5779ebb4e6ed1d2af99650167aeb7cfb/workspace4291130982696570630/tools/BUILD
    /home/bazel/.cache/bazel/_bazel_bazel/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/57/execroot/build_bazel_integration_testing/_tmp/5779ebb4e6ed1d2af99650167aeb7cfb/workspace4291130982696570630/tools/repositories.bzl
    /home/bazel/.cache/bazel/_bazel_bazel/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/57/execroot/build_bazel_integration_testing/_tmp/5779ebb4e6ed1d2af99650167aeb7cfb/workspace4291130982696570630/tools/bazel_py_integration_test.bzl
    /home/bazel/.cache/bazel/_bazel_bazel/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/57/execroot/build_bazel_integration_testing/_tmp/5779ebb4e6ed1d2af99650167aeb7cfb/workspace4291130982696570630/tools/import.bzl
    /home/bazel/.cache/bazel/_bazel_bazel/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/57/execroot/build_bazel_integration_testing/_tmp/5779ebb4e6ed1d2af99650167aeb7cfb/workspace4291130982696570630/tools/common.bzl
    /home/bazel/.cache/bazel/_bazel_bazel/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/57/execroot/build_bazel_integration_testing/_tmp/5779ebb4e6ed1d2af99650167aeb7cfb/workspace4291130982696570630/tools/bazel_hash_dict.bzl
    /home/bazel/.cache/bazel/_bazel_bazel/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/57/execroot/build_bazel_integration_testing/_tmp/5779ebb4e6ed1d2af99650167aeb7cfb/workspace4291130982696570630/tools/bazel_java_integration_test.bzl
    /home/bazel/.cache/bazel/_bazel_bazel/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/57/execroot/build_bazel_integration_testing/_tmp/5779ebb4e6ed1d2af99650167aeb7cfb/workspace4291130982696570630/tools/create_bazel_hashdict.py
    /home/bazel/.cache/bazel/_bazel_bazel/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/57/execroot/build_bazel_integration_testing/_tmp/5779ebb4e6ed1d2af99650167aeb7cfb/workspace4291130982696570630/bazel_integration_test.bzl
==> non-zero exit code
	at build.bazel.tests.integration.BazelCommand$Builder.mustRunSuccessfully(BazelCommand.java:172)
	at build.bazel.tests.integration.BazelBaseTestCaseTest.testTestSuiteExists(BazelBaseTestCaseTest.java:57)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at com.google.testing.junit.runner.internal.junit4.CancellableRequestFactory$CancellableRunner.run(CancellableRequestFactory.java:89)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
	at com.google.testing.junit.runner.junit4.JUnit4Runner.run(JUnit4Runner.java:112)
	at com.google.testing.junit.runner.BazelTestRunner.runTestsInSuite(BazelTestRunner.java:144)
	at com.google.testing.junit.runner.BazelTestRunner.main(BazelTestRunner.java:82)
2) testRunningBazelInGivenRelativeDirectory(build.bazel.tests.integration.BazelBaseTestCaseTest)
java.lang.RuntimeException: BAZEL COMMAND: [run, bar]
EXIT CODE: 1
STDOUT:
    
STDERR:
    $TEST_TMPDIR defined: output root default is '/home/bazel/.cache/bazel/_bazel_bazel/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/57/execroot/build_bazel_integration_testing/_tmp/5779ebb4e6ed1d2af99650167aeb7cfb' and max_idle_secs default is '15'.
    Starting local Bazel server and connecting to it...
    INFO: Invocation ID: 693ab57d-0a6a-47fe-9f03-fd59c3b9641e
    Loading: 
    Loading: 0 packages loaded
    Loading: 0 packages loaded
    Analyzing: target //foo:bar (1 packages loaded, 0 targets configured)
    Analyzing: target //foo:bar (6 packages loaded, 22 targets configured)
    Analyzing: target //foo:bar (8 packages loaded, 45 targets configured)
    Analyzing: target //foo:bar (16 packages loaded, 120 targets configured)
    Analyzing: target //foo:bar (17 packages loaded, 326 targets configured)
    Analyzing: target //foo:bar (17 packages loaded, 326 targets configured)
    ERROR: /home/bazel/.cache/bazel/_bazel_bazel/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/57/execroot/build_bazel_integration_testing/_tmp/5779ebb4e6ed1d2af99650167aeb7cfb/bff644596ec7805088952b390a4e3bd8/external/bazel_tools/tools/jdk/BUILD:305:1: no such package '@remotejdk_linux//': com.google.devtools.build.lib.vfs.FileAccessException: /home/bazel/.cache/bazel/_bazel_bazel/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/57/execroot/build_bazel_integration_testing/_tmp/5779ebb4e6ed1d2af99650167aeb7cfb/cache/content_addressable/sha256/f27cb933de4f9e7fe9a703486cf44c84bc8e9f138be0c270c9e5716a32367e87 (Permission denied) and referenced by '@bazel_tools//tools/jdk:remote_jdk'
    ERROR: Analysis of target '//foo:bar' failed; build aborted: Analysis failed
    INFO: Elapsed time: 11.836s
    INFO: 0 processes.
    FAILED: Build did NOT complete successfully (17 packages loaded, 326 targets configured)
    ERROR: Build failed. Not running target
    FAILED: Build did NOT complete successfully (17 packages loaded, 326 targets configured)
WORKSPACE CONTENTS:
    /home/bazel/.cache/bazel/_bazel_bazel/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/57/execroot/build_bazel_integration_testing/_tmp/5779ebb4e6ed1d2af99650167aeb7cfb/workspace1673767554258561207
    /home/bazel/.cache/bazel/_bazel_bazel/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/57/execroot/build_bazel_integration_testing/_tmp/5779ebb4e6ed1d2af99650167aeb7cfb/workspace1673767554258561207/WORKSPACE
    /home/bazel/.cache/bazel/_bazel_bazel/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/57/execroot/build_bazel_integration_testing/_tmp/5779ebb4e6ed1d2af99650167aeb7cfb/workspace1673767554258561207/foo
    /home/bazel/.cache/bazel/_bazel_bazel/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/57/execroot/build_bazel_integration_testing/_tmp/5779ebb4e6ed1d2af99650167aeb7cfb/workspace1673767554258561207/foo/bar.sh
    /home/bazel/.cache/bazel/_bazel_bazel/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/57/execroot/build_bazel_integration_testing/_tmp/5779ebb4e6ed1d2af99650167aeb7cfb/workspace1673767554258561207/foo/BUILD
==> non-zero exit code
	at build.bazel.tests.integration.BazelCommand$Builder.mustRunSuccessfully(BazelCommand.java:172)
	at build.bazel.tests.integration.BazelBaseTestCaseTest.testRunningBazelInGivenRelativeDirectory(BazelBaseTestCaseTest.java:48)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at com.google.testing.junit.runner.internal.junit4.CancellableRequestFactory$CancellableRunner.run(CancellableRequestFactory.java:89)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
	at com.google.testing.junit.runner.junit4.JUnit4Runner.run(JUnit4Runner.java:112)
	at com.google.testing.junit.runner.BazelTestRunner.runTestsInSuite(BazelTestRunner.java:144)
	at com.google.testing.junit.runner.BazelTestRunner.main(BazelTestRunner.java:82)

FAILURES!!!
Tests run: 4,  Failures: 2

Windows: tests fail with --incompatible_windows_native_test_wrapper

Windows 10
Bazel 0.28.1

PATH=c:\git\mingw64\bin;c:\src\bazel-releases\current;c:\windows\system32

Tests pass with --noincompatible_windows_native_test_wrapper:

C:\src\tw-migrations\bazel-integration-testing>bazel --ignore_all_rc_files --output_user_root=c:/b test --repository_cache=  --noincompatible_windows_native_test_wrapper --enable_runfiles //javatests/build/bazel/tests/integration:BazelBaseTestCaseTest/bazel0.21.0 --noincompatible_string_join_requires_strings --test_env=BAZEL_VC --test_env=JAVA_HOME
(...)
//javatests/build/bazel/tests/integration:BazelBaseTestCaseTest/bazel0.21.0 PASSED in 33.0s

Tests fail with --incompatible_windows_native_test_wrapper:

Executing tests from //javatests/build/bazel/tests/integration:BazelBaseTestCaseTest/bazel0.21.0
-----------------------------------------------------------------------------
JUnit4 Test Runner
E
Time: 0.032
There was 1 failure:
1) build.bazel.tests.integration.BazelBaseTestCaseTest
java.io.FileNotFoundException: javatests\build\bazel\tests\integration\BazelBaseTestCaseTest\config0.21.0.properties (The system cannot find the path specified)
        at java.io.FileInputStream.open0(Native Method)
        at java.io.FileInputStream.open(FileInputStream.java:195)
        at java.io.FileInputStream.<init>(FileInputStream.java:138)
        at java.io.FileInputStream.<init>(FileInputStream.java:93)
        at build.bazel.tests.integration.WorkspaceDriver.loadProperties(WorkspaceDriver.java:104)
        at build.bazel.tests.integration.WorkspaceDriver.setUpClass(WorkspaceDriver.java:58)
        at build.bazel.tests.integration.BazelBaseTestCase.setUpClass(BazelBaseTestCase.java:28)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
        at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
        at com.google.testing.junit.runner.internal.junit4.CancellableRequestFactory$CancellableRunner.run(CancellableRequestFactory.java:89)
        at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
        at org.junit.runner.JUnitCore.run(JUnitCore.java:138)
        at com.google.testing.junit.runner.junit4.JUnit4Runner.run(JUnit4Runner.java:112)
        at com.google.testing.junit.runner.BazelTestRunner.runTestsInSuite(BazelTestRunner.java:153)
        at com.google.testing.junit.runner.BazelTestRunner.main(BazelTestRunner.java:84)

FAILURES!!!
Tests run: 0,  Failures: 1

Contents of bazel-bin\javatests\build\bazel\tests\integration\BazelBaseTestCaseTest\config0.21.0.properties:

C:\src\tw-migrations\bazel-integration-testing>type bazel-bin\javatests\build\bazel\tests\integration\BazelBaseTestCaseTest\config0.21.0.properties
bazel.version=0.21.0
bazel.workspace=build_bazel_integration_testing
bazel.external.deps=
java_home_runfiles_path=../local_jdk

This is blocking bazelbuild/bazel#6622.

Ease ability to depend on external workspace from parent workspace

Essentially I'd like to expose an API like addExternalRepository(repoName) which copies the repo directory from runfiles and adds it to the test workspace (as a local repository).
Part of the challenge is that it seems that at least for some use-cases you need to manually generate BUILD files and those need to have custom content (for example use java_import) so I'm not sure how this should work.
I do know the current API is hard to use.
Some very rough parts can be observed in addExternalRepositoryFor, repositoryDeclarationFor, writeWorkspaceFileWithRepositories from https://github.com/bazelbuild/bazel-integration-testing/blob/21425e04588cb687da085b15524a337bfb28c6c6/javatests/build/bazel/tests/integration/BazelBaseTestCaseTest.java

Flag --incompatible_load_python_rules_from_bzl will break Bazel integration testing in Bazel 1.2.1

Incompatible flag --incompatible_load_python_rules_from_bzl will break Bazel integration testing once Bazel 1.2.1 is released.

Please see the following CI builds for more information:

Questions? Please file an issue in https://github.com/bazelbuild/continuous-integration

Important: Please do NOT modify the issue title since that might break our tools.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

bazel
WORKSPACE
  • bazel_skylib 1.0.2
  • com_google_python_gflags python-gflags-2.0

  • Check this box to trigger a request for Renovate to run again on this repository

Revive linting

Unfortunately our linter was stuck on bazel 0.11.0 and now when we upgraded it to 0.17.1 we saw we're really behind. It's currently red on ci

Missing recent bazel versions

This repository seems to be out of date. Are there any plans to update it to work with more recent bazel versions?

Ease ability of rules to test themselves with this library

Currently it's somewhat hard with this library to have rules test themselves since it's hard to "copy" rule contents and dependencies to inner test workspace.
One attempt was done by @or-shachar in an early incarnation of this PR.
The solution might lie not in this library itself but in having rules utilize buildozer scripts to add filegroups recursively (if so we should probably add docs about it)

Flag --incompatible_use_platforms_repo_for_constraints will break Bazel integration testing in Bazel 1.2.1

Incompatible flag --incompatible_use_platforms_repo_for_constraints will break Bazel integration testing once Bazel 1.2.1 is released.

Please see the following CI builds for more information:

Questions? Please file an issue in https://github.com/bazelbuild/continuous-integration

Important: Please do NOT modify the issue title since that might break our tools.

infinite symlink expansion

Easy to reproduce after running build 2-3 times.

ERROR: infinite symlink expansion detected
[start of symlink chain]
some-path/external/build_bazel_bazel_0_16_1/install_base/_embedded_binaries/_embedded_binaries
some-path/external/build_bazel_bazel_0_16_1/install_base/_embedded_binaries
[end of symlink chain]
ERROR: some-other-path/bazel-tooling/external_third_parties/src/it/BUILD.bazel:26:1: no such package '@build_bazel_bazel_0_16_1//': error globbing [install_base/**]: Infinite symlink expansion and referenced by '//external_third_parties/src/it:third_parties_test_runner/bazel0.16.1'
ERROR: Analysis of target '//external_third_parties/src/it:third_parties_test_runner/bazel0.16.1' failed; build aborted: no such package '@build_bazel_bazel_0_16_1//': error globbing [install_base/**]: Infinite symlink expansion

cc @damienmg any quick tips pop into your mind on how to solve this?

Bazel incompatible changes

It looks like this repository is not compatible with --incompatible_no_transitive_loads, see: bazelbuild/bazel-watcher#207

There might be other issues. It may be useful to try other flags, such as --incompatible_new_actions_api --incompatible_bzl_disallow_load_after_statement --incompatible_no_support_tools_in_action_inputs --incompatible_disallow_filetype --incompatible_merge_genfiles_directory --incompatible_no_transitive_loads --incompatible_disable_deprecated_attr_params --incompatible_disallow_load_labels_to_cross_package_boundaries --incompatible_disallow_dict_plus --incompatible_disallow_old_style_args_add

Block-network by default

@hchauvin @damienmg wdyt about adding block-network by default to bazel_java_integration_test and allowing users to opt-out? It's a bit more code but I think that it pushes the users to do the right thing out of the box

Class not found

It might be just because I am doing something wrong.

I set up an example by following exactly this README. I see the same test failure messages from //test:test/bazel0.21.0, //test:test/bazel0.22.0, and //test:test/bazel0.23.2.

exec ${PAGER:-/usr/bin/less} "$0" || exit 1
Executing tests from //test:test/bazel0.23.2
-----------------------------------------------------------------------------
Class not found: [test.test]

BazelTestRunner exiting with a return value of 2
JVM shutdown hooks (if any) will run now.
The JVM will exit once they complete.

-- JVM shutdown starting at 2019-09-17 22:35:41 --

I have tried Bazel 0.22.0 and 0.29.0.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.