Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions HISTORY.asc
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
STABLE
------
== Bug fixes

=== Fix targets that ignored a failure partway through a loop
Several targets run one command per file or per extension, and a failure
partway through was ignored. They now fail as soon as any one
command fails:

* `make pgtle` exited 0 if `pgtle.sh` failed for any extension other than
the last one.
* `make results` exited 0 if copying any `test/results/*.out` file other
than the last one into `test/expected/` failed.
* `make results-build` exited 0 if copying any file into
`test/build/expected/` failed, including the last one.
* `make print-pgtle` exited 0 if reading the generated SQL for any
extension other than the last one failed.
* With `PGXNTOOL_ENABLE_TEST_INSTALL=yes`, a failed write to
`test/install/schedule` for any file other than the last one left an
incomplete schedule without an error.

Issues fixed in this release: #140

2.4.0
-----
== Breaking changes
Expand Down
13 changes: 7 additions & 6 deletions base.mk
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ REGRESS_OPTS += --schedule=$(_PGXNTOOL_INSTALL_SCHEDULE)
$(_PGXNTOOL_INSTALL_SCHEDULE):
@echo "# Auto-generated - DO NOT EDIT" > $@
@for f in $(notdir $(basename $(TEST_INSTALL_SQL_FILES))); do \
echo "test: ../install/$$f" >> $@; \
echo "test: ../install/$$f" >> $@ || exit 1; \
done

installcheck: $(_PGXNTOOL_INSTALL_SCHEDULE)
Expand Down Expand Up @@ -579,7 +579,7 @@ endif
@mkdir -p $(TESTDIR)/expected
@for f in $(TESTOUT)/results/*.out; do \
[ -f "$$f" ] || continue; \
cp "$$f" $(TESTDIR)/expected/$$(basename "$$f"); \
cp "$$f" $(TESTDIR)/expected/$$(basename "$$f") || exit 1; \
done

# testdeps is a generic dependency target that you can add targets to
Expand All @@ -605,8 +605,9 @@ _PGXNTOOL_EXTENSIONS = $(basename $(_PGXNTOOL_CONTROL_FILES))
# with this variable silently instead of erroring.
.PHONY: pgtle
pgtle: all control.mk $(_PGXNTOOL_CONTROL_FILES)
@$(foreach ext,$(_PGXNTOOL_EXTENSIONS),\
$(PGXNTOOL_DIR)/pgtle.sh --extension $(ext) $(if $(PGXNTOOL_PGTLE_VERSION),--pgtle-version $(PGXNTOOL_PGTLE_VERSION));)
@for ext in $(_PGXNTOOL_EXTENSIONS); do \
$(PGXNTOOL_DIR)/pgtle.sh --extension $$ext $(if $(PGXNTOOL_PGTLE_VERSION),--pgtle-version $(PGXNTOOL_PGTLE_VERSION)) || exit 1; \
done

#
# pg_tle installation support
Expand Down Expand Up @@ -670,7 +671,7 @@ print-pgtle: pgtle
echo "ERROR: $$f does not exist (run 'make pgtle' first)" >&2; \
exit 1; \
fi; \
cat "$$f";)
cat "$$f" || exit 1;)

# These targets ensure all the relevant directories exist
$(TESTDIR)/sql/ $(TESTDIR)/expected/ $(TESTOUT)/results/:
Expand Down Expand Up @@ -779,7 +780,7 @@ results-build:
echo " cp $$f $(TESTDIR)/build/expected/$$(basename "$$f")" >&2; \
skipped=1; continue; \
fi; \
cp "$$f" $(TESTDIR)/build/expected/$$(basename "$$f"); \
cp "$$f" $(TESTDIR)/build/expected/$$(basename "$$f") || exit 1; \
done; \
[ "$$skipped" = 0 ] || exit 1
endif
Expand Down
Loading