[LNT] r307570 - Revert "Use yaml schema mechanism to describe compile suite"

Chris Matthews via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 10 12:08:27 PDT 2017


Author: cmatthews
Date: Mon Jul 10 12:08:27 2017
New Revision: 307570

URL: http://llvm.org/viewvc/llvm-project?rev=307570&view=rev
Log:
Revert "Use yaml schema mechanism to describe compile suite"

This reverts commit 59f86a68f08ec22040cdca17116ee549aa927579.

Broke the server.

Removed:
    lnt/trunk/lnt/server/db/migrations/upgrade_13_to_14.py
    lnt/trunk/schemas/README.md
    lnt/trunk/schemas/compile.yaml
Modified:
    lnt/trunk/tests/SharedInputs/create_temp_instance.py
    lnt/trunk/tests/server/db/CreateV4TestSuite.py

Removed: lnt/trunk/lnt/server/db/migrations/upgrade_13_to_14.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/db/migrations/upgrade_13_to_14.py?rev=307569&view=auto
==============================================================================
--- lnt/trunk/lnt/server/db/migrations/upgrade_13_to_14.py (original)
+++ lnt/trunk/lnt/server/db/migrations/upgrade_13_to_14.py (removed)
@@ -1,74 +0,0 @@
-# The "compile" suite is handled by the compile.yaml schema file now.
-# This means we drop the entry in the TestSuite meta tables.
-# The existing tables are either dropped if they are empty. We have to rename
-# them if they are not empty, as previously the test-suite name was different
-# from the prefix used in the tables. In yaml schemas the name and prefix is
-# always the same so we have to rename from `Compile_XXXX` to `compile_XXX`.
-import sqlalchemy
-
-
-def _drop_table_if_empty(trans, name):
-    num = trans.execute('SELECT COUNT(*) FROM "%s"' % name).first()
-    if num[0] == 0:
-        trans.execute('DROP TABLE "%s"' % name)
-        return True
-    return False
-
-
-def upgrade(engine):
-    # The following is expected to fail if the user never had an old
-    # version of the database that create the Compile_XXX tables.
-    try:
-        renames = {
-            'Compile_Machine': 'compile_Machine',
-            'Compile_Order': 'compile_Order',
-            'Compile_Run': 'compile_Run',
-            'Compile_Sample': 'compile_Sample',
-            'Compile_Profile': 'compile_Profile',
-            'Compile_FieldChange': 'compile_FieldChange',
-            'Compile_FieldChangeV2': 'compile_FieldChangeV2',
-            'Compile_Regression': 'compile_Regression',
-            'Compile_RegressionIndicator': 'compile_RegressionIndicator',
-            'Compile_ChangeIgnore': 'compile_ChangeIgnore',
-            'Compile_BaseLine': 'compile_Baseline',
-        }
-        with engine.begin() as trans:
-            for old_name, new_name in renames.items():
-                if _drop_table_if_empty(trans, old_name):
-                    continue;
-                env = {'old_name': old_name, 'new_name': new_name}
-                trans.execute('''
-ALTER TABLE "%(old_name)s" RENAME TO "%(new_name)s_x"
-''' % env)
-                trans.execute('''
-ALTER TABLE "%(new_name)s_x" RENAME TO \"%(new_name)s\"
-''' % env)
-    except Exception as e:
-        import traceback
-        traceback.print_exc()
-
-    # Drop Compile suite information from meta tables
-    with engine.begin() as trans:
-        trans.execute('''
-DELETE FROM "TestSuiteOrderFields"
-    WHERE "TestSuiteID" IN
-        (SELECT "ID" FROM "TestSuite" WHERE "Name"=\'compile\')
-''')
-        trans.execute('''
-DELETE FROM "TestSuiteMachineFields"
-    WHERE "TestSuiteID" IN
-        (SELECT "ID" FROM "TestSuite" WHERE "Name"=\'compile\')
-''')
-        trans.execute('''
-DELETE FROM "TestSuiteRunFields"
-    WHERE "TestSuiteID" IN
-        (SELECT "ID" FROM "TestSuite" WHERE "Name"=\'compile\')
-''')
-        trans.execute('''
-DELETE FROM "TestSuiteSampleFields"
-    WHERE "TestSuiteID" IN
-        (SELECT "ID" FROM "TestSuite" WHERE "Name"=\'compile\')
-''')
-        trans.execute('''
-DELETE FROM "TestSuite" WHERE "Name"='compile'
-''')

