Skip to content

Issue tbd wrap pg proc test functions #2805

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

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
40fd248
(pgtap) creating function to check types
cvvergara Mar 31, 2025
3424fe8
(pgtap/tools) using new functions on tools files
cvvergara Mar 31, 2025
722adf8
(allpairs) (pgtap) Using function_types_(eq|has)
cvvergara Mar 31, 2025
dcf554e
(alpha_shape) (pgtap) Using function_types_(eq|has)
cvvergara Mar 31, 2025
d576bf0
(bdDijkstra) (pgtap) Using function_types_(eq|has)
cvvergara Mar 31, 2025
c35d0d9
(bellman_ford) (pgtap) Using function_types_(eq|has)
cvvergara Mar 31, 2025
7bbc259
(chinese) (pgtap) Using function_types_(eq|has)
cvvergara Mar 31, 2025
a6de8e9
(circuits) (pgtap) Using function_types_(eq|has)
cvvergara Mar 31, 2025
a3b448f
(coloring) (pgtap) Using function_types_(eq|has)
cvvergara Mar 31, 2025
6897a91
(components) (pgtap) Using function_types_(eq|has)
cvvergara Mar 31, 2025
26c2a4d
(contraction) (pgtap) Using function_types_(eq|has)
cvvergara Mar 31, 2025
6a0ded0
(dijkstra) (pgtap) Using function_types_(eq|has)
cvvergara Mar 31, 2025
fb52508
(dominator) (pgtap) Using function_types_(eq|has)
cvvergara Mar 31, 2025
409aec3
(ksp) (pgtap) Using function_types_(eq|has)
cvvergara Mar 31, 2025
21236ec
(lineGraph) (pgtap) Using function_types_(eq|has)
cvvergara Mar 31, 2025
51ca4cf
(max_flow) (pgtap) Using function_types_(eq|has)
cvvergara Mar 31, 2025
db9306f
(metrics) (pgtap) Using function_types_(eq|has)
cvvergara Mar 31, 2025
b5c4465
(mincut) (pgtap) Using function_types_(eq|has)
cvvergara Mar 31, 2025
a9c9804
(ordering) (pgtap) Using function_types_(eq|has)
cvvergara Mar 31, 2025
938ac04
(pickDeliver) (pgtap) Using function_types_(eq|has)
cvvergara Mar 31, 2025
153cffd
(topology) (pgtap) Using function_types_(eq|has)
cvvergara Mar 31, 2025
2172db2
(transitiveClosure) (pgtap) Using function_types_(eq|has)
cvvergara Mar 31, 2025
d3901b2
(traversal) (pgtap) Using function_types_(eq|has)
cvvergara Mar 31, 2025
70a3ecc
(trsp) (pgtap) Using function_types_(eq|has)
cvvergara Mar 31, 2025
8170456
(utilities) (pgtap) Using function_types_(eq|has)
cvvergara Mar 31, 2025
360d07b
(version) (pgtap) Using function_types_(eq|has)
cvvergara Mar 31, 2025
d7c6ded
(vrp_basic) (pgtap) Using function_types_(eq|has)
cvvergara Mar 31, 2025
f5914f9
(withPoints) (pgtap) Using function_types_(eq|has)
cvvergara Mar 31, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions pgtap/allpairs/floydWarshall/types_check.pg
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@ SELECT set_eq(
('{"","directed","start_vid","end_vid","agg_cost"}'::TEXT[])
$$);

