qwat-data-model icon indicating copy to clipboard operation
qwat-data-model copied to clipboard

Tests fail if played more than once

Open lbartoletti opened this issue 7 years ago • 5 comments

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

lbartoletti avatar Feb 12 '18 14:02 lbartoletti

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

sylvainbeo avatar Feb 21 '18 08:02 sylvainbeo

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

sylvainbeo avatar Feb 22 '18 08:02 sylvainbeo

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

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

ponceta avatar Feb 23 '18 08:02 ponceta

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

sylvainbeo avatar Feb 23 '18 12:02 sylvainbeo

@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)

ponceta avatar Apr 13 '18 07:04 ponceta