Skip to content

Missing auto-created expected files for .source tests #8

@jnasbyupgrade

Description

@jnasbyupgrade

Problem

pgxntool auto-creates empty test/expected/*.out files for test/sql/*.sql files via a touch rule (base.mk:372-373). But this doesn't cover tests that come from .source files (test/input/*.source).

The .source workflow:

  1. User creates test/input/foo.source
  2. pg_regress converts it to test/sql/foo.sql at runtime
  3. pg_regress needs test/expected/foo.out to diff against

Since test/sql/foo.sql doesn't exist when Make evaluates wildcards, the touch rule never fires for it. pg_regress aborts because it can't find the expected file.

TEST__SOURCE__EXPECTED_FILES (base.mk:64) exists but only covers the case where users also provide test/output/*.source. If a user has test/input/*.source without a corresponding test/output/*.source, the expected file is never created.

Current workaround

The install persistence test manually touches the file:

touch test/expected/pgxntool-test.out

Fix

Add a touch rule for .source-derived expected files:

TEST__SOURCE__RESULT_FILES = $(patsubst $(TESTDIR)/input/%.source,$(TESTDIR)/expected/%.out,$(TEST__SOURCE__INPUT_FILES))
$(TEST__SOURCE__RESULT_FILES): | $(TESTDIR)/expected/
	@touch $@

And add $(TEST__SOURCE__RESULT_FILES) to the installcheck prerequisites.

Ref: https://github.com/Postgres-Extensions/pgxntool-test/pull/7/files#diff-94df59c75ccd1d8edf305cc2d63981f309dfb4c74037a647b83f4e9d4b002ba5R48

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions