qwat / qwat-data-model

TEKSI Water module (project QWAT) - PostgreSQL / postgis Datamodel
https://www.teksi.ch
23 stars 24 forks source link

Tests fail if played more than once #223

Open lbartoletti opened 6 years ago

lbartoletti commented 6 years ago

First time

⇒  ./tests/tests.sh
PUM version: pum version 0.5.9

CREATE EXTENSION
CREATE EXTENSION
ERROR:  schema "qwat_sys" already exists
/home/Loic/prog/Oslandia/data-model
Running test_add_node.sql ... OK
Running test_node_orientation.sql ... OK
Running test_valve_orientation.sql ... OK
Running test_altitude.sql ... OK
Running test_alternative_geometry.sql ... OK
Running test_move_node_end_pipe.sql ... OK
Running test_scenarii.sql ... OK

Second time

⇒  ./tests/tests.sh
PUM version: pum version 0.5.9

CREATE EXTENSION
CREATE EXTENSION
ERROR:  schema "qwat_sys" already exists
/XXX/data-model
Running test_add_node.sql ... Error
--- /tmp/test_add_node.sql.txt  2018-02-12 14:37:17.781147000 +0100
+++ /XXX/data-model/tests/test_add_node.expected.sql       2018-02-12 14:29:13.479946000 +0100
@@ -1,6 +1,5 @@
 INSERT 0 1
-psql:/XXX/data-model/tests/test_add_node.sql:5: ERROR:  duplicate key value violates unique constraint "district_pkey"
-DÉTAIL : Key (id)=(1) already exists.
+INSERT 0 1
 INSERT 0 1
 INSERT 0 1
 INSERT 0 1
OK
Running test_node_orientation.sql ... OK
Running test_valve_orientation.sql ... OK
Running test_altitude.sql ... OK
Running test_alternative_geometry.sql ... OK
Running test_move_node_end_pipe.sql ... OK
Running test_scenarii.sql ... Error
--- /tmp/test_scenarii.sql.txt  2018-02-12 14:37:19.162414000 +0100
+++ /XXX/data-model/tests/test_scenarii.expected.sql       2018-02-12 14:29:13.480751000 +0100
@@ -8,8 +8,7 @@
 UPDATE 1
 INSERT 0 1
 INSERT 0 1
-psql:/XXX/data-model/tests/test_scenarii.sql:49: ERROR:  duplicate key value violates unique constraint "vl_part_type_pk"
-DÉTAIL : Key (id)=(999) already exists.
+INSERT 0 1
 INSERT 0 1
 INSERT 0 1
 INSERT 0 1
OK
sylvainbeo commented 6 years ago

Yes. This is related to https://github.com/opengisch/pum/issues/12

sylvainbeo commented 6 years ago

We need to add the DROP and CREATE in the tests script

ponceta commented 6 years ago

That's one of the reasons I asked to include CREATE and DROP mechanisms into PUM.

https://github.com/opengisch/pum/issues/16

sylvainbeo commented 6 years ago

@ponceta The DB are not created by PUM, so it should not be PUM to drop these.

ponceta commented 6 years ago

@sylvainbeo I agree on that point, what is it not created by PUM should not be dropped by PUM. But qwat_test and qwat_comp are PUM required DBs which are created manually or by external scripting.

pum does not work without these two db...

(pum evol -> https://github.com/opengisch/pum/issues/25)