Changeset: 571204370adb for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=571204370adb
Modified Files:
        clients/examples/python/sqlsample.py
        sql/test/mapi/Tests/python3_dbapi.stable.err
        sql/test/mapi/Tests/python3_dbapi.stable.out
        sql/test/mapi/Tests/python3_dec38.stable.err
        sql/test/mapi/Tests/python3_dec38.stable.out.int128
        sql/test/mapi/Tests/python3_int128.stable.out.int128
        sql/test/mapi/Tests/python_dec38.py
        sql/test/mapi/Tests/python_int128.py
Branch: default
Log Message:

Silenced Python tests


diffs (268 lines):

diff --git a/clients/examples/python/sqlsample.py 
b/clients/examples/python/sqlsample.py
--- a/clients/examples/python/sqlsample.py
+++ b/clients/examples/python/sqlsample.py
@@ -11,28 +11,33 @@ import sys
 
 dbh = 
pymonetdb.connect(port=int(sys.argv[1]),database=sys.argv[2],hostname=sys.argv[3],autocommit=True)
 
-cursor = dbh.cursor();
+cursor = dbh.cursor()
 cursor.execute('select 1;')
-print(cursor.fetchall())
+if cursor.fetchall() != [(1,)]:
+    sys.stderr.write("Just row (1,) expected")
 
-cursor = dbh.cursor();
+cursor = dbh.cursor()
 cursor.execute('select 2;')
-print(cursor.fetchone())
+if cursor.fetchall() != [(2,)]:
+    sys.stderr.write("Just row (2,) expected")
 
 # deliberately executing a wrong SQL statement:
 try:
     cursor.execute('select commit_action, access from tables group by access;')
+    sys.stderr.write("Grouping error expected")
 except pymonetdb.OperationalError as e:
-    print(e)
+    if 'SELECT: cannot use non GROUP BY column \'commit_action\' in query 
results without an aggregate function' not in str(e):
+        raise e
 
-cursor.execute('create table python_table (i smallint,s string);');
-cursor.execute('insert into python_table values ( 3, \'three\');');
-cursor.execute('insert into python_table values ( 7, \'seven\');');
-cursor.execute('select * from python_table;');
-print(cursor.fetchall())
+cursor.execute('create table python_table (i smallint,s string);')
+cursor.execute('insert into python_table values ( 3, \'three\');')
+cursor.execute('insert into python_table values ( 7, \'seven\');')
+cursor.execute('select * from python_table;')
+if cursor.fetchall() != [(3, 'three'), (7, 'seven')]:
+    sys.stderr.write("Result set [(3, 'three'), (7, 'seven')] expected")
 
 s = ((0, 'row1'), (1, 'row2'))
-x = cursor.executemany("insert into python_table VALUES (%s, %s);", s)
-print(x);
+if cursor.executemany("insert into python_table VALUES (%s, %s);", s) != 2:
+    sys.stderr.write("2 rows inserted expected")
 
-cursor.execute('drop table python_table;');
+cursor.execute('drop table python_table;')
diff --git a/sql/test/mapi/Tests/python3_dbapi.stable.err 
b/sql/test/mapi/Tests/python3_dbapi.stable.err
--- a/sql/test/mapi/Tests/python3_dbapi.stable.err
+++ b/sql/test/mapi/Tests/python3_dbapi.stable.err
@@ -7,16 +7,6 @@ stderr of test 'python3_dbapi` in direct
 
 
 # 22:24:36 >  
-# 22:24:36 >  Mtimeout -timeout 180 ./python_dbapi.SQL.sh python_dbapi 
-# 22:24:36 >  
-
-
-# 22:24:36 >  
-# 22:24:36 >  sqlsample.py 33515 mTests_src_test_mapi
-# 22:24:36 >  
-
-
-# 22:24:36 >  
 # 22:24:36 >  Done.
 # 22:24:36 >  
 
diff --git a/sql/test/mapi/Tests/python3_dbapi.stable.out 
b/sql/test/mapi/Tests/python3_dbapi.stable.out
--- a/sql/test/mapi/Tests/python3_dbapi.stable.out
+++ b/sql/test/mapi/Tests/python3_dbapi.stable.out
@@ -5,35 +5,6 @@ stdout of test 'python3_dbapi` in direct
 # 20:08:06 >   mserver5 