Removed: lnt/trunk/schemas/README.md
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/schemas/README.md?rev=307569&view=auto
==============================================================================
--- lnt/trunk/schemas/README.md (original)
+++ lnt/trunk/schemas/README.md (removed)
@@ -1,2 +0,0 @@
-This directory contains schema files describing test suites. You can copy them
-or create symlinks to the schemas directory of an lnt instance to enable them.

Removed: lnt/trunk/schemas/compile.yaml
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/schemas/compile.yaml?rev=307569&view=auto
==============================================================================
--- lnt/trunk/schemas/compile.yaml (original)
+++ lnt/trunk/schemas/compile.yaml (removed)
@@ -1,30 +0,0 @@
-# This schema is used by the `lnt runtest compile` suite.
-format_version: '2'
-name: compile
-metrics:
-  - name: user_time
-    type: Real
-  - name: user_status
-    type: Status
-  - name: sys_time
-    type: Real
-  - name: sys_status
-    type: Status
-  - name: wall_time
-    type: Real
-  - name: wall_status
-    type: Status
-  - name: size_bytes
-    type: Real   # Should be Integer but we don't want to invalidate old data
-  - name: size_status
-    type: Status
-  - name: mem_bytes
-    type: Real
-  - name: mem_status
-    type: Status
-run_fields:
-  - name: llvm_project_revision
-    order: true
-machine_fields:
-  - name: hardware
-  - name: os_version

Modified: lnt/trunk/tests/SharedInputs/create_temp_instance.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/tests/SharedInputs/create_temp_instance.py?rev=307570&r1=307569&r2=307570&view=diff
==============================================================================
--- lnt/trunk/tests/SharedInputs/create_temp_instance.py (original)
+++ lnt/trunk/tests/SharedInputs/create_temp_instance.py Mon Jul 10 12:08:27 2017
@@ -128,9 +128,5 @@ def main():
                  dest_dir)
     if extra_sql:
         run_sql_file(lnt_db, extra_sql, dest_dir)
-    os.mkdir(os.path.join(dest_dir, 'schemas'))
-    filedir = os.path.dirname(__file__)
-    os.symlink(os.path.join(filedir, '..', '..', 'schemas', 'compile.yaml'),
-               os.path.join(dest_dir, 'schemas', 'compile.yaml'))
 
 main()

Modified: lnt/trunk/tests/server/db/CreateV4TestSuite.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/tests/server/db/CreateV4TestSuite.py?rev=307570&r1=307569&r2=307570&view=diff
==============================================================================
--- lnt/trunk/tests/server/db/CreateV4TestSuite.py (original)
+++ lnt/trunk/tests/server/db/CreateV4TestSuite.py Mon Jul 10 12:08:27 2017
@@ -13,9 +13,9 @@ from lnt.server.db import v4db
 # Create an in memory database.
 db = v4db.V4DB("sqlite:///:memory:", Config.dummy_instance(), echo=True)
 
-# We expect exactly the NTS test suite.
+# We expect exactly two test suites, one for NTS and one for Compile.
 test_suites = list(db.query(testsuite.TestSuite))
-assert len(test_suites) == 1
+assert len(test_suites) == 2
 
 # Check the NTS test suite.
 ts = db.query(testsuite.TestSuite).filter_by(name="nts").first()




More information about the llvm-commits mailing list