File: bazel.mk

package info (click to toggle)
rabbitmq-server 4.0.5-10
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 38,056 kB
  • sloc: erlang: 257,826; javascript: 22,466; sh: 3,037; makefile: 2,517; python: 1,966; xml: 646; cs: 335; java: 244; ruby: 212; php: 100; perl: 63; awk: 13
file content (42 lines) | stat: -rw-r--r-- 1,509 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
BAZELISK ?= /usr/local/bin/bazelisk
ifeq (darwin,$(PLATFORM))
$(BAZELISK):
	brew install bazelisk
else
$(BAZELISK):
	$(error Install bazelisk for your platform: https://github.com/bazelbuild/bazelisk)
endif

define USER_BAZELRC
build --@rules_erlang//:erlang_home=$(shell dirname $$(dirname $$(which erl)))
build --@rules_erlang//:erlang_version=$(shell erl -eval '{ok, Version} = file:read_file(filename:join([code:root_dir(), "releases", erlang:system_info(otp_release), "OTP_VERSION"])), io:fwrite(Version), halt().' -noshell)
build --//:elixir_home=$(shell dirname $$(dirname $$(which iex)))/lib/elixir

# rabbitmqctl wait shells out to 'ps', which is broken in the bazel macOS
# sandbox (https://github.com/bazelbuild/bazel/issues/7448)
# adding "--spawn_strategy=local" to the invocation is a workaround
build --spawn_strategy=local

build --incompatible_strict_action_env

# run one test at a time on the local machine
build --test_strategy=exclusive

# don't re-run flakes automatically on the local machine
build --flaky_test_attempts=1

build:buildbuddy --remote_header=x-buildbuddy-api-key=YOUR_API_KEY
endef

user.bazelrc: export USER_BAZELRC
user.bazelrc:
	echo "$$USER_BAZELRC" > $@

bazel-test: $(BAZELISK) | user.bazelrc
ifeq ($(DEP),)
	$(error DEP must be set to the dependency that this test is for, e.g. deps/rabbit)
endif
ifeq ($(SUITE),)
	$(error SUITE must be set to the ct suite to run, e.g. queue_type if DEP=deps/rabbit)
endif
	$(BAZELISK) test //deps/$(notdir $(DEP)):$(SUITE)_SUITE