[llvm-commits] [zorg] r147077 - in /zorg/trunk/lnt: lnt/lnttool/create.py lnt/server/db/testsuite.py lnt/server/db/v4db.py tests/server/db/CreateV4TestSuiteInstance.py
Daniel Dunbar
daniel at zuster.org
Wed Dec 21 12:00:11 PST 2011
Author: ddunbar
Date: Wed Dec 21 14:00:10 2011
New Revision: 147077
URL: http://llvm.org/viewvc/llvm-project?rev=147077&view=rev
Log:
[lnt/v0.4] lnt create: Fix create to properly initialize StatusKind table.
- Also, fix up some problems in the CreateV4TestSuiteInstance test.
Modified:
zorg/trunk/lnt/lnt/lnttool/create.py
zorg/trunk/lnt/lnt/server/db/testsuite.py
zorg/trunk/lnt/lnt/server/db/v4db.py
zorg/trunk/lnt/tests/server/db/CreateV4TestSuiteInstance.py
Modified: zorg/trunk/lnt/lnt/lnttool/create.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/lnttool/create.py?rev=147077&r1=147076&r2=147077&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/lnttool/create.py (original)
+++ zorg/trunk/lnt/lnt/lnttool/create.py Wed Dec 21 14:00:10 2011
@@ -78,6 +78,7 @@
###
import lnt.db.perfdb
+import lnt.testing
def _create_v4_nt_database(db_path):
from lnt.server.db import v4db, testsuite
@@ -89,6 +90,13 @@
# Create an NT compatible test suite, automatically.
ts = testsuite.TestSuite("nt", "NT")
+ # Define the default status kinds.
+ #
+ # FIXME: This should probably be done by V4DB.
+ db.add(testsuite.StatusKind(lnt.testing.PASS, "PASS"))
+ db.add(testsuite.StatusKind(lnt.testing.FAIL, "FAIL"))
+ db.add(testsuite.StatusKind(lnt.testing.XFAIL, "XFAIL"))
+
# Define the default sample types.
#
# FIXME: This should probably be done by V4DB.
Modified: zorg/trunk/lnt/lnt/server/db/testsuite.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/server/db/testsuite.py?rev=147077&r1=147076&r2=147077&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/server/db/testsuite.py (original)
+++ zorg/trunk/lnt/lnt/server/db/testsuite.py Wed Dec 21 14:00:10 2011
@@ -46,7 +46,8 @@
id = Column("ID", Integer, primary_key=True)
name = Column("Name", String(256), unique=True)
- def __init__(self, name):
+ def __init__(self, id, name):
+ self.id = id
self.name = name
def __repr__(self):
Modified: zorg/trunk/lnt/lnt/server/db/v4db.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/server/db/v4db.py?rev=147077&r1=147076&r2=147077&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/server/db/v4db.py (original)
+++ zorg/trunk/lnt/lnt/server/db/v4db.py Wed Dec 21 14:00:10 2011
@@ -74,6 +74,12 @@
self.query = self.session.query
self.rollback = self.session.rollback
+ # For parity with the usage of TestSuiteDB, we make our primary model
+ # classes available as instance variables.
+ self.SampleType = testsuite.SampleType
+ self.StatusKind = testsuite.StatusKind
+ self.TestSuite = testsuite.TestSuite
+
@property
def testsuite(self):
# This is the start of "magic" part of V4DB, which allows us to get
Modified: zorg/trunk/lnt/tests/server/db/CreateV4TestSuiteInstance.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/tests/server/db/CreateV4TestSuiteInstance.py?rev=147077&r1=147076&r2=147077&view=diff
==============================================================================
--- zorg/trunk/lnt/tests/server/db/CreateV4TestSuiteInstance.py (original)
+++ zorg/trunk/lnt/tests/server/db/CreateV4TestSuiteInstance.py Wed Dec 21 14:00:10 2011
@@ -41,9 +41,9 @@
start_time = datetime.datetime.utcnow()
end_time = datetime.datetime.utcnow()
-machine = ts_db.Machine("test-machine", 1)
+machine = ts_db.Machine("test-machine")
machine.uname = "test-uname"
-order = ts_db.Order()
+order = ts_db.Order(ordinal = 0)
order.llvm_revision = "test-revision"
run = ts_db.Run(machine, order, start_time, end_time)
run.arch = "test-arch"
@@ -83,9 +83,9 @@
# Audit the various fields.
assert machine.name == "test-machine"
-assert machine.number == 1
assert machine.uname == "test-uname"
+assert order.ordinal == 0
assert order.llvm_revision == "test-revision"
assert run.machine is machine
More information about the llvm-commits
mailing list