"--config=/ufs/niels/scratch/rc/Linux-x86_64/etc/monetdb5.conf" --debug=10 
--set gdk_nr_threads=0 --set 
"monet_mod_path=/ufs/niels/scratch/rc/Linux-x86_64/lib/MonetDB5:/ufs/niels/scratch/rc/Linux-x86_64/lib/MonetDB5/lib:/ufs/niels/scratch/rc/Linux-x86_64/lib/MonetDB5/bin"
 --set "gdk_dbfarm=/ufs/niels/scratch/rc/Linux-x86_64/var/MonetDB5/dbfarm"    
--set mapi_open=true --set xrpc_open=true --set mapi_port=32187 --set 
xrpc_port=41560 --set monet_prompt= --trace  "--dbname=mTests_src_test_mapi" 
--set mal_listing=0 "--dbinit= include sql;" ; echo ; echo Over..
 # 20:08:06 >  
 
-# MonetDB server v5.12.1, based on kernel v1.30.1
-# Serving database 'mTests_src_test_mapi', using 4 threads
-# Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs dynamically 
linked
-# Copyright (c) 1993-July 2008 CWI.
-# Copyright (c) August 2008-2009 MonetDB B.V., all rights reserved
-# Visit http://monetdb.cwi.nl/ for further information
-# Listening for connection requests on mapi:monetdb://alf.ins.cwi.nl:32187/
-# MonetDB/SQL module v2.30.1 loaded
-
-#function user.main():void;
-#    clients.quit();
-#end main;
-
-
-# 22:24:36 >  
-# 22:24:36 >  Mtimeout -timeout 180 ./python_dbapi.SQL.sh python_dbapi 
-# 22:24:36 >  
-
-
-# 22:24:36 >  
-# 22:24:36 >  sqlsample.py 33515 mTests_src_test_mapi
-# 22:24:36 >  
-
-[(1,)]
-(2,)
-42000!SELECT: cannot use non GROUP BY column 'commit_action' in query results 
without an aggregate function
-
-[(3, 'three'), (7, 'seven')]
-2
 
 # 22:24:36 >  
 # 22:24:36 >  Done.
diff --git a/sql/test/mapi/Tests/python3_dec38.stable.err 
b/sql/test/mapi/Tests/python3_dec38.stable.err
--- a/sql/test/mapi/Tests/python3_dec38.stable.err
+++ b/sql/test/mapi/Tests/python3_dec38.stable.err
@@ -5,30 +5,6 @@ stderr of test 'python3_dec38` in direct
 # 18:07:10 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=31922" "--set" 
"mapi_usock=/var/tmp/mtest-28749/.s.monetdb.31922" "--set" "monet_prompt=" 
"--forcemito" "--set" "mal_listing=2" 
"--dbpath=/ufs/manegold/_/Monet/HG/dec38/prefix/--disable-debug_--enable-assert_--enable-optimize/var/MonetDB/mTests_sql_test_mapi"
 "--set" "mal_listing=0"
 # 18:07:10 >  
 
-# builtin opt  gdk_dbpath = 
/ufs/manegold/_/Monet/HG/dec38/prefix/--disable-debug_--enable-assert_--enable-optimize/var/monetdb5/dbfarm/demo
-# builtin opt  gdk_debug = 0
-# builtin opt  gdk_vmtrim = no
-# builtin opt  monet_prompt = >
-# builtin opt  monet_daemon = no
-# builtin opt  mapi_port = 50000
-# builtin opt  mapi_open = false
-# builtin opt  mapi_autosense = false
-# builtin opt  sql_optimizer = default_pipe
-# builtin opt  sql_debug = 0
-# cmdline opt  gdk_nr_threads = 0
-# cmdline opt  mapi_open = true
-# cmdline opt  mapi_port = 31922
-# cmdline opt  mapi_usock = /var/tmp/mtest-28749/.s.monetdb.31922
-# cmdline opt  monet_prompt = 
-# cmdline opt  mal_listing = 2
-# cmdline opt  gdk_dbpath = 
/ufs/manegold/_/Monet/HG/dec38/prefix/--disable-debug_--enable-assert_--enable-optimize/var/MonetDB/mTests_sql_test_mapi
-# cmdline opt  mal_listing = 0
-# cmdline opt  gdk_debug = 536870922
-
-# 18:07:10 >  
-# 18:07:10 >  "./python3_dec38.SQL.sh" "python3_dec38"
-# 18:07:10 >  
-
 
 # 18:07:10 >  
 # 18:07:10 >  "Done."
