Skip to content

Commit

Permalink
Simplify bazel SIG tests (#3616)
Browse files Browse the repository at this point in the history
We can just use the relative path for loading the docker images, the complicated rlocation is not required.
See also https://docs.bazel.build/versions/master/build-ref.html#data
  • Loading branch information
lukedirtwalker authored Jan 20, 2020
1 parent c403d6a commit 10ce4b7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 40 deletions.
3 changes: 0 additions & 3 deletions acceptance/sig_failover/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ sh_test(
name = "sig_failover_test",
size = "small",
srcs = ["test"],
deps = [
"@bazel_tools//tools/bash/runfiles",
],
data = [
"//go/tools/udpproxy:udpproxy",
":dispatcher1",
Expand Down
22 changes: 5 additions & 17 deletions acceptance/sig_failover/test
Original file line number Diff line number Diff line change
Expand Up @@ -43,26 +43,14 @@
# | 242.254.100.3:50000 <-> 242.254.200.4:50000 |
# +---------------------------------------------+


# --- begin runfiles.bash initialization v2 ---
# Copy-pasted from the Bazel Bash runfiles library v2.
set -uo pipefail; f=bazel_tools/tools/bash/runfiles/runfiles.bash
source "${RUNFILES_DIR:-/dev/null}/$f" 2>/dev/null || \
source "$(grep -sm1 "^$f " "${RUNFILES_MANIFEST_FILE:-/dev/null}" | cut -f2- -d' ')" 2>/dev/null || \
source "$0.runfiles/$f" 2>/dev/null || \
source "$(grep -sm1 "^$f " "$0.runfiles_manifest" | cut -f2- -d' ')" 2>/dev/null || \
source "$(grep -sm1 "^$f " "$0.exe.runfiles_manifest" | cut -f2- -d' ')" 2>/dev/null || \
{ echo>&2 "ERROR: cannot find $f"; exit 1; }; f=; set -e
# --- end runfiles.bash initialization v2 ---

run_test() {(set -e
# Register with the docker daemon the docker images bazel created
# (--norun is used for docker images created via go_image because the script runs them by default)
bash "$(rlocation __main__/go/tools/udpproxy/udpproxy)" --norun
bash "$(rlocation __main__/acceptance/sig_failover/dispatcher1)"
bash "$(rlocation __main__/acceptance/sig_failover/dispatcher2)"
bash "$(rlocation __main__/acceptance/sig_failover/sig1)"
bash "$(rlocation __main__/acceptance/sig_failover/sig2)"
bash go/tools/udpproxy/udpproxy --norun
bash acceptance/sig_failover/dispatcher1
bash acceptance/sig_failover/dispatcher2
bash acceptance/sig_failover/sig1
bash acceptance/sig_failover/sig2

docker-compose -f acceptance/sig_failover/docker-compose.yml up -d dispatcher1 dispatcher2 sig1 sig2

Expand Down
3 changes: 0 additions & 3 deletions acceptance/sig_short_exp_time/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ sh_test(
name = "sig_short_exp_time_test",
size = "small",
srcs = ["test"],
deps = [
"@bazel_tools//tools/bash/runfiles",
],
data = [
"//go/tools/udpproxy:udpproxy",
":dispatcher1",
Expand Down
22 changes: 5 additions & 17 deletions acceptance/sig_short_exp_time/test
Original file line number Diff line number Diff line change
Expand Up @@ -47,26 +47,14 @@
# | 242.254.100.3:50000 <-> 242.254.200.4:50000 |
# +---------------------------------------------+


# --- begin runfiles.bash initialization v2 ---
# Copy-pasted from the Bazel Bash runfiles library v2.
set -uo pipefail; f=bazel_tools/tools/bash/runfiles/runfiles.bash
source "${RUNFILES_DIR:-/dev/null}/$f" 2>/dev/null || \
source "$(grep -sm1 "^$f " "${RUNFILES_MANIFEST_FILE:-/dev/null}" | cut -f2- -d' ')" 2>/dev/null || \
source "$0.runfiles/$f" 2>/dev/null || \
source "$(grep -sm1 "^$f " "$0.runfiles_manifest" | cut -f2- -d' ')" 2>/dev/null || \
source "$(grep -sm1 "^$f " "$0.exe.runfiles_manifest" | cut -f2- -d' ')" 2>/dev/null || \
{ echo>&2 "ERROR: cannot find $f"; exit 1; }; f=; set -e
# --- end runfiles.bash initialization v2 ---

run_test() {(set -e
# Register with the docker daemon the docker images bazel created
# (--norun is used for docker images created via go_image because the script runs them by default)
bash "$(rlocation __main__/go/tools/udpproxy/udpproxy)" --norun
bash "$(rlocation __main__/acceptance/sig_short_exp_time/dispatcher1)"
bash "$(rlocation __main__/acceptance/sig_short_exp_time/dispatcher2)"
bash "$(rlocation __main__/acceptance/sig_short_exp_time/sig1)"
bash "$(rlocation __main__/acceptance/sig_short_exp_time/sig2)"
bash go/tools/udpproxy/udpproxy --norun
bash acceptance/sig_short_exp_time/dispatcher1
bash acceptance/sig_short_exp_time/dispatcher2
bash acceptance/sig_short_exp_time/sig1
bash acceptance/sig_short_exp_time/sig2

docker-compose -f acceptance/sig_short_exp_time/docker-compose.yml up -d dispatcher1 dispatcher2 sig1 sig2 patha pathb

Expand Down

0 comments on commit 10ce4b7

Please sign in to comment.