Changeset: 0e32c18bceb6 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/0e32c18bceb6
Modified Files:
        sql/test/BugTracker-2023/Tests/misc-crashes-7390.test
        sql/test/BugTracker-2024/Tests/between-true-and-null-Bug-7465.test
        testing/Mtest.py.in
        testing/sqllogictest.py
Branch: Dec2023
Log Message:

Implemented "skipif knownfail" in *.test files.
Skip individual queries that are known to fail.  If a file or test is
explicitly named on the Mtest.py command line, this flag is ignored
(i.e. all tests are executed).  Also, if the --alltests flag is given to
Mtests.py, all tests are executed.
Also, this flag now also works on the default branch, not just on
release branches.


diffs (179 lines):

diff --git a/sql/test/BugTracker-2023/Tests/misc-crashes-7390.test 
b/sql/test/BugTracker-2023/Tests/misc-crashes-7390.test
--- a/sql/test/BugTracker-2023/Tests/misc-crashes-7390.test
+++ b/sql/test/BugTracker-2023/Tests/misc-crashes-7390.test
@@ -259,6 +259,7 @@ query I nosort
 WITH v0 (v1) AS (SELECT 127 FROM v0 WHERE (v1 < 2147483647 OR v1 > -1) AND v1 
/ v1 + v1 <= 95 = v1 >= -128 + 15) SELECT 38 ^ v1 FROM v0 AS v3 WINDOW v2 AS ( 
), v4 AS (GROUPS BETWEEN -32768 PRECEDING AND 94 FOLLOWING) LIMIT 16 OFFSET 8
 ----
 
