Skip to content

Commit

Permalink
ci: add chartsnap for gateway-operator chart (#1216)
Browse files Browse the repository at this point in the history
  • Loading branch information
pmalek authored Jan 15, 2025
1 parent e7c4708 commit c770e5a
Show file tree
Hide file tree
Showing 9 changed files with 5,644 additions and 17 deletions.
1 change: 1 addition & 0 deletions .github/workflows/release-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ jobs:
helm repo add kong https://charts.konghq.com
helm dependency build charts/kong
helm dependency build charts/ingress
helm dependency build charts/gateway-operator
- name: run golden tests
run: make test.golden
Expand Down
34 changes: 17 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,18 @@ lint.shellcheck: shellcheck

.PHONY: test.golden
test.golden:
@ $(MAKE) _chartsnap.kong && $(MAKE) _chartsnap.ingress || \
@ \
$(MAKE) _chartsnap CHART=kong && \
$(MAKE) _chartsnap CHART=ingress && \
$(MAKE) _chartsnap CHART=gateway-operator || \
(echo "$$GOLDEN_TEST_FAILURE_MSG" && exit 1)

.PHONY: test.golden.update
test.golden.update:
@ $(MAKE) _chartsnap.kong CHARTSNAP_ARGS="-u"
@ $(MAKE) _chartsnap.ingress CHARTSNAP_ARGS="-u"
helm repo update kong
@ $(MAKE) _chartsnap CHART=kong CHARTSNAP_ARGS="-u"
@ $(MAKE) _chartsnap CHART=ingress CHARTSNAP_ARGS="-u"
@ $(MAKE) _chartsnap CHART=gateway-operator CHARTSNAP_ARGS="-u"

# Defining multi-line strings to echo: https://stackoverflow.com/a/649462/7958339
define GOLDEN_TEST_FAILURE_MSG
Expand All @@ -70,18 +75,13 @@ define GOLDEN_TEST_FAILURE_MSG
endef
export GOLDEN_TEST_FAILURE_MSG

.PHONY: _chartsnap.kong
_chartsnap.kong:
@ $(MAKE) _chartsnap GOLDEN_TEST_CHART=kong GOLDEN_TEST_CHART_VALUES_DIR=./charts/kong/ci/ \
CHARTSNAP_ARGS=$(CHARTSNAP_ARGS)

.PHONY: _chartsnap.ingress
_chartsnap.ingress:
@ $(MAKE) _chartsnap GOLDEN_TEST_CHART=ingress GOLDEN_TEST_CHART_VALUES_DIR=./charts/ingress/ci/ \
CHARTSNAP_ARGS=$(CHARTSNAP_ARGS)

.PHONY: _chartsnap
_chartsnap: chartsnap
@ helm repo update kong
@ helm dependencies update charts/ingress
@ helm chartsnap -c ./charts/$(GOLDEN_TEST_CHART) -f $(GOLDEN_TEST_CHART_VALUES_DIR) $(CHARTSNAP_ARGS)
.PHONY: _chartsnap
_chartsnap: _chartsnap.deps
helm chartsnap -c ./charts/$(CHART) -f ./charts/$(CHART)/ci/ $(CHARTSNAP_ARGS)

.PHONY: _chartsnap.deps
_chartsnap.deps: chartsnap
@ if [ "$(CHART)" = "kong" ]; then \
helm dependencies update charts/ingress; \
fi
Loading

0 comments on commit c770e5a

Please sign in to comment.