Skip to content

Commit 1adcdde

Browse files
committed
Restore deleted snaps after make feature_%
I've been runnning `make feature_ta_task_validate_image` and `make feature_task_validate_image` frequently and I'm tired of restoring the deleted snaps manually. Maybe there's another way to do this, but I don't want to go looking under the hood with the snapshot update mechanisms. Minor convenience tweak while working on... Ref: https://issues.redhat.com/browse/EC-1652
1 parent 368c075 commit 1adcdde

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,17 @@ focus-acceptance: build ## Run acceptance tests with @focus tag
144144
# The `|| true` here is so the @focus tag still gets removed after a failure.
145145
feature_%: ## Run acceptance tests for a single feature file, e.g. make feature_validate_image
146146
@echo "Testing feature '$*'"
147+
@#
147148
@sed -i '1i@focus' features/$*.feature
148149
@$(MAKE) focus-acceptance || true
150+
@#
151+
@# Remove @focus tag
149152
@sed -i '1d' features/$*.feature
153+
@#
154+
@# With UPDATE_SNAPS=true all the other snap files will be deleted. Let's put them back.
155+
@if [ -n "$$UPDATE_SNAPS" ]; then \
156+
git ls-files 'features/__snapshots__/*.snap' --deleted | xargs git checkout; \
157+
fi
150158

151159
# (Replace spaces with underscores in the scenario name.)
152160
scenario_%: build ## Run acceptance tests for a single scenario, e.g. make scenario_inline_policy

0 commit comments

Comments
 (0)