+skipif knownfail
 statement ok
 UPDATE v0 SET v1 = (WITH v0 (v1) AS (SELECT 127 WHERE (v1 < 2147483647 OR v1 > 
-1) AND v1 / v1 + v1 <= 95 = v1 >= -128 + 15) SELECT 38 FROM v0 AS v3 WINDOW v2 
AS ( ), v4 AS (GROUPS BETWEEN -32768 PRECEDING AND 94 FOLLOWING) LIMIT 16 
OFFSET 8) ^ v1
 -- sql/server/rel_select.c:3104: rel_binop_: Assertion `t1 && t2' failed.
diff --git a/sql/test/BugTracker-2024/Tests/between-true-and-null-Bug-7465.test 
b/sql/test/BugTracker-2024/Tests/between-true-and-null-Bug-7465.test
--- a/sql/test/BugTracker-2024/Tests/between-true-and-null-Bug-7465.test
+++ b/sql/test/BugTracker-2024/Tests/between-true-and-null-Bug-7465.test
@@ -14,6 +14,7 @@ SELECT (((t1.c0 NOT IN (true)))=((t1.c0 
 ----
 NULL
 
+skipif knownfail
 query I
 SELECT * FROM t1 WHERE (((t1.c0 NOT IN (true)))=((t1.c0 BETWEEN true AND 
NULL)))
 ----
diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -391,7 +391,7 @@ CONDITIONALS = {
     'SANITIZER'            : "@SANITIZER_FALSE@",
     # unknown at compile time;
     # hence, we set them only at runtime in main() below
-    'KNOWNFAIL'            : False, # skip on release branch when not in 
testweb
+    'KNOWNFAIL'            : False, # normally skip, but --alltests or explicit
     'HAVE_MONETDBJDBC_JAR' : False,
     'HAVE_JDBCCLIENT_JAR'  : False,
     'HAVE_JDBCTESTS_JAR'   : False,
@@ -2885,7 +2885,8 @@ def DoIt(env, SERVER, CALL, TST, EXT, Te
                                         port=int(pSrvr.port),
                                         database=TSTDB,
                                         language='sql',
-                                        timeout=TIMEOUT)
+                                        timeout=TIMEOUT,
+                                        alltests=CONDITIONALS['KNOWNFAIL'])
                         except KeyboardInterrupt:
                             raise
                         except:
@@ -2935,7 +2936,8 @@ def DoIt(env, SERVER, CALL, TST, EXT, Te
                                     port=int(pSrvr.port),
                                     database=TSTDB,
                                     language=lang,
-                                    timeout=TIMEOUT)
+                                    timeout=TIMEOUT,
+                                    alltests=CONDITIONALS['KNOWNFAIL'])
                     except KeyboardInterrupt:
                         raise
                     except:
@@ -3524,8 +3526,8 @@ def main(argv) :
     nomito = opts.nomito
     global restart
     restart = opts.restart
-    if int(MonetDB_VERSION[1])%2 == 0 or opts.alltests:
-        CONDITIONALS['KNOWNFAIL'] = 'execute'
+    if opts.alltests:
+        CONDITIONALS['KNOWNFAIL'] = True
     par['TIMEOUT'] = opts.timeout
     env['GDK_DEBUG'] = str(opts.debug)
     env['GDK_NR_THREADS'] = str(opts.nr_threads)
@@ -3901,10 +3903,11 @@ def main(argv) :
                     ErrXit("%s: not a valid test name" % args[0])
                 args = [head]
                 if tail != 'All':
-                    CONDITIONALS['KNOWNFAIL'] = 'execute'
-                    for ext in ('_s00.malC', '_p00.malC', '_s00.sql',
-                                '_p00.sql', '.MAL.py', '.SQL.py', '.malC',
-                                '.sql', '.py', '.R', ''):
+                    CONDITIONALS['KNOWNFAIL'] = True
+                    for ext in ('.test', '.maltest', '_s00.malC',
+                                '_p00.malC', '_s00.sql', '_p00.sql',
+                                '.MAL.py', '.SQL.py', '.malC', '.sql',
+                                '.py', '.R', '.rb', ''):
                         # extentions .in and .src are never combined
                         if tail.endswith(ext + '.in'):
                             args.append(tail[:-len(ext + '.in')])
@@ -3918,11 +3921,11 @@ def main(argv) :
                     else:
                         ErrXit("%s: not a valid test name" % args[0])
             elif head and tail and os.path.isdir(head) and tail != 'Tests' and 
os.path.isdir(os.path.join(head, 'Tests')):
-                CONDITIONALS['KNOWNFAIL'] = 'execute'
+                CONDITIONALS['KNOWNFAIL'] = True
                 args = [head, tail]
 
-        if   len(args) == 1:
-            if   os.path.isdir(args[0]):
+        if len(args) == 1:
+            if os.path.isdir(args[0]):
                 d = os.path.realpath(args[0])
                 if startswithpath(d + os.sep, TSTSRCBASE + os.sep):
                     dirlist.append(d)
@@ -3934,7 +3937,7 @@ def main(argv) :
             elif args[0] != "All":
                 #TODO:
                 # check, whether args[0] in All
-                CONDITIONALS['KNOWNFAIL'] = 'execute'
+                CONDITIONALS['KNOWNFAIL'] = True
                 testlist.append(args[0])
         elif len(args) > 1:
             i = 0
@@ -3947,7 +3950,7 @@ def main(argv) :
                     # WARNING/ERROR
                 i = i + 1
             if len(dirlist) == 1  and  i < len(args)  and  args[i] != "All":
-                CONDITIONALS['KNOWNFAIL'] = 'execute'
+                CONDITIONALS['KNOWNFAIL'] = True
                 while i < len(args):
                     if os.sep not in args[i]:
                         #TODO:
diff --git a/testing/sqllogictest.py b/testing/sqllogictest.py
--- a/testing/sqllogictest.py
+++ b/testing/sqllogictest.py
@@ -16,7 +16,7 @@
 # The skipif/onlyif mechanism has been slightly extended.  Recognized
 # "system"s are:
 # MonetDB, arch=<architecture>, system=<system>, bits=<bits>,
-# threads=<threads>, has-hugeint
+# threads=<threads>, has-hugeint, knownfail
 # where <architecture> is generally what the Python call
 # platform.machine() returns (i.e. x86_64, i686, aarch64, ppc64,
 # ppc64le, note 'AMD64' is translated to 'x86_64' and 'arm64' to
@@ -140,12 +140,13 @@ class SQLLogic:
 
     def connect(self, username='monetdb', password='monetdb',
                 hostname='localhost', port=None, database='demo',
-                language='sql', timeout=None):
+                language='sql', timeout=None, alltests=False):
         self.language = language
         self.hostname = hostname
         self.port = port
         self.database = database
         self.timeout = timeout
+        self.alltests = alltests
         if language == 'sql':
             self.dbh = pymonetdb.connect(username=username,
                                      password=password,
@@ -753,7 +754,9 @@ class SQLLogic:
                         if words[1] == f'threads={nthreads}':
                             skipping = True
                     elif words[1] == 'has-hugeint':
-                        skipping = hashge
+                        skipping |= hashge
+                    elif words[1] == 'knownfail':
+                        skipping |= not self.alltests
                 elif words[0] == 'onlyif':
                     if words[1] not in ('MonetDB', f'arch={architecture}', 
f'system={system}', f'bits={bits}'):
                         skipping = True
@@ -764,7 +767,9 @@ class SQLLogic:
                         if words[1] != f'threads={nthreads}':
                             skipping = True
                     elif words[1] == 'has-hugeint':
-                        skipping = not hashge
+                        skipping |= not hashge
+                    elif words[1] == 'knownfail':
+                        skipping |= self.alltests
                 self.writeline(line.rstrip())
                 line = self.readline()
                 words = line.split(maxsplit=2)
@@ -906,12 +911,14 @@ if __name__ == '__main__':
     parser.add_argument('--define', action='append',
                         help='define substitution for $var as var=replacement'
                         ' (can be repeated)')
+    parser.add_argument('--alltests', action='store_true',
+                        help='also executed "knownfail" tests')
     parser.add_argument('tests', nargs='*', help='tests to be run')
     opts = parser.parse_args()
     args = opts.tests
     sql = SQLLogic(report=opts.report)
     sql.res = opts.results
-    sql.connect(hostname=opts.host, port=opts.port, database=opts.database, 
language=opts.language, username=opts.user, password=opts.password)
+    sql.connect(hostname=opts.host, port=opts.port, database=opts.database, 
language=opts.language, username=opts.user, password=opts.password, 
alltests=opts.alltests)
     for test in args:
         try:
             if not opts.nodrop:
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to