SELECT set_eq(
$$SELECT proallargtypes from pg_proc where proname = 'pgr_floydwarshall'$$,
SELECT function_types_eq('pgr_floydwarshall',
$$VALUES
('{25,16,20,20,701}'::OID[])
('{text,bool,int8,int8,float8}'::TEXT[])
$$);

SELECT finish();
Expand Down
5 changes: 2 additions & 3 deletions pgtap/allpairs/johnson/types_check.pg
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@ SELECT set_eq(
('{"","directed","start_vid","end_vid","agg_cost"}'::TEXT[])
$$);

SELECT set_eq(
$$SELECT proallargtypes from pg_proc where proname = 'pgr_johnson'$$,
SELECT function_types_eq('pgr_johnson',
$$VALUES
('{25,16,20,20,701}'::OID[])
('{text,bool,int8,int8,float8}'::TEXT[])
$$);

SELECT finish();
Expand Down
10 changes: 3 additions & 7 deletions pgtap/alpha_shape/types_check.pg
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,9 @@ SELECT plan(4);
SELECT has_function('pgr_alphashape');

/* pgtap does not like geometry type, this is a workaround */
SELECT set_eq(
$$WITH a AS (SELECT unnest(proargtypes) from pg_proc where proname = 'pgr_alphashape')
SELECT typname from a JOIN pg_type ON(oid = unnest)$$,
$$VALUES
('float8'),
('geometry')
$$);
SELECT function_types_eq('pgr_alphashape',
$$VALUES ('{geometry,float8}'::TEXT[]) $$);

SELECT set_eq(
$$WITH a AS (SELECT prorettype from pg_proc where proname = 'pgr_alphashape')
SELECT typname from a JOIN pg_type ON(oid = prorettype)$$,
Expand Down
26 changes: 13 additions & 13 deletions pgtap/bdDijkstra/bdDijkstraCost/types_check.pg
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ WHEN min_version('3.2.0') THEN
('{"","","","directed","start_vid","end_vid","agg_cost"}'::TEXT[]),
('{"","","directed","start_vid","end_vid","agg_cost"}'::TEXT[])
$$),
set_eq(
$$SELECT proallargtypes from pg_proc where proname = 'pgr_bddijkstracost'$$,

function_types_eq('pgr_bddijkstracost',
$$VALUES
('{25,25,16,20,20,701}'::OID[]),
('{25,20,20,16,20,20,701}'::OID[]),
('{25,20,2277,16,20,20,701}'::OID[]),
('{25,2277,20,16,20,20,701}'::OID[]),
('{25,2277,2277,16,20,20,701}'::OID[])
('{text,text,bool,int8,int8,float8}'::TEXT[]),
('{text,int8,int8,bool,int8,int8,float8}'::TEXT[]),
('{text,int8,anyarray,bool,int8,int8,float8}'::TEXT[]),
('{text,anyarray,int8,bool,int8,int8,float8}'::TEXT[]),
('{text,anyarray,anyarray,bool,int8,int8,float8}'::TEXT[])
$$)
)
ELSE
Expand All @@ -80,13 +80,13 @@ ELSE
('{"","","","directed","start_vid","end_vid","agg_cost"}'::TEXT[]),
('{"","","","directed","start_vid","end_vid","agg_cost"}'::TEXT[])
$$),
set_eq(
$$SELECT proallargtypes from pg_proc where proname = 'pgr_bddijkstracost'$$,

function_types_eq('pgr_bddijkstracost',
$$VALUES
('{25,20,20,16,20,20,701}'::OID[]),
('{25,20,2277,16,20,20,701}'::OID[]),
('{25,2277,20,16,20,20,701}'::OID[]),
('{25,2277,2277,16,20,20,701}'::OID[])
('{text,int8,int8,bool,int8,int8,float8}'::TEXT[]),
('{text,int8,anyarray,bool,int8,int8,float8}'::TEXT[]),
('{text,anyarray,int8,bool,int8,int8,float8}'::TEXT[]),
('{text,anyarray,anyarray,bool,int8,int8,float8}'::TEXT[])
$$)
)
END;
Expand Down
5 changes: 2 additions & 3 deletions pgtap/bdDijkstra/bdDijkstraCostMatrix/types_check.pg
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@ SELECT set_eq(
('{"","","directed","start_vid","end_vid","agg_cost"}'::TEXT[])
$$);

SELECT set_eq(
$$SELECT proallargtypes from pg_proc where proname = 'pgr_bddijkstracostmatrix'$$,
SELECT function_types_eq('pgr_bddijkstracostmatrix',
$$VALUES
('{25,2277,16,20,20,701}'::OID[])
('{text,anyarray,bool,int8,int8,float8}'::TEXT[])
$$);

SELECT finish();
Expand Down
24 changes: 11 additions & 13 deletions pgtap/bellman_ford/bellman_ford/types_check.pg
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,13 @@ BEGIN
$$
),

set_has(
$$SELECT proallargtypes from pg_proc where proname = 'pgr_bellmanford'$$,
function_types_eq('pgr_bellmanford',
$$VALUES
('{25,20,20,16,23,23,20,20,701,701}'::OID[]),
('{25,20,2277,16,23,23,20,20,20,701,701}'::OID[]),
('{25,2277,20,16,23,23,20,20,20,701,701}'::OID[]),
('{25,2277,2277,16,23,23,20,20,20,20,701,701}'::OID[]),
('{25,25,16,23,23,20,20,20,20,701,701}'::OID[])
('{text,int8,int8,bool,int4,int4,int8,int8,float8,float8}'::TEXT[]),
('{text,int8,anyarray,bool,int4,int4,int8,int8,int8,float8,float8}'::TEXT[]),
('{text,anyarray,int8,bool,int4,int4,int8,int8,int8,float8,float8}'::TEXT[]),
('{text,anyarray,anyarray,bool,int4,int4,int8,int8,int8,int8,float8,float8}'::TEXT[]),
('{text,text,bool,int4,int4,int8,int8,int8,int8,float8,float8}'::TEXT[])
$$
)
)
Expand All @@ -87,13 +86,12 @@ BEGIN
$$
),

