-
Notifications
You must be signed in to change notification settings - Fork 63
/
Makefile
31 lines (22 loc) · 949 Bytes
/
Makefile
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
# Support development with Docker to minimize host software requirements.
.PHONY : docker-image test
default : test
# If the Gemfile is changed, the Gemfile.lock should be updated.
Gemfile.lock : Gemfile
docker run --rm -v "$$(pwd)":/usr/src/app -w /usr/src/app ruby:3.0 bundle install
DOCKER_IMAGE = hiptest/hiptest-publisher
docker-image :
docker build -t $(DOCKER_IMAGE) .
DOCKER_RUN_TEST=docker run --interactive --tty --user $$UID --rm \
--workdir "/usr/src/app" --entrypoint bundle $(DOCKER_IMAGE) exec rspec
test : docker-image
$(DOCKER_RUN_TEST)
# Create targets for running individual spec files.
SPEC_FILES=$(wildcard spec/*_spec.rb) $(wildcard spec/*/*_spec.rb)
SPECS=$(patsubst spec/%_spec.rb,%,$(SPEC_FILES))
SPEC_TESTS=$(patsubst %,test/%,$(SPECS))
.PHONY : $(SPEC_TESTS)
$(SPEC_TESTS) : test/% : spec/%_spec.rb docker-image
$(DOCKER_RUN_TEST) --format documentation $<
.PHONY : test-verbose
test-verbose : $(SPEC_TESTS)