Skip to content

Commit

Permalink
Regression tests: test against no files
Browse files Browse the repository at this point in the history
  • Loading branch information
cytopia committed Jul 6, 2019
1 parent b80a2e9 commit e61c38d
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ifneq (,)
.error This Makefile requires GNU Make.
endif

.PHONY: build rebuild lint test _test-tf-version _test-fmt-ok _test-fmt-fail tag pull login push enter
.PHONY: build rebuild lint test _test-tf-version _test-fmt-ok _test-fmt-none _test-fmt-fail tag pull login push enter

CURRENT_DIR = $(dir $(abspath $(lastword $(MAKEFILE_LIST))))

Expand All @@ -28,6 +28,7 @@ lint:
test:
@$(MAKE) --no-print-directory _test-tf-version
@$(MAKE) --no-print-directory _test-fmt-ok
@$(MAKE) --no-print-directory _test-fmt-none
@$(MAKE) --no-print-directory _test-fmt-fail

_test-tf-version:
Expand Down Expand Up @@ -84,6 +85,24 @@ _test-fmt-ok:
fi; \
echo "Success";

_test-fmt-none:
@echo "------------------------------------------------------------"
@echo "- Testing terragrunt-fmt (NONE) [recursive]"
@echo "------------------------------------------------------------"
@if ! docker run --rm -v $(CURRENT_DIR)/data:/data $(IMAGE) -write=false -list=true -check -diff -recursive; then \
echo "Failed"; \
exit 1; \
fi; \
echo "Success";
@echo "------------------------------------------------------------"
@echo "- Testing terragrunt-fmt (NONE) [dir]"
@echo "------------------------------------------------------------"
@if ! docker run --rm -v $(CURRENT_DIR)/data:/data $(IMAGE) -write=false -list=true -check -diff; then \
echo "Failed"; \
exit 1; \
fi; \
echo "Success";

_test-fmt-fail:
@echo "------------------------------------------------------------"
@echo "- Testing terragrunt-fmt (FAIL) [recursive]"
Expand Down

0 comments on commit e61c38d

Please sign in to comment.