Skip to content

Add auto_import test for IMPORT FOREIGN TABLE and test sequence refactoring #116

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Apr 4, 2025

Conversation

mkgrgis
Copy link
Contributor

@mkgrgis mkgrgis commented Mar 26, 2025

In this PR there are absolutely no C code changes.
Content of PR:

  • Add auto_import test which shows behavior of IMPORT FOREIGN TABLE command according PostgreSQL internal metadata state.
  • Refactor test sequence to different variables - data type test, tests with different results depends on GIS compilation mode, main sequence.
  • Reduce DROP ... CASCADE outputs in type tests for both GIS and not GIS modes.

@mkgrgis mkgrgis changed the title Add auto_import test for IMPORT FOREIGN TABLE Add auto_import test for IMPORT FOREIGN TABLE and test sequence refactoring Mar 26, 2025
Co-authored-by: mkgrgis <mihail.aksenov@bk.ru>

Switch to more detailed SQLite error codes

Fix PostGIS text

Errcode reimplement

Add new implementation

Fix PostGIS results

Improve error message according SQLite documentation

Add `auto_import` test for `IMPORT FOREIGN TABLE`
@lamdn1409
Copy link
Contributor

@mkgrgis Can we start reviewing this PR?

@mkgrgis
Copy link
Contributor Author

mkgrgis commented Mar 28, 2025

@mkgrgis Can we start reviewing this PR?

Yes. There is and there was normal check status yesterday.

@lamdn1409
Copy link
Contributor

lamdn1409 commented Mar 28, 2025

@mkgrgis I think there are 03 different purposes in this PR.

  1. Add auto_import test which shows behavior of IMPORT FOREIGN TABLE command according PostgreSQL internal metadata state.
  2. Refactor test sequence to different variables - data type test, tests with different results depends on GIS compilation mode, main sequence. Reduce DROP ... CASCADE outputs in type tests for both GIS and not GIS modes.
  3. Prepare some SQLITE_FOR_TESTING_DIR environment variable infrastructure.

The third purpose is the fix of SQLite CI issue (#114). If correct, please remove related changes.

ifdef SQLITE_FOR_TESTING_DIR
SHLIB_LINK := -L$(SQLITE_FOR_TESTING_DIR)/lib -lsqlite3
PG_CFLAGS += -I$(SQLITE_FOR_TESTING_DIR)/include -Wl,-rpath,$(SQLITE_FOR_TESTING_DIR)/lib
else
SHLIB_LINK := -lsqlite3

Could you create separated PRs for 1) and 2)?

@mkgrgis
Copy link
Contributor Author

mkgrgis commented Mar 28, 2025

If correct, please remove related changes.

Done in 4b67cfe , please verify.

Could you create separated PRs for 1) and 2)?

I thinks this is very atomic and bureaucracy-related. 2) touches only 2 files and this is transparent change near REGRESS variable value. Both 1) and 2) are about extending of actual testing. Also "reduce DROP ... CASCADE outputs" is about new group of tests organized after auto_import test addition as next version of previous type_postgis and type_nogis tests. Hence 1) and 2) have internal dependency and common purpose.

@mkgrgis mkgrgis requested a review from lamdn1409 March 28, 2025 09:55
@mkgrgis mkgrgis requested a review from lamdn1409 March 31, 2025 06:30
@mkgrgis
Copy link
Contributor Author

mkgrgis commented Mar 31, 2025

@lamdn1409 , please recheck all our conversations. Look like we have no other to discuss now expect for #116 (comment) Isn't it?

@mkgrgis
Copy link
Contributor Author

mkgrgis commented Mar 31, 2025

@lamdn1409 , I cannot due github technical restrictions answer under #116 (comment) , is now no problems in mentioned place?

@lamdn1409
Copy link
Contributor

ifdef ENABLE_GIS
PG_CFLAGS += -DSQLITE_FDW_GIS_ENABLE
GIS_TEST = postgis
GIS_DEP_TESTS_DIR = with_gis_support
$(info  There is PostGIS support for SQLite FDW)
else
GIS_TEST = nogis
GIS_DEP_TESTS_DIR = without_gis_support
$(info  There is NO PostGIS support for SQLite FDW)
endif

postgis.sql is tested if gis is enabled.
nogis.sql is tested if gis is disabled.
So, I think you can move these tests to appropriate folders.

@mkgrgis
Copy link
Contributor Author

mkgrgis commented Mar 31, 2025

So, I think you can move these tests to appropriate folders.

Moved in 5ad4e56, please recheck.

@mkgrgis
Copy link
Contributor Author

mkgrgis commented Mar 31, 2025

@lamdn1409, we have successfully tests now. Does it means time to 2nd review round or start merge review?

@lamdn1409
Copy link
Contributor

@mkgrgis Thank you for resolving my comments. I have no more comments. Could you please request @t-kataym to review?

@mkgrgis
Copy link
Contributor Author

mkgrgis commented Mar 31, 2025

@t-kataym , this PR is ready for pre-merge review. Could you please observe proposed changes?

@t-kataym
Copy link
Contributor

t-kataym commented Apr 3, 2025

@t-hiroshige Please check it.
@mkgrgis The maintainer of this repository has been changed from me to @t-hiroshige.
I really appreciate your contributions so far. From the next, please contact to him if necessary.

@t-hiroshige
Copy link
Contributor

OK, I confirmed.
I'll merge this PR soon.

@t-hiroshige
Copy link
Contributor

@mkgrgis Thank you for creating the PR.
@lamdn1409 Thank you for your review.

@t-hiroshige t-hiroshige merged commit 0f002c9 into pgspider:master Apr 4, 2025
11 checks passed
@mkgrgis
Copy link
Contributor Author

mkgrgis commented Apr 5, 2025

Thanks, @t-hiroshige !

Thanks, @t-kataym ! I was happy to work with you. You was my 1st teacher in C-language culture, @t-kataym - san, ありがとう !

@mkgrgis
Copy link
Contributor Author

mkgrgis commented Apr 5, 2025

@t-hiroshige , you have forgotten to squash small transitive review commits before merging. Usually PR with more than 3-4 inner commits are merged only as squashed. Now we have very detailed upstream commit tree https://github.com/pgspider/sqlite_fdw/commits/master/

You can fix this and squash all changes after 8f7f4f4 by follow algorithm:

  1. Save/copy current correct content expect for .git to any temporary directory
  2. git rebase -i HEAD~1 where set s for all commits after first and p or pick for first commit.
  3. Delete all content of cloned repository after content conflict, put saved correct content instead of deleted.
  4. git commit with current message

Add auto_import test for IMPORT FOREIGN TABLE and test sequence refactoring #116

  1. git push --force

I am sorry, I haven't warned you about this case.

Then I'll quickly rebase all of my PRs, this will not hard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants