Skip to content
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

Allow testing q3c without having PostgreSQL headers installed #28

Merged
merged 1 commit into from
Oct 11, 2020

Conversation

df7cb
Copy link
Contributor

@df7cb df7cb commented Oct 10, 2020

Debian tries to run the testsuite on the installed packages with as few
extra dependencies as possible. This change allows compiling gen_data
and invoking "make test" without having postgresql-server-dev-*
installed.

@coveralls
Copy link

coveralls commented Oct 10, 2020

Coverage Status

Coverage remained the same at 94.898% when pulling ed02145 on credativ:test-without-postgres-headers into a068ef5 on segasai:master.

Copy link
Owner

@segasai segasai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks fine to me and passes all the CI tests. The only concern is the
typedef long long int64
I am reluctant to have that as that may not be correct on all platforms, and may result
in incorrect code.

@df7cb
Copy link
Contributor Author

df7cb commented Oct 10, 2020

It's probably better to use a proper C type, yes. For the Debian patch I wanted to keep the diff short. (It does pass the tests on 20 architectures here.) Will update the PR.

Debian tries to run the testsuite on the installed packages with as few
extra dependencies as possible. This change allows compiling gen_data
and invoking "make test" without having postgresql-server-dev-*
installed.
@df7cb df7cb force-pushed the test-without-postgres-headers branch from e51b8d5 to ed02145 Compare October 10, 2020 15:03
@df7cb
Copy link
Contributor Author

df7cb commented Oct 10, 2020

Fwiw I'm getting a regression diff on master which I think isn't my fault:

cat sql/ang2ipix.sql | psql q3c_test > results/ang2ipix.out
diff results/ang2ipix.out expected/ang2ipix.expected
111,113c111,113
<   sum   
< --------
<  643646
---
EXTENSION = q3c
>    sum   
> ---------
>  1000000
make: *** [Makefile:78: test] Error 1

@segasai segasai merged commit ac6eb90 into segasai:master Oct 11, 2020
@segasai
Copy link
Owner

segasai commented Oct 11, 2020

I've committed your PR, thanks.
Regarding the regression test, this is the recently added check that verifies that ang2ipix & ipix2ang are invertable.
What platform does it fail on ? Because on travis it seems to work fine.

@df7cb
Copy link
Contributor Author

df7cb commented Oct 11, 2020

Thanks for merging.

I'm seeing in on Debian bullseye (unstable should be the same) amd64 with PG13:

$ LANG=C make test
dropdb --if-exists q3c_test
createdb q3c_test
psql q3c_test -c "CREATE TABLE test (ra double precision, dec double precision)"
CREATE TABLE
psql q3c_test -c "CREATE TABLE test1 (ra double precision, dec double precision)"
CREATE TABLE
psql q3c_test -c "CREATE TABLE test_pm0 (ra double precision, dec double precision, pmra real, pmdec real, epoch real)"
CREATE TABLE
psql q3c_test -c "CREATE TABLE test_pm1 (ra double precision, dec double precision, pmra real, pmdec real, epoch real)"
CREATE TABLE
psql q3c_test -c "CREATE TABLE test_small (ra double precision, dec double precision)"
CREATE TABLE
./gen_data 1 1000000 | psql q3c_test -c "COPY test FROM STDIN WITH DELIMITER ' '"
COPY 1000000
./gen_data 2 1000000 | psql q3c_test -c "COPY test1 FROM STDIN WITH DELIMITER ' '"
COPY 1000000
./gen_data 3 100000 | psql q3c_test -c "COPY test_small FROM STDIN WITH DELIMITER ' '"
COPY 100000
./gen_data 4 1000000 --withpm --pmscale=0 --randomepoch | psql q3c_test -c "COPY test_pm0 FROM STDIN WITH DELIMITER ' '"
COPY 1000000
./gen_data 5 1000000 --withpm --pmscale=1000 --epoch=2015 | psql q3c_test -c "COPY test_pm1 FROM STDIN WITH DELIMITER ' '"
COPY 1000000
psql q3c_test -c 'CREATE EXTENSION q3c'
CREATE EXTENSION
psql q3c_test -c 'CREATE INDEX q3c_idx1 ON test1 (q3c_ang2ipix(ra,dec))'
CREATE INDEX
psql q3c_test -c 'CREATE INdex ON test_pm0 (q3c_ang2ipix(ra,dec))'
CREATE INDEX
psql q3c_test -c 'CREATE INDEX on test_pm1 (q3c_ang2ipix(ra,dec))'
CREATE INDEX
psql q3c_test -c 'CREATE INDEX q3c_idx ON test (q3c_ang2ipix(ra,dec))'
CREATE INDEX
psql q3c_test -c 'CREATE INDEX q3c_idx_small ON test_small (q3c_ang2ipix(ra,dec))'
CREATE INDEX
psql q3c_test -c 'ANALYZE test'
ANALYZE
psql q3c_test -c 'ANALYZE test1'
ANALYZE
psql q3c_test -c 'ANALYZE test_pm0'
ANALYZE
psql q3c_test -c 'ANALYZE test_pm1'
ANALYZE
psql q3c_test -c 'ANALYZE test_small'
ANALYZE
mkdir -p results
cat sql/ang2ipix.sql | psql q3c_test > results/ang2ipix.out
diff results/ang2ipix.out expected/ang2ipix.expected
111,113c111,113
<   sum   
< --------
<  643646
---
>    sum   
> ---------
>  1000000
make: *** [Makefile:72: test] Error 1
postgres=# select version();
                                                             version                                                             
---------------------------------------------------------------------------------------------------------------------------------
 PostgreSQL 13.0 (Debian 13.0-3~841.git0dd6746.pgdg+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.0-13) 10.2.0, 64-bit

@segasai
Copy link
Owner

segasai commented Oct 12, 2020

Thanks, do you think you could run this query for me

select ra,dec, q3c_ang2ipix(ra,dec), (q3c_ipix2ang(q3c_ang2ipix(ra,dec)))[1], (q3c_ipix2ang(q3c_ang2ipix(ra,dec)))[2] from test
where q3c_ang2ipix(((q3c_ipix2ang(q3c_ang2ipix(ra,dec)))[1]),(q3c_ipix2ang(q3c_ang2ipix(ra,dec)))[2])!=q3c_ang2ipix(ra,dec));

to understand what's going on. I don't see anything on travis, so that's the only thing that can help.

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.

3 participants