diff --git a/sql/test/mapi/Tests/python3_dec38.stable.out.int128 
b/sql/test/mapi/Tests/python3_dec38.stable.out.int128
--- a/sql/test/mapi/Tests/python3_dec38.stable.out.int128
+++ b/sql/test/mapi/Tests/python3_dec38.stable.out.int128
@@ -5,34 +5,6 @@ stdout of test 'python3_dec38` in direct
 # 18:07:10 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=31922" "--set" 
"mapi_usock=/var/tmp/mtest-28749/.s.monetdb.31922" "--set" "monet_prompt=" 
"--forcemito" "--set" "mal_listing=2" 
"--dbpath=/ufs/manegold/_/Monet/HG/dec38/prefix/--disable-debug_--enable-assert_--enable-optimize/var/MonetDB/mTests_sql_test_mapi"
 "--set" "mal_listing=0"
 # 18:07:10 >  
 
-# MonetDB 5 server v11.18.0
-# This is an unreleased version
-# Serving database 'mTests_sql_test_mapi', using 8 threads
-# Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs and 128bit 
integers dynamically linked
-# Found 15.591 GiB available main-memory.
-# Copyright (c) 1993-July 2008 CWI.
-# Copyright (c) August 2008-2015 MonetDB B.V., all rights reserved
-# Visit http://www.monetdb.org/ for further information
-# Listening for connection requests on mapi:monetdb://rome.ins.cwi.nl:31922/
-# Listening for UNIX domain connection requests on 
mapi:monetdb:///var/tmp/mtest-28749/.s.monetdb.31922
-# MonetDB/GIS module loaded
-# MonetDB/SQL module loaded
-
-
-# 18:23:28 >  
-# 18:23:28 >  "./python3_dec38.SQL.sh" "python3_dec38"
-# 18:23:28 >  
-
-
-# 18:23:28 >  
-# 18:23:28 >  /usr/bin/python3 
/net/rome.ins.cwi.nl/export/scratch2/manegold/.rig./scratch0/Monet/HG/int128/source/MonetDB/sql/test/mapi/Tests/python_dec38.py
 35903 mTests_sql_test_mapi /var/tmp/mtest-10465
-# 18:23:28 >  
-
-[(Decimal('12345678901234567899876543210987654321'), 
Decimal('1234567890123456789.9876543210987654321'), 
Decimal('0.12345678901234567899876543210987654321'))]
-(Decimal('12345678901234567899876543210987654321'), 
Decimal('1234567890123456789.9876543210987654321'), 
Decimal('0.12345678901234567899876543210987654321'))
-12345678901234567899876543210987654321
-1234567890123456789.9876543210987654321
-0.12345678901234567899876543210987654321
 
 # 18:23:28 >  
 # 18:23:28 >  "Done."
