Index: lnt/trunk/lnt/server/db/migrations/upgrade_0_to_1.py =================================================================== --- lnt/trunk/lnt/server/db/migrations/upgrade_0_to_1.py +++ lnt/trunk/lnt/server/db/migrations/upgrade_0_to_1.py @@ -44,7 +44,6 @@ test_suite_id = Column("TestSuiteID", Integer, ForeignKey('TestSuite.ID'), index=True) name = Column("Name", String(256)) - info_key = Column("InfoKey", String(256)) class OrderField(Base): @@ -53,7 +52,6 @@ test_suite_id = Column("TestSuiteID", Integer, ForeignKey('TestSuite.ID'), index=True) name = Column("Name", String(256)) - info_key = Column("InfoKey", String(256)) ordinal = Column("Ordinal", Integer) @@ -63,7 +61,6 @@ test_suite_id = Column("TestSuiteID", Integer, ForeignKey('TestSuite.ID'), index=True) name = Column("Name", String(256)) - info_key = Column("InfoKey", String(256)) class SampleField(Base): @@ -74,7 +71,6 @@ name = Column("Name", String(256)) type_id = Column("Type", Integer, ForeignKey('SampleType.ID')) type = relation(SampleType) - info_key = Column("InfoKey", String(256)) status_field_id = Column("status_field", Integer, ForeignKey( 'TestSuiteSampleFields.ID')) status_field = relation('SampleField', remote_side=id) @@ -113,27 +109,24 @@ ts = TestSuite(name="nts", db_key_name="NT") # Promote the natural information produced by 'runtest nt' to fields. - ts.machine_fields.append(MachineField(name="hardware", - info_key="hardware")) - ts.machine_fields.append(MachineField(name="os", info_key="os")) + ts.machine_fields.append(MachineField(name="hardware")) + ts.machine_fields.append(MachineField(name="os")) # The only reliable order currently is the "run_order" field. We will want # to revise this over time. ts.order_fields.append(OrderField(name="llvm_project_revision", - info_key="run_order", ordinal=0)) + ordinal=0)) # We are only interested in simple runs, so we expect exactly four fields # per test. compile_status = SampleField(name="compile_status", - type=status_sample_type, - info_key=".compile.status") + type=status_sample_type) compile_time = SampleField(name="compile_time", type=real_sample_type, - info_key=".compile", status_field=compile_status) - exec_status = SampleField(name="execution_status", type=status_sample_type, - info_key=".exec.status") + exec_status = SampleField(name="execution_status", + type=status_sample_type) exec_time = SampleField(name="execution_time", type=real_sample_type, - info_key=".exec", status_field=exec_status) + status_field=exec_status) ts.sample_fields.append(compile_time) ts.sample_fields.append(compile_status) ts.sample_fields.append(exec_time) @@ -156,15 +149,13 @@ ts = TestSuite(name="compile", db_key_name="Compile") # Promote some natural information to fields. - ts.machine_fields.append(MachineField(name="hardware", - info_key="hw.model")) - ts.machine_fields.append(MachineField(name="os_version", - info_key="kern.version")) + ts.machine_fields.append(MachineField(name="hardware")) + ts.machine_fields.append(MachineField(name="os_version")) # The only reliable order currently is the "run_order" field. We will want # to revise this over time. ts.order_fields.append(OrderField(name="llvm_project_revision", - info_key="run_order", ordinal=0)) + ordinal=0)) # We expect up to five fields per test, each with a status field. for name, type_name in (('user', 'time'), @@ -173,12 +164,11 @@ ('size', 'bytes'), ('mem', 'bytes')): status = SampleField( - name="%s_status" % (name,), type=status_sample_type, - info_key=".%s.status" % (name,)) + name="%s_status" % (name,), type=status_sample_type) ts.sample_fields.append(status) value = SampleField( name="%s_%s" % (name, type_name), type=real_sample_type, - info_key=".%s" % (name,), status_field=status) + status_field=status) ts.sample_fields.append(value) session.add(ts) Index: lnt/trunk/lnt/server/db/migrations/upgrade_4_to_5.py =================================================================== --- lnt/trunk/lnt/server/db/migrations/upgrade_4_to_5.py +++ lnt/trunk/lnt/server/db/migrations/upgrade_4_to_5.py @@ -18,8 +18,7 @@ filter_by(name="Real").first() ts = session.query(upgrade_0_to_1.TestSuite).filter_by(name='nts').first() - score = upgrade_0_to_1.SampleField(name="score", type=real_sample_type, - info_key=".score") + score = upgrade_0_to_1.SampleField(name="score", type=real_sample_type) ts.sample_fields.append(score) session.add(ts) Index: lnt/trunk/lnt/server/db/migrations/upgrade_5_to_6.py =================================================================== --- lnt/trunk/lnt/server/db/migrations/upgrade_5_to_6.py +++ lnt/trunk/lnt/server/db/migrations/upgrade_5_to_6.py @@ -22,8 +22,7 @@ ts = session.query(upgrade_0_to_1.TestSuite).filter_by(name='nts').first() mem_bytes = upgrade_0_to_1.SampleField(name="mem_bytes", - type=real_sample_type, - info_key=".mem",) + type=real_sample_type) ts.sample_fields.append(mem_bytes) session.add(ts) session.commit() Index: lnt/trunk/lnt/server/db/migrations/upgrade_6_to_7.py =================================================================== --- lnt/trunk/lnt/server/db/migrations/upgrade_6_to_7.py +++ lnt/trunk/lnt/server/db/migrations/upgrade_6_to_7.py @@ -27,11 +27,9 @@ ts = session.query(TestSuite).filter_by(name='nts').first() hash_status_field = SampleField(name="hash_status", - type=status_sample_type, - info_key=".hash.status",) + type=status_sample_type) hash_field = SampleField(name="hash", type=hash_sample_type, - info_key=".hash", status_field=hash_status_field) ts.sample_fields.append(hash_status_field) ts.sample_fields.append(hash_field) Index: lnt/trunk/lnt/server/db/migrations/upgrade_9_to_10.py =================================================================== --- lnt/trunk/lnt/server/db/migrations/upgrade_9_to_10.py +++ lnt/trunk/lnt/server/db/migrations/upgrade_9_to_10.py @@ -23,8 +23,7 @@ ts = session.query(upgrade_0_to_1.TestSuite).filter_by(name='nts').first() code_size = upgrade_0_to_1.SampleField(name="code_size", - type=real_sample_type, - info_key=".code_size",) + type=real_sample_type) ts.sample_fields.append(code_size) session.add(ts) session.commit() Index: lnt/trunk/lnt/server/db/testsuite.py =================================================================== --- lnt/trunk/lnt/server/db/testsuite.py +++ lnt/trunk/lnt/server/db/testsuite.py @@ -123,7 +123,7 @@ machine_fields = [] for field_desc in data.get('machine_fields', []): name = field_desc['name'] - field = MachineField(name, info_key=None) + field = MachineField(name) machine_fields.append(field) ts.machine_fields = machine_fields @@ -133,10 +133,10 @@ name = field_desc['name'] is_order = field_desc.get('order', False) if is_order: - field = OrderField(name, info_key=None, ordinal=0) + field = OrderField(name, ordinal=0) order_fields.append(field) else: - field = RunField(name, info_key=None) + field = RunField(name) run_fields.append(field) ts.run_fields = run_fields ts.order_fields = order_fields @@ -152,8 +152,7 @@ metric_type_name) metric_type = SampleType(metric_type_name) bigger_is_better_int = 1 if bigger_is_better else 0 - field = SampleField(name, metric_type, info_key=None, - status_field=None, + field = SampleField(name, metric_type, status_field=None, bigger_is_better=bigger_is_better_int) sample_fields.append(field) ts.sample_fields = sample_fields @@ -178,24 +177,18 @@ index=True) name = Column("Name", String(256)) - # The info key describes the key to expect this field to be present as in - # the reported machine information. Missing keys result in NULL values in - # the database. - info_key = Column("InfoKey", String(256)) - - def __init__(self, name, info_key): + def __init__(self, name): self.name = name - self.info_key = info_key # Column instance for fields which have been bound (non-DB # parameter). This is provided for convenience in querying. self.column = None def __repr__(self): - return '%s%r' % (self.__class__.__name__, (self.name, self.info_key)) + return '%s%r' % (self.__class__.__name__, (self.name, )) def duplicate(self): - return MachineField(self.name, self.info_key) + return MachineField(self.name) class OrderField(FieldMixin, Base): @@ -206,20 +199,14 @@ index=True) name = Column("Name", String(256)) - # The info key describes the key to expect this field to be present as in - # the reported machine information. Missing keys result in NULL values in - # the database. - info_key = Column("InfoKey", String(256)) - # The ordinal index this field should be used at for creating a # lexicographic ordering amongst runs. ordinal = Column("Ordinal", Integer) - def __init__(self, name, info_key, ordinal): + def __init__(self, name, ordinal): assert isinstance(ordinal, int) and ordinal >= 0 self.name = name - self.info_key = info_key self.ordinal = ordinal # Column instance for fields which have been bound (non-DB @@ -227,11 +214,10 @@ self.column = None def __repr__(self): - return '%s%r' % (self.__class__.__name__, (self.name, self.info_key, - self.ordinal)) + return '%s%r' % (self.__class__.__name__, (self.name, self.ordinal)) def duplicate(self): - return Ordinal(self.name, self.info_key, self.ordinal) + return Ordinal(self.name, self.ordinal) class RunField(FieldMixin, Base): @@ -242,24 +228,18 @@ index=True) name = Column("Name", String(256)) - # The info key describes the key to expect this field to be present as in - # the reported machine information. Missing keys result in NULL values in - # the database. - info_key = Column("InfoKey", String(256)) - - def __init__(self, name, info_key): + def __init__(self, name): self.name = name - self.info_key = info_key # Column instance for fields which have been bound (non-DB # parameter). This is provided for convenience in querying. self.column = None def __repr__(self): - return '%s%r' % (self.__class__.__name__, (self.name, self.info_key)) + return '%s%r' % (self.__class__.__name__, (self.name, )) def duplicate(self): - return RunField(self.name, self.info_key) + return RunField(self.name) class SampleField(FieldMixin, Base): @@ -274,11 +254,6 @@ type_id = Column("Type", Integer, ForeignKey('SampleType.ID')) type = relation(SampleType, lazy='immediate') - # The info key describes the key to expect this field to be present as in - # the reported machine information. Missing keys result in NULL values in - # the database. - info_key = Column("InfoKey", String(256)) - # The status field is used to create a relation to the sample field that # reports the status (pass/fail/etc.) code related to this value. This # association is used by UI code to present the two status fields together. @@ -290,11 +265,9 @@ # This assumption can be inverted by setting this column to nonzero. bigger_is_better = Column("bigger_is_better", Integer) - def __init__(self, name, type, info_key, status_field=None, - bigger_is_better=0): + def __init__(self, name, type, status_field=None, bigger_is_better=0): self.name = name self.type = type - self.info_key = info_key self.status_field = status_field self.bigger_is_better = bigger_is_better @@ -303,12 +276,11 @@ self.column = None def __repr__(self): - return '%s%r' % (self.__class__.__name__, (self.name, self.type, - self.info_key)) + return '%s%r' % (self.__class__.__name__, (self.name, self.type, )) def duplicate(self): - return SampleField(self.name, self.type, self.info_key, - self.status_field, self.bigger_is_better) + return SampleField(self.name, self.type, self.status_field, + self.bigger_is_better) def _upgrade_to(connectable, tsschema, new_schema, dry_run=False):