From cfc863a734e9cf675542802de31ba6ef5dd02e00 Mon Sep 17 00:00:00 2001
From: "Antoine R. Dumont (@ardumont)" <ardumont@softwareheritage.org>
Date: Fri, 10 Mar 2023 10:44:11 +0100
Subject: [PATCH] Makefile: Introduce makefile to ease testing

Refs. swh/infra/sysadm-environment#4794
---
 Makefile | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
 create mode 100644 Makefile

diff --git a/Makefile b/Makefile
new file mode 100644
index 000000000..cfc8fdf8b
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,16 @@
+IMAGE="helmunittest/helm-unittest:3.11.1-0.3.0"
+# requires --user in the docker call to allow writing in the user's home
+UID=1000
+# This allows to introspect the swh/tests/__snapshot__/<generated-chart>.yaml
+# output of the chart execution in the test context. It's in a dedicated
+# target as this generates temporary files. This is to be used exceptionally
+# to ease troubleshooting
+ACTIVATE_SNAPSHOT=--update-snapshot
+
+test:
+	docker run -ti --user $(UID) --rm -v $(PWD):/apps \
+	  $(IMAGE) swh
+
+test-with-snapshot:
+	docker run -ti --user $(UID) --rm -v $(PWD):/apps \
+	  $(IMAGE) $(ACTIVATE_SNAPSHOT) swh
-- 
GitLab