diff --git a/sql/test/mapi/Tests/python3_int128.stable.out.int128 
b/sql/test/mapi/Tests/python3_int128.stable.out.int128
--- a/sql/test/mapi/Tests/python3_int128.stable.out.int128
+++ b/sql/test/mapi/Tests/python3_int128.stable.out.int128
@@ -1,36 +1,7 @@
-stdout of test 'python3_int128` in directory 'sql/test/mapi` itself:
-
-
 # 18:07:10 >  
 # 18:07:10 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=31922" "--set" 
"mapi_usock=/var/tmp/mtest-28749/.s.monetdb.31922" "--set" "monet_prompt=" 
"--forcemito" "--set" "mal_listing=2" 
"--dbpath=/ufs/manegold/_/Monet/HG/int128/prefix/--disable-debug_--enable-assert_--enable-optimize/var/MonetDB/mTests_sql_test_mapi"
 "--set" "mal_listing=0"
 # 18:07:10 >  
 
-# MonetDB 5 server v11.18.0
-# This is an unreleased version
-# Serving database 'mTests_sql_test_mapi', using 8 threads
-# Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs and 128bit 
integers dynamically linked
-# Found 15.591 GiB available main-memory.
-# Copyright (c) 1993-July 2008 CWI.
-# Copyright (c) August 2008-2015 MonetDB B.V., all rights reserved
-# Visit http://www.monetdb.org/ for further information
-# Listening for connection requests on mapi:monetdb://rome.ins.cwi.nl:31922/
-# Listening for UNIX domain connection requests on 
mapi:monetdb:///var/tmp/mtest-28749/.s.monetdb.31922
-# MonetDB/GIS module loaded
-# MonetDB/SQL module loaded
-
-
-# 18:07:10 >  
-# 18:07:10 >  "./python3_int128.SQL.sh" "python3_int128"
-# 18:07:10 >  
-
-
-# 18:17:59 >  
-# 18:17:59 >  /usr/bin/python3 
/net/rome.ins.cwi.nl/export/scratch2/manegold/.rig./scratch0/Monet/HG/int128/source/MonetDB/sql/test/mapi/Tests/python_int128.py
 31201 mTests_sql_test_mapi /var/tmp/mtest-6230
-# 18:17:59 >  
-
-[(123456789098765432101234567890987654321,)]
-(123456789098765432101234567890987654321,)
-123456789098765432101234567890987654321
 
 # 18:17:59 >  
 # 18:17:59 >  "Done."
diff --git a/sql/test/mapi/Tests/python_dec38.py 
b/sql/test/mapi/Tests/python_dec38.py
--- a/sql/test/mapi/Tests/python_dec38.py
+++ b/sql/test/mapi/Tests/python_dec38.py
@@ -8,19 +8,17 @@
 
 import pymonetdb
 import sys
+from decimal import Decimal
 
 dbh = 
pymonetdb.connect(port=int(sys.argv[1]),database=sys.argv[2],hostname=sys.argv[3],autocommit=True)
 
 cursor = dbh.cursor()
 
 cursor.execute('CREATE TABLE python_dec38 (d38_0 DECIMAL(38,0), d38_19 
DECIMAL(38,19), d38_38 DECIMAL(38,38));')
-cursor.execute('INSERT INTO python_dec38 VALUES 
(12345678901234567899876543210987654321, 
1234567890123456789.9876543210987654321, 
.12345678901234567899876543210987654321);')
+if cursor.execute('INSERT INTO python_dec38 VALUES 
(12345678901234567899876543210987654321, 
1234567890123456789.9876543210987654321, 
.12345678901234567899876543210987654321);') != 1:
+    sys.stderr.write("1 row inserted expected")
 cursor.execute('SELECT * FROM python_dec38;')
-result = cursor.fetchall()
-print(result)
-print(result[0])
-print(result[0][0])
-print(result[0][1])
-print(result[0][2])
+if cursor.fetchall() != [(Decimal('12345678901234567899876543210987654321'), 
Decimal('1234567890123456789.9876543210987654321'), 
Decimal('0.12345678901234567899876543210987654321'))]:
+    sys.stderr.write("Result set 
[(Decimal('12345678901234567899876543210987654321'), 
Decimal('1234567890123456789.9876543210987654321'), 
Decimal('0.12345678901234567899876543210987654321'))] expected")
 
 cursor.execute('DROP TABLE python_dec38;')
diff --git a/sql/test/mapi/Tests/python_int128.py 
b/sql/test/mapi/Tests/python_int128.py
--- a/sql/test/mapi/Tests/python_int128.py
+++ b/sql/test/mapi/Tests/python_int128.py
@@ -14,11 +14,10 @@ dbh = pymonetdb.connect(port=int(sys.arg
 cursor = dbh.cursor()
 
 cursor.execute('CREATE TABLE python_int128 (i HUGEINT);')
-cursor.execute('INSERT INTO python_int128 VALUES 
(123456789098765432101234567890987654321);')
+if cursor.execute('INSERT INTO python_int128 VALUES 
(123456789098765432101234567890987654321);') != 1:
+    sys.stderr.write("1 row inserted expected")
 cursor.execute('SELECT * FROM python_int128;')
-result = cursor.fetchall()
-print(result)
-print(result[0])
-print(result[0][0])
+if cursor.fetchall() != [(123456789098765432101234567890987654321,)]:
+    sys.stderr.write("Result set [(123456789098765432101234567890987654321,)] 
expected")
 
 cursor.execute('DROP TABLE python_int128;')
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to