set_eq(
$$SELECT proallargtypes from pg_proc where proname = 'pgr_bellmanford'$$,
function_types_eq('pgr_bellmanford',
$$VALUES
('{25,20,20,16,23,23,20,20,701,701}'::OID[]),
('{25,20,2277,16,23,23,20,20,20,701,701}'::OID[]),
('{25,2277,20,16,23,23,20,20,20,701,701}'::OID[]),
('{25,2277,2277,16,23,23,20,20,20,20,701,701}'::OID[])
('{text,int8,int8,bool,int4,int4,int8,int8,float8,float8}'::TEXT[]),
('{text,int8,anyarray,bool,int4,int4,int8,int8,int8,float8,float8}'::TEXT[]),
('{text,anyarray,int8,bool,int4,int4,int8,int8,int8,float8,float8}'::TEXT[]),
('{text,anyarray,anyarray,bool,int4,int4,int8,int8,int8,int8,float8,float8}'::TEXT[])
$$
)
)
Expand Down
24 changes: 11 additions & 13 deletions pgtap/bellman_ford/edwardMoore/types_check.pg
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,13 @@ BEGIN
$$
),

set_has(
$$SELECT proallargtypes from pg_proc where proname = 'pgr_edwardmoore'$$,
function_types_eq('pgr_edwardmoore',
$$VALUES
('{25,20,20,16,23,23,20,20,701,701}'::OID[]),
('{25,20,2277,16,23,23,20,20,20,701,701}'::OID[]),
('{25,2277,20,16,23,23,20,20,20,701,701}'::OID[]),
('{25,2277,2277,16,23,23,20,20,20,20,701,701}'::OID[]),
('{25,25,16,23,23,20,20,20,20,701,701}'::OID[])
('{text,int8,int8,bool,int4,int4,int8,int8,float8,float8}'::TEXT[]),
('{text,int8,anyarray,bool,int4,int4,int8,int8,int8,float8,float8}'::TEXT[]),
('{text,anyarray,int8,bool,int4,int4,int8,int8,int8,float8,float8}'::TEXT[]),
('{text,anyarray,anyarray,bool,int4,int4,int8,int8,int8,int8,float8,float8}'::TEXT[]),
('{text,text,bool,int4,int4,int8,int8,int8,int8,float8,float8}'::TEXT[])
$$
)
)
Expand All @@ -87,13 +86,12 @@ BEGIN
$$
),

set_eq(
$$SELECT proallargtypes from pg_proc where proname = 'pgr_edwardmoore'$$,
function_types_eq('pgr_edwardmoore',
$$VALUES
('{25,20,20,16,23,23,20,20,701,701}'::OID[]),
('{25,20,2277,16,23,23,20,20,20,701,701}'::OID[]),
('{25,2277,20,16,23,23,20,20,20,701,701}'::OID[]),
('{25,2277,2277,16,23,23,20,20,20,20,701,701}'::OID[])
('{text,int8,int8,bool,int4,int4,int8,int8,float8,float8}'::TEXT[]),
('{text,int8,anyarray,bool,int4,int4,int8,int8,int8,float8,float8}'::TEXT[]),
('{text,anyarray,int8,bool,int4,int4,int8,int8,int8,float8,float8}'::TEXT[]),
('{text,anyarray,anyarray,bool,int4,int4,int8,int8,int8,int8,float8,float8}'::TEXT[])
$$
)
)
Expand Down
5 changes: 1 addition & 4 deletions pgtap/chinese/chinesePostman/types_check.pg
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ SELECT set_eq(
$$SELECT '{"", "seq", "node", "edge", "cost", "agg_cost"}'::TEXT[] $$
);

