diff --git a/.bazelrc b/.bazelrc index 011eb53..d04e674 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1 +1,3 @@ common --lockfile_mode=off + +test --announce_rc diff --git a/.bazelversion b/.bazelversion new file mode 100644 index 0000000..9907836 --- /dev/null +++ b/.bazelversion @@ -0,0 +1 @@ +8.0.0rc6 diff --git a/BUILD.bazel b/BUILD.bazel index 3d75b80..a02e622 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -1,10 +1,26 @@ +v = """ +#!/bin/bash +set -uxeo pipefail +mkdir -p /tmp/target +mount -t tmpfs none /tmp/target +findmnt /tmp/target +""" + genrule( - name = "test_sh", - outs = ["test.sh"], - cmd = "touch $@", + name = "create_script", + srcs = [], + outs = ["mount_tmpfs.sh"], + cmd = "echo \"{}\" > $@".format(v), + executable = True, +) + +sh_test( + name = "mount_tmpfs_fakeroot", + srcs = ["mount_tmpfs.sh"], + tags = ["requires-fakeroot"], ) sh_test( - name = "test", - srcs = ["test.sh"], + name = "mount_tmpfs_without_fakeroot", + srcs = ["mount_tmpfs.sh"], )