Moved sql and test files

This commit is contained in:
Andrew Kane
2021-05-05 15:04:52 -07:00
parent f0993282fe
commit baabbaeff9
26 changed files with 25 additions and 13 deletions

View File

@@ -18,7 +18,7 @@
}, },
"provides": { "provides": {
"vector": { "vector": {
"file": "vector--0.1.1.sql", "file": "sql/vector--0.1.1.sql",
"docfile": "README.md", "docfile": "README.md",
"version": "0.1.2", "version": "0.1.2",
"abstract": "Open-source vector similarity search for Postgres" "abstract": "Open-source vector similarity search for Postgres"

View File

@@ -1,11 +1,12 @@
EXTENSION = vector EXTENSION = vector
DATA = vector--0.1.1.sql vector--0.1.0--0.1.1.sql DATA = sql/vector--0.1.1.sql sql/vector--0.1.0--0.1.1.sql
MODULE_big = vector MODULE_big = vector
OBJS = src/ivfbuild.o src/ivfflat.o src/ivfinsert.o src/ivfkmeans.o src/ivfscan.o src/ivfutils.o src/ivfvacuum.o src/vector.o OBJS = src/ivfbuild.o src/ivfflat.o src/ivfinsert.o src/ivfkmeans.o src/ivfscan.o src/ivfutils.o src/ivfvacuum.o src/vector.o
TESTS = $(wildcard sql/*.sql) TESTS = $(wildcard test/sql/*.sql)
REGRESS = btree cast copy functions ivfflat_cosine ivfflat_ip ivfflat_l2 ivfflat_unlogged vector REGRESS = $(patsubst test/sql/%.sql,%,$(TESTS))
REGRESS_OPTS = --inputdir=test
OPTFLAGS = -march=native OPTFLAGS = -march=native
@@ -26,7 +27,7 @@ include $(PGXS)
prove_installcheck: prove_installcheck:
rm -rf $(CURDIR)/tmp_check rm -rf $(CURDIR)/tmp_check
cd $(srcdir) && TESTDIR='$(CURDIR)' PATH="$(bindir):$$PATH" PGPORT='6$(DEF_PGPORT)' PG_REGRESS='$(top_builddir)/src/test/regress/pg_regress' $(PROVE) $(PG_PROVE_FLAGS) $(PROVE_FLAGS) $(if $(PROVE_TESTS),$(PROVE_TESTS),t/*.pl) cd $(srcdir) && TESTDIR='$(CURDIR)' PATH="$(bindir):$$PATH" PGPORT='6$(DEF_PGPORT)' PG_REGRESS='$(top_builddir)/src/test/regress/pg_regress' $(PROVE) $(PG_PROVE_FLAGS) $(PROVE_FLAGS) $(if $(PROVE_TESTS),$(PROVE_TESTS),test/t/*.pl)
.PHONY: dist .PHONY: dist

View File

@@ -214,16 +214,10 @@ make prove_installcheck # TAP tests
To run single tests: To run single tests:
```sh ```sh
make installcheck REGRESS=vector # regression test make installcheck REGRESS=vector # regression test
make prove_installcheck PROVE_TESTS=t/001_wal.pl # TAP test make prove_installcheck PROVE_TESTS=test/t/001_wal.pl # TAP test
``` ```
Directories
- `expected` - expected output for regression tests
- `sql` - regression tests
- `t` - TAP tests
Resources for contributors Resources for contributors
- [Extension Building Infrastructure](https://www.postgresql.org/docs/current/extend-pgxs.html) - [Extension Building Infrastructure](https://www.postgresql.org/docs/current/extend-pgxs.html)

View File

@@ -0,0 +1,17 @@
SET client_min_messages = warning;
CREATE EXTENSION IF NOT EXISTS vector;
SET enable_seqscan = off;
CREATE TABLE t (val vector(3));
CREATE INDEX ON t USING ivfflat (val) WITH (lists = 0);
ERROR: value 0 out of bounds for option "lists"
DETAIL: Valid values are between "1" and "32768".
CREATE INDEX ON t USING ivfflat (val) WITH (lists = 32769);
ERROR: value 32769 out of bounds for option "lists"
DETAIL: Valid values are between "1" and "32768".
SHOW ivfflat.probes;
ivfflat.probes
----------------
1
(1 row)
DROP TABLE t;