postgrespro / pgsphere

PgSphere provides spherical data types, functions, operators, and indexing for PostgreSQL.
https://pgsphere.org
BSD 3-Clause "New" or "Revised" License
16 stars 15 forks source link

Improve init_test #54

Closed vitcpp closed 3 months ago

vitcpp commented 10 months ago

Dear All,

What is the purpose of init_test? Do we really need it? This test introduces some difficulties when working with PRs. It is executed when executing gmake test, but gmake installcheck doesn't execute this test.

I propose to remove it.

esabol commented 10 months ago

I'm not sure what the intention was.

If you do remove it, would gmake test just be an alias for gmake installcheck?

vitcpp commented 10 months ago

@esabol There is the difference between test and installcheck rules. gmake installcheck runs tests on the existing installation. gmake test creates a local installation, runs postgresql instance and executes tests on it. These rules play different roles. What I think is to support gmake check to make consistent with the postgresql project tree.

esabol commented 10 months ago

There is the difference between test and installcheck rules. gmake installcheck runs tests on the existing installation. gmake test creates a local installation, runs postgresql instance and executes tests on it. These rules play different roles.

Yes, I knew that, or I thought so anyway. What I meant was the intention of init_test.sql specifically.

vitcpp commented 10 months ago

I think, the init_test goal is to find problems in pgs_xxx.sql files that are used to initialize the extension. This test creates a single file pg_sphere.test.sql from the contents of pgs_xxx.sql files with some changes (MODULE_PATH is replaced with the absolute path to local pg_sphere.so) and then runs the file as a regular test. If a problem exists, it can be detected by the test output difference after test execution. I think this test is reasonable because it may help developers to detect some problems with newly created functionality as well as when migrating to newer versions of Postgresql. Anyway, it should be improved to avoid expected/init_test.out conflicts when touching independent pgs_xxx.sql files.

df7cb commented 8 months ago

I think this issue has already been addressed by #79.

esabol commented 3 months ago

Close this issue, @vitcpp ?

vitcpp commented 3 months ago

@esabol Yes, thank you. I will close the issue.

vitcpp commented 3 months ago

Closed as completed in #79.