SELECT set_eq(
$$SELECT proallargtypes from pg_proc where proname = 'pgr_chinesepostman'$$,
$$SELECT '{25,23,20,20,701,701}'::OID[] $$
);
SELECT function_types_eq('pgr_chinesepostman', $$SELECT '{text,int4,int8,int8,float8,float8}'::TEXT[] $$);

SELECT * FROM finish();
ROLLBACK;
6 changes: 2 additions & 4 deletions pgtap/chinese/chinesePostmanCost/types_check.pg
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,9 @@ SELECT set_eq(
$$SELECT 701 $$
);

SELECT set_eq(
$$SELECT proargtypes from pg_proc where proname = 'pgr_chinesepostmancost'$$,
$$SELECT '[0:0]={25}'::OID[] $$
SELECT function_types_eq('pgr_chinesepostmancost',
$$SELECT '{text}'::TEXT[] $$
);


SELECT * FROM finish();
ROLLBACK;
5 changes: 2 additions & 3 deletions pgtap/circuits/hawickCircuits/types_check.pg
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,9 @@ SELECT set_eq(
$$);

RETURN QUERY
SELECT set_eq(
$$SELECT proallargtypes from pg_proc where proname = 'pgr_hawickcircuits'$$,
SELECT function_types_eq('pgr_hawickcircuits',
$$VALUES
('{25,23,23,23,20,20,20,20,701,701}'::OID[])
('{text,int4,int4,int4,int8,int8,int8,int8,float8,float8}'::TEXT[])
$$);

END;
Expand Down
5 changes: 2 additions & 3 deletions pgtap/coloring/bipartite/types_check.pg
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,9 @@ BEGIN
);

RETURN QUERY
SELECT set_eq(
$$SELECT proallargtypes from pg_proc where proname = 'pgr_bipartite'$$,
SELECT function_types_eq('pgr_bipartite',
$$VALUES
('{25,20,20}'::OID[])
('{text,int8,int8}'::TEXT[])
$$
);
END;
Expand Down
5 changes: 2 additions & 3 deletions pgtap/coloring/edgeColoring/types_check.pg
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,9 @@ BEGIN
);

RETURN QUERY
SELECT set_eq(
$$SELECT proallargtypes from pg_proc where proname = 'pgr_edgecoloring'$$,
SELECT function_types_eq('pgr_edgecoloring',
$$VALUES
('{25,20,20}'::OID[])
('{text,int8,int8}'::TEXT[])
$$
);

Expand Down
5 changes: 2 additions & 3 deletions pgtap/coloring/sequentialVertexColoring/types_check.pg
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,9 @@ BEGIN
);

RETURN QUERY
SELECT set_eq(
$$SELECT proallargtypes from pg_proc where proname = 'pgr_sequentialvertexcoloring'$$,
SELECT function_types_eq('pgr_sequentialvertexcoloring',
$$VALUES
('{25,20,20}'::OID[])
('{text,int8,int8}'::TEXT[])
$$
);
END;
Expand Down
5 changes: 2 additions & 3 deletions pgtap/components/articulationPoints/types_check.pg
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ SELECT set_eq(
$$SELECT '{"", "node"}'::TEXT[] $$
);

SELECT set_eq(
$$SELECT proallargtypes from pg_proc where proname = 'pgr_articulationpoints'$$,
$$SELECT '{25,20}'::OID[] $$
SELECT function_types_eq('pgr_articulationpoints',
$$SELECT '{text,int8}'::TEXT[] $$
);

SELECT * FROM finish();
Expand Down
5 changes: 2 additions & 3 deletions pgtap/components/biconnectedComponents/types_check.pg
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ SELECT set_eq(
$$SELECT '{"", "seq","component","edge"}'::TEXT[] $$
);

SELECT set_eq(
$$SELECT proallargtypes from pg_proc where proname = 'pgr_biconnectedcomponents'$$,
$$SELECT '{25,20,20,20}'::OID[] $$
SELECT function_types_eq('pgr_biconnectedcomponents',
$$SELECT '{text,int8,int8,int8}'::TEXT[] $$
);

SELECT * FROM finish();
Expand Down
5 changes: 2 additions & 3 deletions pgtap/components/bridges/types_check.pg
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ SELECT set_eq(
$$SELECT '{"", "edge"}'::TEXT[] $$
);

SELECT set_eq(
$$SELECT proallargtypes from pg_proc where proname = 'pgr_bridges'$$,
$$SELECT '{25,20}'::OID[] $$
SELECT function_types_eq('pgr_bridges',
$$SELECT '{text,int8}'::TEXT[] $$
);

SELECT * FROM finish();
Expand Down
5 changes: 2 additions & 3 deletions pgtap/components/connectedComponenes/types_check.pg
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ SELECT set_eq(
$$SELECT '{"", "seq","component","node"}'::TEXT[] $$
);

SELECT set_eq(
$$SELECT proallargtypes from pg_proc where proname = 'pgr_connectedcomponents'$$,
$$SELECT '{25,20,20,20}'::OID[] $$
SELECT function_types_eq('pgr_connectedcomponents',
$$SELECT '{text,int8,int8,int8}'::TEXT[] $$
);

SELECT * FROM finish();
Expand Down
5 changes: 2 additions & 3 deletions pgtap/components/makeConnected/types_check.pg
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,9 @@ BEGIN
);

RETURN QUERY
SELECT set_eq(
$$SELECT proallargtypes from pg_proc where proname = 'pgr_makeconnected'$$,
SELECT function_types_eq('pgr_makeconnected',
$$VALUES
('{25,20,20,20}'::OID[])
('{text,int8,int8,int8}'::TEXT[])
$$
);
END;
Expand Down
5 changes: 2 additions & 3 deletions pgtap/components/strongComponenets/types_check.pg
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ SELECT set_eq(
$$SELECT '{"", "seq","component","node"}'::TEXT[] $$
);

SELECT set_eq(
$$SELECT proallargtypes from pg_proc where proname = 'pgr_strongcomponents'$$,
$$SELECT '{25,20,20,20}'::OID[] $$
SELECT function_types_eq('pgr_strongcomponents',
$$SELECT '{text,int8,int8,int8}'::TEXT[] $$
);

SELECT * FROM finish();
Expand Down
7 changes: 3 additions & 4 deletions pgtap/contraction/contraction/types_check.pg
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ BEGIN
('{"",directed,methods,cycles,forbidden,type,id,contracted_vertices,source,target,cost}'::TEXT[])
$$,'pgr_contraction: Column names');

RETURN QUERY SELECT function_types('pgr_contraction',
RETURN QUERY SELECT function_types_eq('pgr_contraction',
$$VALUES ('{text,bool,_int4,int4,_int8,text,int8,_int8,int8,int8,float8}'::TEXT[]),
('{text,_int8,int4,_int8,bool,text,int8,_int8,int8,int8,float8}'::TEXT[]) $$);

Expand All @@ -48,9 +48,8 @@ BEGIN
('{"", "", "max_cycles", "forbidden_vertices", "directed", "type", "id", "contracted_vertices", "source", "target", "cost"}'::TEXT[])
$$);

RETURN QUERY SELECT set_eq(
$$SELECT proallargtypes from pg_proc where proname = 'pgr_contraction'$$,
$$SELECT '{25,1016,23,1016,16,25,20,1016,20,20,701}'::OID[] $$
RETURN QUERY SELECT function_types_eq('pgr_contraction',
$$SELECT '{text,_int8,int4,_int8,bool,text,int8,_int8,int8,int8,float8}'::TEXT[] $$
);

END IF;
Expand Down
2 changes: 1 addition & 1 deletion pgtap/contraction/contractionDeadEnd/types_check.pg
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ BEGIN
('{"","directed","forbidden","type","id","contracted_vertices","source","target","cost"}'::TEXT[])
$$);

RETURN QUERY SELECT function_types('pgr_contractiondeadend',
RETURN QUERY SELECT function_types_eq('pgr_contractiondeadend',
$$VALUES ('{text,bool,_int8,text,int8,_int8,int8,int8,float8}'::TEXT[]) $$);

END;
Expand Down
2 changes: 1 addition & 1 deletion pgtap/contraction/contractionLinear/types_check.pg
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ BEGIN
('{"",directed,forbidden,type,id,contracted_vertices,source,target,cost}'::TEXT[])
$$,'pgr_contractionlinear: Column names');

RETURN QUERY SELECT function_types('pgr_contractionlinear',
RETURN QUERY SELECT function_types_eq('pgr_contractionlinear',
$$VALUES ('{text,bool,_int8,text,int8,_int8,int8,int8,float8}'::TEXT[]) $$);

END;
Expand Down
Loading
Loading