mirror of
https://github.com/postalserver/postal.git
synced 2026-10-20 19:26:07 +00:00
chore: various tweaks to support running tests in the CI
This commit is contained in:
@@ -96,3 +96,21 @@ ifneq ($(DOCKER_TAG_VERSION),)
|
||||
"$(DOCKER_IMAGE):$(DOCKER_TAG_VERSION)" && \
|
||||
docker push "$(DOCKER_IMAGE):$(DOCKER_TAG_VERSION)"
|
||||
endif
|
||||
|
||||
# ==============================================================================
|
||||
# Tests
|
||||
# ==============================================================================
|
||||
|
||||
.PHONY: ci-test
|
||||
ci-test: docker-ci-build
|
||||
$(eval IMAGE := $(shell $(DOCKER_CI_BUILD_CMD) -q))
|
||||
$(eval RAND := $(shell echo "$${RANDOM}$$(date +%s)"))
|
||||
POSTAL_IMAGE=$(IMAGE) \
|
||||
docker-compose -p "postal$(RAND)" run --rm postal sh -c 'bundle exec rspec'; \
|
||||
EXIT_CODE=$$?; \
|
||||
docker-compose -p "postal$(RAND)" down -v; \
|
||||
exit $$EXIT_CODE
|
||||
|
||||
.PHONY: test
|
||||
test:
|
||||
bundle exec rspec
|
||||
|
||||
Reference in New Issue
Block a user