[LNT] r309791 - Fix more pep8 warnings; NFC
Matthias Braun via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 1 21:41:24 PDT 2017
Author: matze
Date: Tue Aug 1 21:41:24 2017
New Revision: 309791
URL: http://llvm.org/viewvc/llvm-project?rev=309791&view=rev
Log:
Fix more pep8 warnings; NFC
Modified:
lnt/trunk/lnt/lnttool/admin.py
lnt/trunk/lnt/lnttool/main.py
lnt/trunk/lnt/server/db/migrations/upgrade_0_to_1.py
lnt/trunk/lnt/server/db/migrations/upgrade_11_to_12.py
lnt/trunk/lnt/server/db/migrations/upgrade_13_to_14.py
lnt/trunk/lnt/server/db/migrations/upgrade_1_to_2.py
lnt/trunk/lnt/server/db/migrations/upgrade_2_to_3.py
lnt/trunk/lnt/server/db/migrations/upgrade_4_to_5.py
lnt/trunk/lnt/server/db/migrations/upgrade_5_to_6.py
lnt/trunk/lnt/server/db/migrations/upgrade_7_to_8.py
lnt/trunk/lnt/server/db/migrations/upgrade_9_to_10.py
lnt/trunk/lnt/server/db/migrations/util.py
lnt/trunk/lnt/server/db/rules/rule_blacklist_benchmarks_by_name.py
lnt/trunk/lnt/server/db/rules/rule_testhook.py
lnt/trunk/lnt/server/db/rules/rule_update_fixed_regressions.py
lnt/trunk/lnt/server/db/rules/rule_update_profile_stats.py
lnt/trunk/lnt/testing/util/commands.py
lnt/trunk/lnt/testing/util/compilers.py
lnt/trunk/lnt/testing/util/machineinfo.py
lnt/trunk/lnt/testing/util/misc.py
lnt/trunk/lnt/testing/util/rcs.py
lnt/trunk/lnt/testing/util/valgrind.py
lnt/trunk/lnt/util/ImportData.py
lnt/trunk/lnt/util/NTEmailReport.py
lnt/trunk/lnt/util/ServerUtil.py
lnt/trunk/lnt/util/async_ops.py
lnt/trunk/lnt/util/stats.py
lnt/trunk/lnt/util/wsgi_restart.py
Modified: lnt/trunk/lnt/lnttool/admin.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/lnttool/admin.py?rev=309791&r1=309790&r2=309791&view=diff
==============================================================================
--- lnt/trunk/lnt/lnttool/admin.py (original)
+++ lnt/trunk/lnt/lnttool/admin.py Tue Aug 1 21:41:24 2017
@@ -352,6 +352,7 @@ class AdminCLI(click.MultiCommand):
action_rm_machine,
action_rm_run,
]
+
def list_commands(self, ctx):
return [command.name for command in self._commands]
Modified: lnt/trunk/lnt/lnttool/main.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/lnttool/main.py?rev=309791&r1=309790&r2=309791&view=diff
==============================================================================
--- lnt/trunk/lnt/lnttool/main.py (original)
+++ lnt/trunk/lnt/lnttool/main.py Tue Aug 1 21:41:24 2017
@@ -121,7 +121,7 @@ def action_check_no_errors(files):
error_msg = 'Could not find run section'
break
no_errors = run_info.get('no_errors', False)
- if no_errors != True and no_errors != "True":
+ if no_errors is not True and no_errors != "True":
error_msg = 'run section does not specify "no_errors": true'
break
if error_msg is not None:
Modified: lnt/trunk/lnt/server/db/migrations/upgrade_0_to_1.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/db/migrations/upgrade_0_to_1.py?rev=309791&r1=309790&r2=309791&view=diff
==============================================================================
--- lnt/trunk/lnt/server/db/migrations/upgrade_0_to_1.py (original)
+++ lnt/trunk/lnt/server/db/migrations/upgrade_0_to_1.py Tue Aug 1 21:41:24 2017
@@ -1,6 +1,7 @@
# Version 0 is an empty database.
#
-# Version 1 is the schema state at the time when we started doing DB versioning.
+# Version 1 is the schema state at the time when we started doing DB
+# versioning.
import sqlalchemy
from sqlalchemy import *
@@ -12,16 +13,19 @@ Base = sqlalchemy.ext.declarative.declar
###
# Core Schema
+
class SampleType(Base):
__tablename__ = 'SampleType'
id = Column("ID", Integer, primary_key=True)
name = Column("Name", String(256), unique=True)
+
class StatusKind(Base):
__tablename__ = 'StatusKind'
id = Column("ID", Integer, primary_key=True, autoincrement=False)
name = Column("Name", String(256), unique=True)
+
class TestSuite(Base):
__tablename__ = 'TestSuite'
id = Column("ID", Integer, primary_key=True)
@@ -33,6 +37,7 @@ class TestSuite(Base):
run_fields = relation('RunField', backref='test_suite')
sample_fields = relation('SampleField', backref='test_suite')
+
class MachineField(Base):
__tablename__ = 'TestSuiteMachineFields'
id = Column("ID", Integer, primary_key=True)
@@ -41,6 +46,7 @@ class MachineField(Base):
name = Column("Name", String(256))
info_key = Column("InfoKey", String(256))
+
class OrderField(Base):
__tablename__ = 'TestSuiteOrderFields'
id = Column("ID", Integer, primary_key=True)
@@ -50,6 +56,7 @@ class OrderField(Base):
info_key = Column("InfoKey", String(256))
ordinal = Column("Ordinal", Integer)
+
class RunField(Base):
__tablename__ = 'TestSuiteRunFields'
id = Column("ID", Integer, primary_key=True)
@@ -58,6 +65,7 @@ class RunField(Base):
name = Column("Name", String(256))
info_key = Column("InfoKey", String(256))
+
class SampleField(Base):
__tablename__ = 'TestSuiteSampleFields'
id = Column("ID", Integer, primary_key=True)
@@ -71,6 +79,7 @@ class SampleField(Base):
'TestSuiteSampleFields.ID'))
status_field = relation('SampleField', remote_side=id)
+
def initialize_core(engine, session):
# Create the tables.
Base.metadata.create_all(engine)
@@ -92,18 +101,20 @@ def initialize_core(engine, session):
###
# NTS Testsuite Definition
+
def initialize_nts_definition(engine, session):
# Fetch the sample types.
- real_sample_type = session.query(SampleType).\
- filter_by(name = "Real").first()
- status_sample_type = session.query(SampleType).\
- filter_by(name = "Status").first()
+ real_sample_type = session.query(SampleType) \
+ .filter_by(name="Real").first()
+ status_sample_type = session.query(SampleType) \
+ .filter_by(name="Status").first()
# Create a test suite compile with "lnt runtest nt".
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="hardware",
+ info_key="hardware"))
ts.machine_fields.append(MachineField(name="os", info_key="os"))
# The only reliable order currently is the "run_order" field. We will want
@@ -113,10 +124,12 @@ def initialize_nts_definition(engine, se
# 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,
+ compile_status = SampleField(name="compile_status",
+ type=status_sample_type,
info_key=".compile.status")
compile_time = SampleField(name="compile_time", type=real_sample_type,
- info_key=".compile", status_field=compile_status)
+ info_key=".compile",
+ status_field=compile_status)
exec_status = SampleField(name="execution_status", type=status_sample_type,
info_key=".exec.status")
exec_time = SampleField(name="execution_time", type=real_sample_type,
@@ -131,18 +144,20 @@ def initialize_nts_definition(engine, se
###
# Compile Testsuite Definition
+
def initialize_compile_definition(engine, session):
# Fetch the sample types.
- real_sample_type = session.query(SampleType).\
- filter_by(name = "Real").first()
- status_sample_type = session.query(SampleType).\
- filter_by(name = "Status").first()
+ real_sample_type = session.query(SampleType) \
+ .filter_by(name="Real").first()
+ status_sample_type = session.query(SampleType) \
+ .filter_by(name="Status").first()
# Create a test suite compile with "lnt runtest compile".
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="hardware",
+ info_key="hw.model"))
ts.machine_fields.append(MachineField(name="os_version",
info_key="kern.version"))
@@ -152,17 +167,17 @@ def initialize_compile_definition(engine
info_key="run_order", ordinal=0))
# We expect up to five fields per test, each with a status field.
- for name,type_name in (('user', 'time'),
- ('sys', 'time'),
- ('wall', 'time'),
- ('size', 'bytes'),
- ('mem', 'bytes')):
+ for name, type_name in (('user', 'time'),
+ ('sys', 'time'),
+ ('wall', 'time'),
+ ('size', 'bytes'),
+ ('mem', 'bytes')):
status = SampleField(
name="%s_status" % (name,), type=status_sample_type,
info_key=".%s.status" % (name,))
ts.sample_fields.append(status)
value = SampleField(
- name="%s_%s" % (name,type_name), type=real_sample_type,
+ name="%s_%s" % (name, type_name), type=real_sample_type,
info_key=".%s" % (name,), status_field=status)
ts.sample_fields.append(value)
@@ -171,10 +186,11 @@ def initialize_compile_definition(engine
###
# Per-Testsuite Table Schema
+
def get_base_for_testsuite(test_suite):
Base = sqlalchemy.ext.declarative.declarative_base()
-
db_key_name = test_suite.db_key_name
+
class Machine(Base):
__tablename__ = db_key_name + '_Machine'
@@ -186,8 +202,8 @@ def get_base_for_testsuite(test_suite):
class_dict = locals()
for item in test_suite.machine_fields:
if item.name in class_dict:
- raise ValueError,"test suite defines reserved key %r" % (
- name,)
+ raise ValueError("test suite defines reserved key %r" %
+ (name,))
class_dict[item.name] = item.column = Column(
item.name, String(256))
@@ -205,8 +221,8 @@ def get_base_for_testsuite(test_suite):
class_dict = locals()
for item in test_suite.order_fields:
if item.name in class_dict:
- raise ValueError,"test suite defines reserved key %r" % (
- name,)
+ raise ValueError("test suite defines reserved key %r" %
+ (name,))
class_dict[item.name] = item.column = Column(
item.name, String(256))
@@ -232,8 +248,8 @@ def get_base_for_testsuite(test_suite):
class_dict = locals()
for item in test_suite.run_fields:
if item.name in class_dict:
- raise ValueError,"test suite defines reserved key %r" % (
- name,)
+ raise ValueError("test suite defines reserved key %r" %
+ (name,))
class_dict[item.name] = item.column = Column(
item.name, String(256))
@@ -278,6 +294,7 @@ def get_base_for_testsuite(test_suite):
return Base
+
def initialize_testsuite(engine, session, name):
defn = session.query(TestSuite).filter_by(name=name).first()
assert defn is not None
@@ -286,7 +303,6 @@ def initialize_testsuite(engine, session
# checking if they already exist, SA will handle that for us.
base = get_base_for_testsuite(defn).metadata.create_all(engine)
-###
def upgrade(engine):
# This upgrade script is special in that it needs to handle databases "in
Modified: lnt/trunk/lnt/server/db/migrations/upgrade_11_to_12.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/db/migrations/upgrade_11_to_12.py?rev=309791&r1=309790&r2=309791&view=diff
==============================================================================
--- lnt/trunk/lnt/server/db/migrations/upgrade_11_to_12.py (original)
+++ lnt/trunk/lnt/server/db/migrations/upgrade_11_to_12.py Tue Aug 1 21:41:24 2017
@@ -3,6 +3,7 @@
import sqlalchemy
import json
+
def update_testsuite(engine, db_key_name):
class Machine(object):
pass
@@ -10,7 +11,8 @@ def update_testsuite(engine, db_key_name
session = sqlalchemy.orm.sessionmaker(engine)()
meta = sqlalchemy.MetaData(bind=engine)
- machine_table = sqlalchemy.Table("%s_Machine" % db_key_name, meta, autoload=True)
+ machine_table = sqlalchemy.Table("%s_Machine" % db_key_name, meta,
+ autoload=True)
sqlalchemy.orm.mapper(Machine, machine_table)
all_machines = session.query(Machine)
@@ -24,6 +26,7 @@ def update_testsuite(engine, db_key_name
session.commit()
session.close()
+
def upgrade(engine):
update_testsuite(engine, 'NT')
update_testsuite(engine, 'Compile')
Modified: 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=309791&r1=309790&r2=309791&view=diff
==============================================================================
--- lnt/trunk/lnt/server/db/migrations/upgrade_13_to_14.py (original)
+++ lnt/trunk/lnt/server/db/migrations/upgrade_13_to_14.py Tue Aug 1 21:41:24 2017
@@ -51,7 +51,8 @@ def upgrade(engine):
table_renames = [
TableRename('Compile_Baseline', 'compile_Baseline'),
TableRename('Compile_ChangeIgnore', 'compile_ChangeIgnore'),
- TableRename('Compile_RegressionIndicator', 'compile_RegressionIndicator'),
+ TableRename('Compile_RegressionIndicator',
+ 'compile_RegressionIndicator'),
TableRename('Compile_FieldChange', 'compile_FieldChange'),
TableRename('Compile_FieldChangeV2', 'compile_FieldChangeV2'),
TableRename('Compile_Profile', 'compile_Profile'),
Modified: lnt/trunk/lnt/server/db/migrations/upgrade_1_to_2.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/db/migrations/upgrade_1_to_2.py?rev=309791&r1=309790&r2=309791&view=diff
==============================================================================
--- lnt/trunk/lnt/server/db/migrations/upgrade_1_to_2.py (original)
+++ lnt/trunk/lnt/server/db/migrations/upgrade_1_to_2.py Tue Aug 1 21:41:24 2017
@@ -1,5 +1,5 @@
-# Version 2 didn't actually change the database schema per-se, but we changed to
-# better support versions as run orders.
+# Version 2 didn't actually change the database schema per-se, but we changed
+# to better support versions as run orders.
#
# As part of this, we changed the compiler sniffing code to extract the full
# build information from production compilers, and it was convenient to
@@ -16,9 +16,11 @@ from lnt.util import logger
import sqlalchemy
from sqlalchemy import Table, MetaData, Column
+
def update_testsuite(engine, session, db_key_name):
class Run(object):
pass
+
class Order(object):
def __init__(self, **kwargs):
self.__dict__.update(kwargs)
@@ -39,9 +41,9 @@ def update_testsuite(engine, session, db
all_runs = session.query(Run).\
filter(sqlalchemy.not_(Run.Parameters.like(
'%["__report_version__"%'))).all()
- for i,run in enumerate(all_runs):
+ for i, run in enumerate(all_runs):
if i % 1000 == 999:
- logger.info("update run %d of %d" %(i + 1, len(all_runs)))
+ logger.info("update run %d of %d" % (i + 1, len(all_runs)))
# Extract the parameters.
run_info = dict(json.loads(run.Parameters))
@@ -52,14 +54,14 @@ def update_testsuite(engine, session, db
inferred_run_order = run_info.get('inferred_run_order')
if orig_order is None or (orig_order != inferred_run_order and
- inferred_run_order is not None):
+ inferred_run_order is not None):
continue
# Trim the whitespace on the run order.
run_order = orig_order.strip()
# If this was a production Clang build, try to recompute the src tag.
- if 'clang' in run_info.get('cc_name','') and \
+ if 'clang' in run_info.get('cc_name', '') and \
run_info.get('cc_build') == 'PROD' and \
run_info.get('cc_src_tag') and \
run_order == run_info['cc_src_tag'].strip():
@@ -75,7 +77,8 @@ def update_testsuite(engine, session, db
m = re.match(r'(.*) version ([^ ]*) (\([^(]*\))(.*)',
version_ln)
if m:
- cc_name,cc_version_num,cc_build_string,cc_extra = m.groups()
+ cc_name, cc_version_num, cc_build_string, cc_extra = \
+ m.groups()
m = re.search('clang-([0-9.]*)', cc_build_string)
if m:
run_order = m.group(1)
@@ -100,28 +103,30 @@ def update_testsuite(engine, session, db
session.add(order)
session.flush()
order_id = order.ID
-
+
run.OrderID = order_id
# Drop any now-unused orders.
logger.info("deleting unused orders")
- session.query(Order).\
- filter(sqlalchemy.not_(sqlalchemy.sql.exists().\
- where(Run.OrderID == Order.ID))).delete(
- synchronize_session=False)
+ session.query(Order) \
+ .filter(sqlalchemy.not_(sqlalchemy.sql.exists()
+ .where(Run.OrderID == Order.ID))) \
+ .delete(synchronize_session=False)
# Rebuilt all the previous/next links for the run orders.
logger.info("rebuilding run order links")
+
def parse_run_order(order):
version = order.llvm_project_revision.strip()
items = version.split('.')
- for i,item in enumerate(items):
+ for i, item in enumerate(items):
if item.isdigit():
items[i] = int(item)
return tuple(items)
+
orders = session.query(Order).all()
- orders.sort(key = parse_run_order)
- for i,order in enumerate(orders):
+ orders.sort(key=parse_run_order)
+ for i, order in enumerate(orders):
if i == 0:
order.PreviousOrder = None
else:
@@ -133,6 +138,7 @@ def update_testsuite(engine, session, db
session.flush()
+
def upgrade(engine):
# Create a session.
session = sqlalchemy.orm.sessionmaker(engine)()
@@ -140,7 +146,7 @@ def upgrade(engine):
# For each test suite...
update_testsuite(engine, session, 'NT')
update_testsuite(engine, session, 'Compile')
-
+
# Commit the results.
session.commit()
session.close()
Modified: lnt/trunk/lnt/server/db/migrations/upgrade_2_to_3.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/db/migrations/upgrade_2_to_3.py?rev=309791&r1=309790&r2=309791&view=diff
==============================================================================
--- lnt/trunk/lnt/server/db/migrations/upgrade_2_to_3.py (original)
+++ lnt/trunk/lnt/server/db/migrations/upgrade_2_to_3.py Tue Aug 1 21:41:24 2017
@@ -15,6 +15,8 @@ import lnt.server.db.migrations.upgrade_
###
# Upgrade TestSuite
+
+
def get_base(test_suite):
"""Return the schema base with field changes added."""
return add_fieldchange(test_suite)
@@ -27,23 +29,24 @@ def add_fieldchange(test_suite):
# Grab our db_key_name for our test suite so we can properly
# prefix our fields/table names.
db_key_name = test_suite.db_key_name
-
+
class FieldChange(Base):
__tablename__ = db_key_name + '_FieldChange'
- id = Column("ID", Integer, primary_key = True)
+ id = Column("ID", Integer, primary_key=True)
start_order_id = Column("StartOrderID", Integer,
- ForeignKey("%s_Order.ID" % db_key_name))
+ ForeignKey("%s_Order.ID" % db_key_name))
end_order_id = Column("EndOrderID", Integer,
- ForeignKey("%s_Order.ID" % db_key_name))
+ ForeignKey("%s_Order.ID" % db_key_name))
test_id = Column("TestID", Integer,
ForeignKey("%s_Test.ID" % db_key_name))
machine_id = Column("MachineID", Integer,
ForeignKey("%s_Machine.ID" % db_key_name))
field_id = Column("FieldID", Integer,
ForeignKey(upgrade_0_to_1.SampleField.id))
-
+
return Base
+
def upgrade_testsuite(engine, session, name):
# Grab Test Suite.
test_suite = session.query(upgrade_0_to_1.TestSuite).\
@@ -63,6 +66,7 @@ def upgrade_testsuite(engine, session, n
# respect to Postgres like databases).
session.commit()
+
def upgrade(engine):
# Create a session.
session = sqlalchemy.orm.sessionmaker(engine)()
Modified: lnt/trunk/lnt/server/db/migrations/upgrade_4_to_5.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/db/migrations/upgrade_4_to_5.py?rev=309791&r1=309790&r2=309791&view=diff
==============================================================================
--- lnt/trunk/lnt/server/db/migrations/upgrade_4_to_5.py (original)
+++ lnt/trunk/lnt/server/db/migrations/upgrade_4_to_5.py Tue Aug 1 21:41:24 2017
@@ -25,7 +25,8 @@ def upgrade(engine):
session.commit()
session.close()
- test_suite_sample_fields = introspect_table(engine, 'TestSuiteSampleFields')
+ test_suite_sample_fields = introspect_table(engine,
+ 'TestSuiteSampleFields')
set_scores = update(test_suite_sample_fields) \
.where(test_suite_sample_fields.c.Name == "score") \
Modified: lnt/trunk/lnt/server/db/migrations/upgrade_5_to_6.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/db/migrations/upgrade_5_to_6.py?rev=309791&r1=309790&r2=309791&view=diff
==============================================================================
--- lnt/trunk/lnt/server/db/migrations/upgrade_5_to_6.py (original)
+++ lnt/trunk/lnt/server/db/migrations/upgrade_5_to_6.py Tue Aug 1 21:41:24 2017
@@ -28,7 +28,8 @@ def upgrade(engine):
session.commit()
session.close()
- test_suite_sample_fields = introspect_table(engine, 'TestSuiteSampleFields')
+ test_suite_sample_fields = introspect_table(engine,
+ 'TestSuiteSampleFields')
set_mem = update(test_suite_sample_fields) \
.where(test_suite_sample_fields.c.Name == "mem_bytes") \
Modified: lnt/trunk/lnt/server/db/migrations/upgrade_7_to_8.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/db/migrations/upgrade_7_to_8.py?rev=309791&r1=309790&r2=309791&view=diff
==============================================================================
--- lnt/trunk/lnt/server/db/migrations/upgrade_7_to_8.py (original)
+++ lnt/trunk/lnt/server/db/migrations/upgrade_7_to_8.py Tue Aug 1 21:41:24 2017
@@ -30,14 +30,15 @@ def add_regressions(test_suite):
db_key_name = test_suite.db_key_name
# Replace the field change definition with a new one, the old table
# is full of bad data.
- Base.metadata.remove(Base.metadata.tables["{}_FieldChange".format(db_key_name)])
+ table_name = "{}_FieldChange".format(db_key_name)
+ Base.metadata.remove(Base.metadata.tables[table_name])
class FieldChange(Base):
"""FieldChange represents a change in between the values
of the same field belonging to two samples from consecutive runs."""
__tablename__ = db_key_name + '_FieldChangeV2'
- id = Column("ID", Integer, primary_key = True)
+ id = Column("ID", Integer, primary_key=True)
old_value = Column("OldValue", Float)
new_value = Column("NewValue", Float)
start_order_id = Column("StartOrderID", Integer,
@@ -49,11 +50,10 @@ def add_regressions(test_suite):
machine_id = Column("MachineID", Integer,
ForeignKey("%s_Machine.ID" % db_key_name))
field_id = Column("FieldID", Integer,
- ForeignKey(upgrade_0_to_1.SampleField.id))
+ ForeignKey(upgrade_0_to_1.SampleField.id))
# Could be from many runs, but most recent one is interesting.
run_id = Column("RunID", Integer,
- ForeignKey("%s_Run.ID" % db_key_name))
-
+ ForeignKey("%s_Run.ID" % db_key_name))
class Regression(Base):
"""Regession hold data about a set of RegressionIndicies."""
@@ -71,9 +71,9 @@ def add_regressions(test_suite):
regression_id = Column("RegressionID", Integer,
ForeignKey("%s_Regression.ID" % db_key_name))
- field_change_id = Column("FieldChangeID", Integer,
- ForeignKey("%s_FieldChangeV2.ID" % db_key_name))
-
+ field_change_id = Column(
+ "FieldChangeID", Integer,
+ ForeignKey("%s_FieldChangeV2.ID" % db_key_name))
class ChangeIgnore(Base):
"""Changes to ignore in the web interface."""
@@ -81,19 +81,19 @@ def add_regressions(test_suite):
__tablename__ = db_key_name + '_ChangeIgnore'
id = Column("ID", Integer, primary_key=True)
- field_change_id = Column("ChangeIgnoreID", Integer,
- ForeignKey("%s_FieldChangeV2.ID" % db_key_name))
+ field_change_id = Column(
+ "ChangeIgnoreID", Integer,
+ ForeignKey("%s_FieldChangeV2.ID" % db_key_name))
return Base
-
def upgrade_testsuite(engine, session, name):
# Grab Test Suite.
test_suite = session.query(upgrade_0_to_1.TestSuite).\
filter_by(name=name).first()
assert(test_suite is not None)
-
+
# Add FieldChange to the test suite.
Base = add_regressions(test_suite)
@@ -106,13 +106,12 @@ def upgrade_testsuite(engine, session, n
# Commit changes (also closing all relevant transactions with
# respect to Postgres like databases).
session.commit()
-
def upgrade(engine):
# Create a session.
session = sqlalchemy.orm.sessionmaker(engine)()
-
+
# Create our FieldChangeField table and commit.
upgrade_testsuite(engine, session, 'nts')
upgrade_testsuite(engine, session, 'compile')
Modified: lnt/trunk/lnt/server/db/migrations/upgrade_9_to_10.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/db/migrations/upgrade_9_to_10.py?rev=309791&r1=309790&r2=309791&view=diff
==============================================================================
--- lnt/trunk/lnt/server/db/migrations/upgrade_9_to_10.py (original)
+++ lnt/trunk/lnt/server/db/migrations/upgrade_9_to_10.py Tue Aug 1 21:41:24 2017
@@ -29,7 +29,8 @@ def upgrade(engine):
session.commit()
session.close()
- test_suite_sample_fields = introspect_table(engine, 'TestSuiteSampleFields')
+ test_suite_sample_fields = introspect_table(engine,
+ 'TestSuiteSampleFields')
update_code_size = update(test_suite_sample_fields) \
.where(test_suite_sample_fields.c.Name == "code_size") \
.values(bigger_is_better=0)
Modified: lnt/trunk/lnt/server/db/migrations/util.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/db/migrations/util.py?rev=309791&r1=309790&r2=309791&view=diff
==============================================================================
--- lnt/trunk/lnt/server/db/migrations/util.py (original)
+++ lnt/trunk/lnt/server/db/migrations/util.py Tue Aug 1 21:41:24 2017
@@ -13,8 +13,8 @@ class _AddColumn(DDLElement):
@compiles(_AddColumn)
def _visit_add_column(element, compiler, **kw):
return ("ALTER TABLE %s ADD COLUMN %s" %
- (compiler.preparer.format_table(element.table),
- compiler.get_column_specification(element.column)))
+ (compiler.preparer.format_table(element.table),
+ compiler.get_column_specification(element.column)))
class _RenameTable(DDLElement):
@@ -26,12 +26,13 @@ class _RenameTable(DDLElement):
@compiles(_RenameTable)
def _visite_rename_table(element, compiler, **kw):
return ("ALTER TABLE %s RENAME TO %s" %
- (compiler.preparer.quote(element.old_name),
- compiler.preparer.quote(element.new_name)))
+ (compiler.preparer.quote(element.old_name),
+ compiler.preparer.quote(element.new_name)))
def add_column(engine, table, column):
- # type: (sqlalchemy.engine.Engine, sqlalchemy.Table, sqlalchemy.Column) -> None
+ # type: (sqlalchemy.engine.Engine, sqlalchemy.Table, sqlalchemy.Column)
+ # -> None
"""Add this column to the table.
This is a stopgap to a real migration system. Inspect the Column pass
Modified: lnt/trunk/lnt/server/db/rules/rule_blacklist_benchmarks_by_name.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/db/rules/rule_blacklist_benchmarks_by_name.py?rev=309791&r1=309790&r2=309791&view=diff
==============================================================================
--- lnt/trunk/lnt/server/db/rules/rule_blacklist_benchmarks_by_name.py (original)
+++ lnt/trunk/lnt/server/db/rules/rule_blacklist_benchmarks_by_name.py Tue Aug 1 21:41:24 2017
@@ -20,7 +20,7 @@ def _populate_blacklist():
path = current_app.old_config.blacklist
except RuntimeError:
path = os.path.join(os.path.dirname(sys.argv[0]), "blacklist")
-
+
if path and os.path.isfile(path):
logger.info("Loading blacklist file: {}".format(path))
with open(path, 'r') as f:
@@ -48,5 +48,6 @@ def filter_by_benchmark_name(ts, field_c
.format(full_name, regex.pattern))
return False
return True
-
+
+
is_useful_change = filter_by_benchmark_name
Modified: lnt/trunk/lnt/server/db/rules/rule_testhook.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/db/rules/rule_testhook.py?rev=309791&r1=309790&r2=309791&view=diff
==============================================================================
--- lnt/trunk/lnt/server/db/rules/rule_testhook.py (original)
+++ lnt/trunk/lnt/server/db/rules/rule_testhook.py Tue Aug 1 21:41:24 2017
@@ -5,5 +5,5 @@ Test rule system. A simple rules, with o
def test():
return "Foo."
-
+
post_test_hook = test
Modified: lnt/trunk/lnt/server/db/rules/rule_update_fixed_regressions.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/db/rules/rule_update_fixed_regressions.py?rev=309791&r1=309790&r2=309791&view=diff
==============================================================================
--- lnt/trunk/lnt/server/db/rules/rule_update_fixed_regressions.py (original)
+++ lnt/trunk/lnt/server/db/rules/rule_update_fixed_regressions.py Tue Aug 1 21:41:24 2017
@@ -7,6 +7,7 @@ from lnt.server.db.regression import get
from lnt.util import logger
from lnt.testing.util.commands import timed
+
def _fixed_rind(ts, rind):
"""Is this regression indicator fixed?"""
fc = rind.field_change
@@ -18,6 +19,7 @@ def _fixed_rind(ts, rind):
else:
return False
+
def is_fixed(ts, regression):
"""Comparing the current value to the regression, is this regression now
fixed?
@@ -32,13 +34,16 @@ def regression_evolution(ts, run_id):
"""Analyse regressions. If they have changes, process them.
Look at each regression in state detect. Move to ignore if it is fixed.
Look at each regression in state stage. Move to verify if fixed.
- Look at regressions in detect, do they match our policy? If no, move to NTBF.
-
+ Look at regressions in detect, do they match our policy? If no, move to
+ NTBF.
"""
logger.info("Running regression evolution")
changed = 0
- evolve_states = [RegressionState.DETECTED, RegressionState.STAGED, RegressionState.ACTIVE]
- regressions = ts.query(ts.Regression).filter(ts.Regression.state.in_(evolve_states)).all()
+ evolve_states = [RegressionState.DETECTED, RegressionState.STAGED,
+ RegressionState.ACTIVE]
+ regressions = ts.query(ts.Regression) \
+ .filter(ts.Regression.state.in_(evolve_states)) \
+ .all()
detects = [r for r in regressions if r.state == RegressionState.DETECTED]
staged = [r for r in regressions if r.state == RegressionState.STAGED]
@@ -66,5 +71,5 @@ def regression_evolution(ts, run_id):
changed += 1
ts.commit()
logger.info("Changed the state of {} regressions".format(changed))
-
+
post_submission_hook = regression_evolution
Modified: lnt/trunk/lnt/server/db/rules/rule_update_profile_stats.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/db/rules/rule_update_profile_stats.py?rev=309791&r1=309790&r2=309791&view=diff
==============================================================================
--- lnt/trunk/lnt/server/db/rules/rule_update_profile_stats.py (original)
+++ lnt/trunk/lnt/server/db/rules/rule_update_profile_stats.py Tue Aug 1 21:41:24 2017
@@ -2,7 +2,13 @@
Post submission hook to write the current state of the profiles directory. This
gets fed into the profile/admin page.
"""
-import json, datetime, os, subprocess, glob, time
+import datetime
+import glob
+import json
+import os
+import subprocess
+import time
+
def update_profile_stats(ts, run_id):
config = ts.v4db.config
@@ -23,7 +29,7 @@ def update_profile_stats(ts, run_id):
dt = time.time()
blocks = subprocess.check_output("du -s -k %s" % profile_path,
shell=True).split('\t')[0]
- kb = float(blocks) # 1024 byte blocks.
+ kb = float(blocks) # 1024 byte blocks.
history.append((dt, kb))
@@ -31,7 +37,7 @@ def update_profile_stats(ts, run_id):
mtime = os.stat(f).st_mtime
sz = os.stat(f).st_size / 1000
age.append([mtime, sz])
-
+
open(history_path, 'w').write(json.dumps(history))
open(age_path, 'w').write(json.dumps(age))
Modified: lnt/trunk/lnt/testing/util/commands.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/testing/util/commands.py?rev=309791&r1=309790&r2=309791&view=diff
==============================================================================
--- lnt/trunk/lnt/testing/util/commands.py (original)
+++ lnt/trunk/lnt/testing/util/commands.py Tue Aug 1 21:41:24 2017
@@ -49,10 +49,11 @@ def mkdir_p(path):
try:
os.makedirs(path)
except OSError as e:
- # Ignore EEXIST, which may occur during a race condition.
+ # Ignore EEXIST, which may occur during a race condition.
if e.errno != errno.EEXIST:
raise
+
def capture_with_result(args, include_stderr=False):
import subprocess
"""capture_with_result(command) -> (output, exit code)
@@ -64,13 +65,14 @@ def capture_with_result(args, include_st
stderr = subprocess.STDOUT
try:
p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=stderr)
- except OSError,e:
+ except OSError as e:
if e.errno == errno.ENOENT:
- fatal('no such file or directory: %r when running %s.' % (args[0], \
- ' '.join(args)))
+ fatal('no such file or directory: %r when running %s.' %
+ (args[0], ' '.join(args)))
raise
- out,_ = p.communicate()
- return out,p.wait()
+ out, _ = p.communicate()
+ return out, p.wait()
+
def capture(args, include_stderr=False):
import subprocess
@@ -78,12 +80,13 @@ def capture(args, include_stderr=False):
return the standard output."""
return capture_with_result(args, include_stderr)[0]
-def which(command, paths = None):
+
+def which(command, paths=None):
"""which(command, [paths]) - Look up the given command in the paths string
(or the PATH environment variable, if unspecified)."""
if paths is None:
- paths = os.environ.get('PATH','')
+ paths = os.environ.get('PATH', '')
# Check for absolute match first.
if os.path.exists(command):
@@ -105,6 +108,7 @@ def which(command, paths = None):
return None
+
def resolve_command_path(name):
"""Try to make the name/path given into an absolute path to an
executable.
@@ -123,6 +127,7 @@ def resolve_command_path(name):
# If that failed just return the original name.
return name
+
def isexecfile(path):
"""Does this path point to a valid executable?
Modified: lnt/trunk/lnt/testing/util/compilers.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/testing/util/compilers.py?rev=309791&r1=309790&r2=309791&view=diff
==============================================================================
--- lnt/trunk/lnt/testing/util/compilers.py (original)
+++ lnt/trunk/lnt/testing/util/compilers.py Tue Aug 1 21:41:24 2017
@@ -8,6 +8,7 @@ from commands import capture
from commands import fatal
from commands import rm_f
+
def ishexhash(string):
return len(string) == 40 and \
len([c
@@ -23,8 +24,8 @@ def is_valid(path):
def get_cc_info(path, cc_flags=[]):
"""get_cc_info(path) -> { ... }
- Extract various information on the given compiler and return a dictionary of
- the results."""
+ Extract various information on the given compiler and return a dictionary
+ of the results."""
cc = path
@@ -34,8 +35,8 @@ def get_cc_info(path, cc_flags=[]):
include_stderr=True).strip()
# Determine the assembler version, as found by the compiler.
- cc_as_version = capture([cc, "-c", '-Wa,-v', '-o', '/dev/null'] + cc_flags +
- ['-x', 'assembler', '/dev/null'],
+ cc_as_version = capture([cc, "-c", '-Wa,-v', '-o', '/dev/null'] +
+ cc_flags + ['-x', 'assembler', '/dev/null'],
include_stderr=True).strip()
# Determine the linker version, as found by the compiler.
@@ -87,12 +88,12 @@ def get_cc_info(path, cc_flags=[]):
else:
m = re.match(r'(.*) version ([^ ]*) +(\([^(]*\))(.*)', version_ln)
if m is not None:
- cc_name,cc_version_num,cc_build_string,cc_extra = m.groups()
+ cc_name, cc_version_num, cc_build_string, cc_extra = m.groups()
else:
# If that didn't match, try a more basic pattern.
m = re.match(r'(.*) version ([^ ]*)', version_ln)
if m is not None:
- cc_name,cc_version_num = m.groups()
+ cc_name, cc_version_num = m.groups()
else:
logger.error("unable to determine compiler version: %r: %r" %
(cc, version_ln))
@@ -122,7 +123,8 @@ def get_cc_info(path, cc_flags=[]):
else:
logger.error('unable to determine gcc build version: %r' %
cc_build_string)
- elif (cc_name in ('clang', 'LLVM', 'Debian clang', 'Apple clang', 'Apple LLVM') and
+ elif (cc_name in ('clang', 'LLVM', 'Debian clang', 'Apple clang',
+ 'Apple LLVM') and
(cc_extra == '' or 'based on LLVM' in cc_extra or
(cc_extra.startswith('(') and cc_extra.endswith(')')))):
llvm_capable = True
@@ -133,10 +135,11 @@ def get_cc_info(path, cc_flags=[]):
m = re.match(r'\(([^ ]*)( ([0-9]+))?\)', cc_build_string)
if m:
- cc_src_branch,_,cc_src_revision = m.groups()
+ cc_src_branch, _, cc_src_revision = m.groups()
# With a CMake build, the branch is not emitted.
- if cc_src_branch and not cc_src_revision and cc_src_branch.isdigit():
+ if cc_src_branch and not cc_src_revision and \
+ cc_src_branch.isdigit():
cc_src_revision = cc_src_branch
cc_src_branch = ""
@@ -144,11 +147,11 @@ def get_cc_info(path, cc_flags=[]):
if cc_src_branch == '$URL$':
cc_src_branch = ""
else:
- # Otherwise, see if we can match a branch and a tag name. That could
- # be a git hash.
+ # Otherwise, see if we can match a branch and a tag name. That
+ # could be a git hash.
m = re.match(r'\((.+) ([^ ]+)\)', cc_build_string)
if m:
- cc_src_branch,cc_src_revision = m.groups()
+ cc_src_branch, cc_src_revision = m.groups()
else:
logger.error('unable to determine '
'Clang development build info: %r' %
@@ -171,17 +174,18 @@ def get_cc_info(path, cc_flags=[]):
if cc_extra.startswith('(') and cc_extra.endswith(')'):
m = re.match(r'\((.+) ([^ ]+)\)', cc_extra)
if m:
- cc_alt_src_branch,cc_alt_src_revision = m.groups()
+ cc_alt_src_branch, cc_alt_src_revision = m.groups()
# With a CMake build, the branch is not emitted.
- if cc_src_branch and not cc_src_revision and cc_src_branch.isdigit():
+ if cc_src_branch and not cc_src_revision and \
+ cc_src_branch.isdigit():
cc_alt_src_revision = cc_alt_src_branch
cc_alt_src_branch = ""
-
+
else:
logger.error('unable to determine '
- 'Clang development build info: %r' % (
- (cc_name, cc_build_string, cc_extra),))
+ 'Clang development build info: %r' %
+ ((cc_name, cc_build_string, cc_extra), ))
elif cc_name == 'gcc' and 'LLVM build' in cc_extra:
llvm_capable = True
@@ -211,22 +215,23 @@ def get_cc_info(path, cc_flags=[]):
(cc, cc_target_assembly))
cc_exec_hash = hashlib.sha1()
- cc_exec_hash.update(open(cc,'rb').read())
+ cc_exec_hash.update(open(cc, 'rb').read())
- info = { 'cc_build' : cc_build,
- 'cc_name' : cc_norm_name,
- 'cc_version_number' : cc_version_num,
- 'cc_dumpmachine' : cc_dumpmachine,
- 'cc_target' : cc_target,
- 'cc_version' :cc_version,
- 'cc_exec_hash' : cc_exec_hash.hexdigest(),
- 'cc_as_version' : cc_as_version,
- 'cc_ld_version' : cc_ld_version,
- 'cc_target_assembly' : cc_target_assembly,
- }
+ info = {
+ 'cc_build': cc_build,
+ 'cc_name': cc_norm_name,
+ 'cc_version_number': cc_version_num,
+ 'cc_dumpmachine': cc_dumpmachine,
+ 'cc_target': cc_target,
+ 'cc_version': cc_version,
+ 'cc_exec_hash': cc_exec_hash.hexdigest(),
+ 'cc_as_version': cc_as_version,
+ 'cc_ld_version': cc_ld_version,
+ 'cc_target_assembly': cc_target_assembly,
+ }
if cc1_binary is not None and os.path.exists(cc1_binary):
cc1_exec_hash = hashlib.sha1()
- cc1_exec_hash.update(open(cc1_binary,'rb').read())
+ cc1_exec_hash.update(open(cc1_binary, 'rb').read())
info['cc1_exec_hash'] = cc1_exec_hash.hexdigest()
if cc_src_tag is not None:
info['cc_src_tag'] = cc_src_tag
@@ -244,33 +249,34 @@ def get_cc_info(path, cc_flags=[]):
return info
+
def get_inferred_run_order(info):
# If the CC has an integral src revision, use that.
if info.get('cc_src_revision', '').isdigit():
order = int(info['cc_src_revision'])
# If the CC has an alt src revision, use that if it is greater:
- if info.get('cc_alt_src_revision','').isdigit():
+ if info.get('cc_alt_src_revision', '').isdigit():
order = max(order, int(info.get('cc_alt_src_revision')))
return str(order)
# Otherwise if we have a git hash, use that
- if ishexhash(info.get('cc_src_revision','')):
+ if ishexhash(info.get('cc_src_revision', '')):
# If we also have an alt src revision, combine them.
#
# We don't try and support a mix of integral and hash revisions.
- if ishexhash(info.get('cc_alt_src_revision','')):
+ if ishexhash(info.get('cc_alt_src_revision', '')):
return '%s,%s' % (info['cc_src_revision'],
info['cc_alt_src_revision'])
return info['cc_src_revision']
- # If this is a production compiler, look for a source tag. We don't accept 0
- # or 9999 as valid source tag, since that is what llvm-gcc builds use when
- # no build number is given.
+ # If this is a production compiler, look for a source tag. We don't accept
+ # 0 or 9999 as valid source tag, since that is what llvm-gcc builds use
+ # when no build number is given.
if info.get('cc_build') == 'PROD':
- m = re.match(r'^[0-9]+(.[0-9]+)*$', info.get('cc_src_tag',''))
+ m = re.match(r'^[0-9]+(.[0-9]+)*$', info.get('cc_src_tag', ''))
if m:
return m.group(0)
@@ -278,13 +284,14 @@ def get_inferred_run_order(info):
#
# FIXME: This is only used when using llvm source builds with 'lnt runtest
# nt', which itself is deprecated. We should remove this eventually.
- if info.get('llvm_revision','').isdigit():
+ if info.get('llvm_revision', '').isdigit():
return info['llvm_revision']
- # Otherwise, force at least some value for run_order, as it is now generally
- # required by parts of the "simple" schema.
+ # Otherwise, force at least some value for run_order, as it is now
+ # generally required by parts of the "simple" schema.
return '0'
+
def infer_cxx_compiler(cc_path):
# If this is obviously a compiler name, then try replacing with the '++'
# name.
@@ -317,7 +324,9 @@ def infer_cxx_compiler(cc_path):
o__all__ = ['get_cc_info', 'infer_cxx_compiler']
+
if __name__ == '__main__':
- import pprint, sys
+ import pprint
+ import sys
pprint.pprint(('get_cc_info', get_cc_info(sys.argv[1], sys.argv[2:])))
pprint.pprint(('infer_cxx_compiler', infer_cxx_compiler(sys.argv[1])))
Modified: lnt/trunk/lnt/testing/util/machineinfo.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/testing/util/machineinfo.py?rev=309791&r1=309790&r2=309791&view=diff
==============================================================================
--- lnt/trunk/lnt/testing/util/machineinfo.py (original)
+++ lnt/trunk/lnt/testing/util/machineinfo.py Tue Aug 1 21:41:24 2017
@@ -55,13 +55,13 @@ sysctl_info_table = [
('hw.physicalcpu_max', 'machine'),
('hw.physmem', 'machine'),
('hw.tbfrequency', 'machine'),
- ('hw.usermem', 'run' ),
+ ('hw.usermem', 'run'),
('hw.vectorunit', 'machine'),
('kern.aiomax', 'machine'),
('kern.aioprocmax', 'machine'),
('kern.aiothreads', 'machine'),
('kern.argmax', 'machine'),
- ('kern.boottime', 'run' ),
+ ('kern.boottime', 'run'),
('kern.clockrate: hz', 'machine'),
('kern.coredump', 'machine'),
('kern.corefile', 'machine'),
@@ -141,7 +141,8 @@ sysctl_info_table = [
('machdep.cpu.tlb.inst.large', 'machine'),
('machdep.cpu.tlb.inst.small', 'machine'),
('machdep.cpu.vendor', 'machine'),
- ]
+]
+
def _get_mac_addresses():
lines = capture(['ifconfig']).strip()
@@ -151,24 +152,25 @@ def _get_mac_addresses():
if current_ifc is None:
fatal('unexpected ifconfig output')
if ln.startswith('\tether '):
- yield current_ifc,ln[len('\tether '):].strip()
+ yield current_ifc, ln[len('\tether '):].strip()
else:
current_ifc, = re.match(r'([A-Za-z0-9]*): .*', ln).groups()
-def get_machine_information(use_machine_dependent_info = False):
+
+def get_machine_information(use_machine_dependent_info=False):
machine_info = {}
run_info = {}
info_targets = {
- 'machdep' : (run_info, machine_info)[
- use_machine_dependent_info],
- 'machine' : machine_info,
- 'run' : run_info }
- for name,target in sysctl_info_table:
- info_targets[target][name] = capture(['sysctl','-n',name],
+ 'machdep': (run_info, machine_info)[use_machine_dependent_info],
+ 'machine': machine_info,
+ 'run': run_info,
+ }
+ for name, target in sysctl_info_table:
+ info_targets[target][name] = capture(['sysctl', '-n', name],
include_stderr=True).strip()
- for ifc,addr in _get_mac_addresses():
+ for ifc, addr in _get_mac_addresses():
# Ignore virtual machine mac addresses.
if ifc.startswith('vmnet'):
continue
Modified: lnt/trunk/lnt/testing/util/misc.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/testing/util/misc.py?rev=309791&r1=309790&r2=309791&view=diff
==============================================================================
--- lnt/trunk/lnt/testing/util/misc.py (original)
+++ lnt/trunk/lnt/testing/util/misc.py Tue Aug 1 21:41:24 2017
@@ -1,9 +1,10 @@
import datetime
+
class TeeStream(object):
"""File-like object for writing to multiple output streams."""
- def __init__(self, a, b, noclose_b = False):
+ def __init__(self, a, b, noclose_b=False):
self.a = a
self.b = b
self.noclose_b = noclose_b
@@ -26,5 +27,6 @@ class TeeStream(object):
self.a.flush()
self.b.flush()
+
def timestamp():
return datetime.datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S')
Modified: lnt/trunk/lnt/testing/util/rcs.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/testing/util/rcs.py?rev=309791&r1=309790&r2=309791&view=diff
==============================================================================
--- lnt/trunk/lnt/testing/util/rcs.py (original)
+++ lnt/trunk/lnt/testing/util/rcs.py Tue Aug 1 21:41:24 2017
@@ -4,6 +4,8 @@ from lnt.util import logger
from lnt.testing.util import commands
_git_svn_id_re = re.compile("^ git-svn-id: [^@]*@([0-9]+) .*$")
+
+
def get_source_version(path):
"""get_source_version(path) -> str or None
Modified: lnt/trunk/lnt/testing/util/valgrind.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/testing/util/valgrind.py?rev=309791&r1=309790&r2=309791&view=diff
==============================================================================
--- lnt/trunk/lnt/testing/util/valgrind.py (original)
+++ lnt/trunk/lnt/testing/util/valgrind.py Tue Aug 1 21:41:24 2017
@@ -7,9 +7,11 @@ from lnt.util import logger
# http://valgrind.org/docs/manual/cl-format.html#cl-format.overview
# for reference on the calltree data format specification.
+
class CalltreeParseError(Exception):
pass
+
class CalltreeData(object):
@staticmethod
def frompath(path):
@@ -34,7 +36,7 @@ class CalltreeData(object):
if ':' not in ln:
break
- key,value = ln.split(':', 1)
+ key, value = ln.split(':', 1)
if key == 'desc':
description_lines.append(value.strip())
elif key == 'cmd':
@@ -71,7 +73,7 @@ class CalltreeData(object):
for ln in it:
# Check if this is the closing summary line.
if ln.startswith('summary'):
- key,value = ln.split(':', 1)
+ key, value = ln.split(':', 1)
summary_samples = map(int, value.split())
break
@@ -96,7 +98,8 @@ class CalltreeData(object):
# Validate that the summary line was present.
if summary_samples is None:
- raise CalltreeParseError("missing required 'summary' key in footer")
+ raise CalltreeParseError(
+ "missing required 'summary' key in footer")
data.summary = summary_samples
Modified: lnt/trunk/lnt/util/ImportData.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/util/ImportData.py?rev=309791&r1=309790&r2=309791&view=diff
==============================================================================
--- lnt/trunk/lnt/util/ImportData.py (original)
+++ lnt/trunk/lnt/util/ImportData.py Tue Aug 1 21:41:24 2017
@@ -11,6 +11,7 @@ import re
import tempfile
import time
+
def import_and_report(config, db_name, db, file, format, ts_name,
commit=False, show_sample_count=False,
disable_email=False, disable_report=False,
@@ -25,8 +26,8 @@ def import_and_report(config, db_name, d
the value of commit, this merely changes whether the run (on success) is
committed to the database.
- The result object is a dictionary containing information on the imported run
- and its comparison to the previous run.
+ The result object is a dictionary containing information on the imported
+ run and its comparison to the previous run.
"""
result = {
'success': False,
@@ -42,7 +43,8 @@ def import_and_report(config, db_name, d
numRuns = ts.getNumRuns()
numTests = ts.getNumTests()
- # If the database gets fragmented, count(*) in SQLite can get really slow!?!
+ # If the database gets fragmented, count(*) in SQLite can get really
+ # slow!?!
if show_sample_count:
numSamples = ts.getNumSamples()
@@ -74,7 +76,7 @@ def import_and_report(config, db_name, d
email_config = db_config.email_config
if email_config.enabled:
# Find the machine name.
- machineName = str(data.get('Machine',{}).get('Name'))
+ machineName = str(data.get('Machine', {}).get('Name'))
toAddress = email_config.get_to_address(machineName)
if toAddress is None:
result['error'] = ("unable to match machine name "
@@ -153,8 +155,8 @@ def import_and_report(config, db_name, d
shadow_name = db_config.shadow_import
with closing(config.get_database(shadow_name)) as shadow_db:
if shadow_db is None:
- raise ValueError, ("invalid configuration, shadow import "
- "database %r does not exist") % shadow_name
+ raise ValueError("invalid configuration, shadow import "
+ "database %r does not exist" % shadow_name)
# Perform the shadow import.
shadow_result = import_and_report(config, shadow_name,
@@ -179,7 +181,7 @@ def no_submit():
}
-def print_report_result(result, out, err, verbose = True):
+def print_report_result(result, out, err, verbose=True):
"""
print_report_result(result, out, [err], [verbose]) -> None
@@ -202,7 +204,7 @@ def print_report_result(result, out, err
print >>err, "--------------"
err.flush()
return
-
+
# Print the test results.
test_results = result.get('test_results')
if not test_results:
@@ -213,7 +215,7 @@ def print_report_result(result, out, err
if show_pset:
print >>out, "Parameter Sets"
print >>out, "--------------"
- for i,info in enumerate(test_results):
+ for i, info in enumerate(test_results):
print >>out, "P%d: %s" % (i, info['pset'])
print >>out
@@ -222,18 +224,18 @@ def print_report_result(result, out, err
print >>out, "--- Tested: %d tests --" % total_num_tests
test_index = 0
result_kinds = collections.Counter()
- for i,item in enumerate(test_results):
+ for i, item in enumerate(test_results):
pset = item['pset']
pset_results = item['results']
- for name,test_status,perf_status in pset_results:
+ for name, test_status, perf_status in pset_results:
test_index += 1
- # FIXME: Show extended information for performance changes, previous
- # samples, standard deviation, all that.
+ # FIXME: Show extended information for performance changes,
+ # previous samples, standard deviation, all that.
#
# FIXME: Think longer about mapping to test codes.
result_info = None
-
+
if test_status == lnt.server.reporting.analysis.REGRESSED:
result_string = 'FAIL'
elif test_status == lnt.server.reporting.analysis.UNCHANGED_FAIL:
@@ -241,7 +243,7 @@ def print_report_result(result, out, err
elif test_status == lnt.server.reporting.analysis.IMPROVED:
result_string = 'IMPROVED'
result_info = "Test started passing."
- elif perf_status == None:
+ elif perf_status is None:
# Missing perf status means test was just added or removed.
result_string = 'PASS'
elif perf_status == lnt.server.reporting.analysis.REGRESSED:
@@ -259,8 +261,8 @@ def print_report_result(result, out, err
if show_pset:
name = 'P%d :: %s' % (i, name)
- print >>out, "%s: %s (%d of %d)" % (result_string, name, test_index,
- total_num_tests)
+ print >>out, "%s: %s (%d of %d)" % (result_string, name,
+ test_index, total_num_tests)
if result_info:
print >>out, "%s TEST '%s' %s" % ('*'*20, name, '*'*20)
@@ -321,15 +323,15 @@ def import_from_string(config, db_name,
"%04d-%02d" % (utcnow.year, utcnow.month))
try:
os.makedirs(tmpdir)
- except OSError,e:
+ except OSError as e:
pass
# Save the file under a name prefixed with the date, to make it easier
# to use these files in cases we might need them for debugging or data
# recovery.
prefix = utcnow.strftime("data-%Y-%m-%d_%H-%M-%S")
- fd,path = tempfile.mkstemp(prefix=prefix, suffix='.json',
- dir=str(tmpdir))
+ fd, path = tempfile.mkstemp(prefix=prefix, suffix='.json',
+ dir=str(tmpdir))
os.write(fd, data)
os.close(fd)
@@ -338,7 +340,7 @@ def import_from_string(config, db_name,
# FIXME: Gracefully handle formats failures and DOS attempts. We
# should at least reject overly large inputs.
- result = lnt.util.ImportData.import_and_report(config, db_name, db,
- path, '<auto>', ts_name, commit, updateMachine=updateMachine,
- mergeRun=mergeRun)
+ result = lnt.util.ImportData.import_and_report(
+ config, db_name, db, path, '<auto>', ts_name, commit,
+ updateMachine=updateMachine, mergeRun=mergeRun)
return result
Modified: lnt/trunk/lnt/util/NTEmailReport.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/util/NTEmailReport.py?rev=309791&r1=309790&r2=309791&view=diff
==============================================================================
--- lnt/trunk/lnt/util/NTEmailReport.py (original)
+++ lnt/trunk/lnt/util/NTEmailReport.py Tue Aug 1 21:41:24 2017
@@ -7,6 +7,7 @@ import StringIO
import lnt.server.db.v4db
import lnt.server.reporting.runs
+
def emailReport(result, db, run, baseurl, email_config, to, was_added=True):
import email.mime.multipart
import email.mime.text
@@ -42,11 +43,13 @@ def emailReport(result, db, run, baseurl
s.sendmail(email_config.from_address, [to], msg.as_string())
s.quit()
+
def _getReport(result, db, run, baseurl, was_added, compare_to=None):
assert isinstance(db, lnt.server.db.v4db.V4DB)
- data = lnt.server.reporting.runs.generate_run_data(run, baseurl=baseurl,
- result=result, compare_to=compare_to, num_comparison_runs=10)
+ data = lnt.server.reporting.runs.generate_run_data(
+ run, baseurl=baseurl, result=result, compare_to=compare_to,
+ num_comparison_runs=10)
env = lnt.server.ui.app.create_jinja_environment()
text_template = env.get_template('reporting/run_report.txt')
Modified: lnt/trunk/lnt/util/ServerUtil.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/util/ServerUtil.py?rev=309791&r1=309790&r2=309791&view=diff
==============================================================================
--- lnt/trunk/lnt/util/ServerUtil.py (original)
+++ lnt/trunk/lnt/util/ServerUtil.py Tue Aug 1 21:41:24 2017
@@ -1,7 +1,6 @@
"""
Utility for submitting files to a web server over HTTP.
"""
-
import plistlib
import sys
import urllib
@@ -13,10 +12,11 @@ import lnt.server.instance
from lnt.util import ImportData
# FIXME: I used to maintain this file in such a way that it could be used
-# separate from LNT to do submission. This could be useful for adapting an older
-# system to report to LNT, for example. It might be nice to factor the
+# separate from LNT to do submission. This could be useful for adapting an
+# older system to report to LNT, for example. It might be nice to factor the
# simplified submit code into a separate utility.
+
def _show_json_error(reply):
try:
error = json.loads(reply)
@@ -28,11 +28,12 @@ def _show_json_error(reply):
if message:
sys.stderr.write(message + '\n')
+
def submitFileToServer(url, file, commit, updateMachine, mergeRun):
with open(file, 'rb') as f:
values = {
- 'input_data' : f.read(),
- 'commit' : "1" if commit else "0",
+ 'input_data': f.read(),
+ 'commit': "1" if commit else "0",
'update_machine': "1" if updateMachine else "0",
'merge': mergeRun,
}
Modified: lnt/trunk/lnt/util/async_ops.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/util/async_ops.py?rev=309791&r1=309790&r2=309791&view=diff
==============================================================================
--- lnt/trunk/lnt/util/async_ops.py (original)
+++ lnt/trunk/lnt/util/async_ops.py Tue Aug 1 21:41:24 2017
@@ -1,7 +1,7 @@
"""Asynchrounus operations for LNT.
For big tasks it is nice to be able to run in the backgorund. This module
-contains wrappers to run particular LNT tasks in subprocesess.
+contains wrappers to run particular LNT tasks in subprocesess.
Because multiprocessing cannot directly use the LNT test-suite objects in
subprocesses (because they are not serializable because they don't have a fix
@@ -51,6 +51,7 @@ def launch_workers():
finally:
WORKERS_LOCK.release()
+
def sig_handler(signo, frame):
cleanup()
sys.exit(0)
@@ -121,14 +122,14 @@ clean_db = False
def async_wrapper(job, ts_args, func_args):
"""Setup test-suite in this subprocess and run something.
-
+
Because of multipocessing, capture excptions and log messages,
and return them.
"""
global clean_db
try:
start_time = time.time()
-
+
if not clean_db:
lnt.server.db.v4db.V4DB.close_all_engines()
clean_db = True
@@ -137,14 +138,14 @@ def async_wrapper(job, ts_args, func_arg
str(os.getpid()))
config = ts_args['db_info']
_v4db = config.get_database(ts_args['db'])
- #with contextlib.closing(_v4db) as db:
+ # with contextlib.closing(_v4db) as db:
ts = _v4db.testsuite[ts_args['tsname']]
nothing = job(ts, **func_args)
assert nothing is None
end_time = time.time()
delta = end_time-start_time
msg = "Finished: {name} in {time:.2f}s ".format(name=job.__name__,
- time=delta)
+ time=delta)
if delta < 100:
logger.info(msg)
else:
@@ -160,6 +161,7 @@ def async_wrapper(job, ts_args, func_arg
def make_callback():
app = current_app
+
def async_job_finished(arg):
if isinstance(arg, Exception):
logger.error(str(arg))
Modified: lnt/trunk/lnt/util/stats.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/util/stats.py?rev=309791&r1=309790&r2=309791&view=diff
==============================================================================
--- lnt/trunk/lnt/util/stats.py (original)
+++ lnt/trunk/lnt/util/stats.py Tue Aug 1 21:41:24 2017
@@ -5,26 +5,29 @@ from lnt.external.stats.stats import man
def safe_min(l):
"""Calculate min, but if given an empty list return None."""
- l = list(l) #In case this is a complex type, get a simple list.
+ l = list(l) # In case this is a complex type, get a simple list.
if not l:
return None
else:
return min(l)
+
def safe_max(l):
"""Calculate max, but if given an empty list return None."""
- l = list(l) #In case this is a complex type, get a simple list.
+ l = list(l) # In case this is a complex type, get a simple list.
if not l:
return None
else:
return max(l)
+
def mean(l):
if l:
return sum(l)/len(l)
else:
return None
+
def agg_mean(pairs):
"""Aggregation function in views.py receives input via enumerate and
produces a tuple.
@@ -52,7 +55,7 @@ def median(l):
return (l[(N-1)//2] + l[N//2])*.5
-def median_absolute_deviation(l, med = None):
+def median_absolute_deviation(l, med=None):
if med is None:
med = median(l)
return median([abs(x - med) for x in l])
@@ -65,7 +68,7 @@ def standard_deviation(l):
return rms
-def mannwhitneyu(a, b, sigLevel = .05):
+def mannwhitneyu(a, b, sigLevel=.05):
"""
Determine if sample a and b are the same at given significance level.
"""
@@ -88,7 +91,7 @@ def mannwhitneyu_small(a, b, sigLevel):
assert len(a) <= 20, "Sample size must be less than 20."
assert len(b) <= 20, "Sample size must be less than 20."
- if not sigLevel in SIGN_TABLES:
+ if sigLevel not in SIGN_TABLES:
raise ValueError("Do not have according significance table.")
# Calculate U value for sample groups using method described on Wikipedia.
@@ -118,23 +121,39 @@ TABLE_0_10 = [
[0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4],
[0, 0, 0, 0, 1, 2, 2, 3, 4, 4, 5, 5, 6, 7, 7, 8, 9, 9, 10, 11],
[0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15, 16, 17, 18],
- [0, 0, 1, 2, 4, 5, 6, 8, 9, 11, 12, 13, 15, 16, 18, 19, 20, 22, 23, 25],
- [0, 0, 2, 3, 5, 7, 8, 10, 12, 14, 16, 17, 19, 21, 23, 25, 26, 28, 30, 32],
- [0, 0, 2, 4, 6, 8, 11, 13, 15, 17, 19, 21, 24, 26, 28, 30, 33, 35, 37, 39],
- [0, 1, 3, 5, 8, 10, 13, 15, 18, 20, 23, 26, 28, 31, 33, 36, 39, 41, 44, 47],
- [0, 1, 4, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36, 39, 42, 45, 48, 51, 54],
- [0, 1, 4, 7, 11, 14, 17, 20, 24, 27, 31, 34, 37, 41, 44, 48, 51, 55, 58, 62],
- [0, 1, 5, 8, 12, 16, 19, 23, 27, 31, 34, 38, 42, 46, 50, 54, 57, 61, 65, 69],
- [0, 2, 5, 9, 13, 17, 21, 26, 30, 34, 38, 42, 47, 51, 55, 60, 64, 68, 72, 77],
- [0, 2, 6, 10, 15, 19, 24, 28, 33, 37, 42, 47, 51, 56, 61, 65, 70, 75, 80, 89],
- [0, 3, 7, 11, 16, 21, 26, 31, 36, 41, 46, 51, 56, 61, 66, 71, 77, 82, 87, 92],
- [0, 3, 7, 12, 18, 23, 28, 33, 39, 44, 50, 55, 61, 66, 72, 77, 83, 88, 94, 100],
- [0, 3, 8, 14, 19, 25, 30, 36, 42, 48, 54, 60, 65, 71, 77, 83, 89, 95, 101, 107],
- [0, 3, 9, 15, 20, 26, 33, 39, 45, 51, 57, 64, 70, 77, 83, 89, 96, 102, 109, 115],
- [0, 4, 9, 16, 22, 28, 35, 41, 48, 55, 61, 68, 75, 82, 88, 95, 102, 109, 116, 123],
- [0, 4, 10, 17, 23, 30, 37, 44, 51, 58, 65, 72, 80, 87, 94, 101, 109, 116, 123, 130],
- [0, 4, 11, 18, 25, 32, 39, 47, 54, 62, 69, 77, 89, 92, 100, 107, 115, 123, 130, 138]
- ]
+ [0, 0, 1, 2, 4, 5, 6, 8, 9, 11, 12, 13, 15, 16, 18, 19, 20, 22, 23,
+ 25],
+ [0, 0, 2, 3, 5, 7, 8, 10, 12, 14, 16, 17, 19, 21, 23, 25, 26, 28, 30,
+ 32],
+ [0, 0, 2, 4, 6, 8, 11, 13, 15, 17, 19, 21, 24, 26, 28, 30, 33, 35, 37,
+ 39],
+ [0, 1, 3, 5, 8, 10, 13, 15, 18, 20, 23, 26, 28, 31, 33, 36, 39, 41, 44,
+ 47],
+ [0, 1, 4, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36, 39, 42, 45, 48, 51,
+ 54],
+ [0, 1, 4, 7, 11, 14, 17, 20, 24, 27, 31, 34, 37, 41, 44, 48, 51, 55,
+ 58, 62],
+ [0, 1, 5, 8, 12, 16, 19, 23, 27, 31, 34, 38, 42, 46, 50, 54, 57, 61,
+ 65, 69],
+ [0, 2, 5, 9, 13, 17, 21, 26, 30, 34, 38, 42, 47, 51, 55, 60, 64, 68,
+ 72, 77],
+ [0, 2, 6, 10, 15, 19, 24, 28, 33, 37, 42, 47, 51, 56, 61, 65, 70, 75,
+ 80, 89],
+ [0, 3, 7, 11, 16, 21, 26, 31, 36, 41, 46, 51, 56, 61, 66, 71, 77, 82,
+ 87, 92],
+ [0, 3, 7, 12, 18, 23, 28, 33, 39, 44, 50, 55, 61, 66, 72, 77, 83, 88,
+ 94, 100],
+ [0, 3, 8, 14, 19, 25, 30, 36, 42, 48, 54, 60, 65, 71, 77, 83, 89, 95,
+ 101, 107],
+ [0, 3, 9, 15, 20, 26, 33, 39, 45, 51, 57, 64, 70, 77, 83, 89, 96, 102,
+ 109, 115],
+ [0, 4, 9, 16, 22, 28, 35, 41, 48, 55, 61, 68, 75, 82, 88, 95, 102, 109,
+ 116, 123],
+ [0, 4, 10, 17, 23, 30, 37, 44, 51, 58, 65, 72, 80, 87, 94, 101, 109,
+ 116, 123, 130],
+ [0, 4, 11, 18, 25, 32, 39, 47, 54, 62, 69, 77, 89, 92, 100, 107, 115,
+ 123, 130, 138]
+]
# Table for .05 significance level.
TABLE_0_05 = [
@@ -143,22 +162,37 @@ TABLE_0_05 = [
[0, 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8],
[0, 0, 0, 0, 1, 2, 3, 4, 4, 5, 6, 7, 8, 9, 10, 11, 11, 12, 13, 13],
[0, 0, 0, 1, 2, 3, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 17, 18, 19, 20],
- [0, 0, 1, 2, 3, 5, 6, 8, 10, 11, 13, 14, 16, 17, 19, 21, 22, 24, 25, 27],
- [0, 0, 1, 3, 5, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34],
- [0, 0, 2, 4, 6, 8, 10, 13, 15, 17, 19, 22, 24, 26, 29, 31, 34, 36, 38, 41],
- [0, 0, 2, 4, 7, 10, 12, 15, 17, 20, 23, 26, 28, 31, 34, 37, 39, 42, 45, 48],
- [0, 0, 3, 5, 8, 11, 14, 17, 20, 23, 26, 29, 33, 36, 39, 42, 45, 48, 52, 55],
- [0, 0, 3, 6, 9, 13, 16, 19, 23, 26, 30, 33, 37, 40, 44, 47, 51, 55, 58, 62],
- [0, 1, 4, 7, 11, 14, 18, 22, 26, 29, 33, 37, 41, 45, 49, 53, 57, 61, 65, 69],
- [0, 1, 4, 8, 12, 16, 20, 24, 28, 33, 37, 41, 45, 50, 54, 59, 63, 67, 72, 76],
- [0, 1, 5, 9, 13, 17, 22, 26, 31, 36, 40, 45, 50, 55, 59, 64, 67, 74, 78, 83],
- [0, 1, 5, 10, 14, 19, 24, 29, 34, 39, 44, 49, 54, 59, 64, 70, 75, 80, 85, 90],
- [0, 1, 6, 11, 15, 21, 26, 31, 37, 42, 47, 53, 59, 64, 70, 75, 81, 86, 92, 98],
- [0, 2, 6, 11, 17, 22, 28, 34, 39, 45, 51, 57, 63, 67, 75, 81, 87, 93, 99, 105],
- [0, 2, 7, 12, 18, 24, 30, 36, 42, 48, 55, 61, 67, 74, 80, 86, 93, 99, 106, 112],
- [0, 2, 7, 13, 19, 25, 32, 38, 45, 52, 58, 65, 72, 78, 85, 92, 99, 106, 113, 119],
- [0, 2, 8, 13, 20, 27, 34, 41, 48, 55, 62, 69, 76, 83, 90, 98, 105, 112, 119, 127]
- ]
+ [0, 0, 1, 2, 3, 5, 6, 8, 10, 11, 13, 14, 16, 17, 19, 21, 22, 24, 25,
+ 27],
+ [0, 0, 1, 3, 5, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32,
+ 34],
+ [0, 0, 2, 4, 6, 8, 10, 13, 15, 17, 19, 22, 24, 26, 29, 31, 34, 36, 38,
+ 41],
+ [0, 0, 2, 4, 7, 10, 12, 15, 17, 20, 23, 26, 28, 31, 34, 37, 39, 42, 45,
+ 48],
+ [0, 0, 3, 5, 8, 11, 14, 17, 20, 23, 26, 29, 33, 36, 39, 42, 45, 48, 52,
+ 55],
+ [0, 0, 3, 6, 9, 13, 16, 19, 23, 26, 30, 33, 37, 40, 44, 47, 51, 55, 58,
+ 62],
+ [0, 1, 4, 7, 11, 14, 18, 22, 26, 29, 33, 37, 41, 45, 49, 53, 57, 61,
+ 65, 69],
+ [0, 1, 4, 8, 12, 16, 20, 24, 28, 33, 37, 41, 45, 50, 54, 59, 63, 67,
+ 72, 76],
+ [0, 1, 5, 9, 13, 17, 22, 26, 31, 36, 40, 45, 50, 55, 59, 64, 67, 74,
+ 78, 83],
+ [0, 1, 5, 10, 14, 19, 24, 29, 34, 39, 44, 49, 54, 59, 64, 70, 75, 80,
+ 85, 90],
+ [0, 1, 6, 11, 15, 21, 26, 31, 37, 42, 47, 53, 59, 64, 70, 75, 81, 86,
+ 92, 98],
+ [0, 2, 6, 11, 17, 22, 28, 34, 39, 45, 51, 57, 63, 67, 75, 81, 87, 93,
+ 99, 105],
+ [0, 2, 7, 12, 18, 24, 30, 36, 42, 48, 55, 61, 67, 74, 80, 86, 93, 99,
+ 106, 112],
+ [0, 2, 7, 13, 19, 25, 32, 38, 45, 52, 58, 65, 72, 78, 85, 92, 99, 106,
+ 113, 119],
+ [0, 2, 8, 13, 20, 27, 34, 41, 48, 55, 62, 69, 76, 83, 90, 98, 105, 112,
+ 119, 127]
+]
# Table for .01 significance level.
TABLE_0_01 = [
@@ -169,19 +203,32 @@ TABLE_0_01 = [
[0, 0, 0, 0, 0, 1, 1, 2, 3, 4, 5, 6, 7, 7, 8, 9, 10, 11, 12, 13],
[0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 15, 16, 17, 18],
[0, 0, 0, 0, 1, 3, 4, 6, 7, 9, 10, 12, 13, 15, 16, 18, 19, 21, 22, 24],
- [0, 0, 0, 1, 2, 4, 6, 7, 9, 11, 13, 15, 17, 18, 20, 22, 24, 26, 28, 30],
- [0, 0, 0, 1, 3, 5, 7, 9, 11, 13, 16, 18, 20, 22, 24, 27, 29, 31, 33, 36],
- [0, 0, 0, 2, 4, 6, 9, 11, 13, 16, 18, 21, 24, 26, 29, 31, 34, 37, 39, 42],
- [0, 0, 0, 2, 5, 7, 10, 13, 16, 18, 21, 24, 27, 30, 33, 36, 39, 42, 45, 46],
- [0, 0, 1, 3, 6, 9, 12, 15, 18, 21, 24, 27, 31, 34, 37, 41, 44, 47, 51, 54],
- [0, 0, 1, 3, 7, 10, 13, 17, 20, 24, 27, 31, 34, 38, 42, 45, 49, 53, 56, 60],
- [0, 0, 1, 4, 7, 11, 15, 18, 22, 26, 30, 34, 38, 42, 46, 50, 54, 58, 63, 67],
- [0, 0, 2, 5, 8, 12, 16, 20, 24, 29, 33, 37, 42, 46, 51, 55, 60, 64, 69, 73],
- [0, 0, 2, 5, 9, 13, 18, 22, 27, 31, 36, 41, 45, 50, 55, 60, 65, 70, 74, 79],
- [0, 0, 2, 6, 10, 15, 19, 24, 29, 34, 39, 44, 49, 54, 60, 65, 70, 75, 81, 86],
- [0, 0, 2, 6, 11, 16, 21, 26, 31, 37, 42, 47, 53, 58, 64, 70, 75, 81, 87, 92],
- [0, 0, 3, 7, 12, 17, 22, 28, 33, 39, 45, 51, 56, 63, 69, 74, 81, 87, 93, 99],
- [0, 0, 3, 8, 13, 18, 24, 30, 36, 42, 46, 54, 60, 67, 73, 79, 86, 92, 99, 105]
- ]
+ [0, 0, 0, 1, 2, 4, 6, 7, 9, 11, 13, 15, 17, 18, 20, 22, 24, 26, 28,
+ 30],
+ [0, 0, 0, 1, 3, 5, 7, 9, 11, 13, 16, 18, 20, 22, 24, 27, 29, 31, 33,
+ 36],
+ [0, 0, 0, 2, 4, 6, 9, 11, 13, 16, 18, 21, 24, 26, 29, 31, 34, 37, 39,
+ 42],
+ [0, 0, 0, 2, 5, 7, 10, 13, 16, 18, 21, 24, 27, 30, 33, 36, 39, 42, 45,
+ 46],
+ [0, 0, 1, 3, 6, 9, 12, 15, 18, 21, 24, 27, 31, 34, 37, 41, 44, 47, 51,
+ 54],
+ [0, 0, 1, 3, 7, 10, 13, 17, 20, 24, 27, 31, 34, 38, 42, 45, 49, 53, 56,
+ 60],
+ [0, 0, 1, 4, 7, 11, 15, 18, 22, 26, 30, 34, 38, 42, 46, 50, 54, 58, 63,
+ 67],
+ [0, 0, 2, 5, 8, 12, 16, 20, 24, 29, 33, 37, 42, 46, 51, 55, 60, 64, 69,
+ 73],
+ [0, 0, 2, 5, 9, 13, 18, 22, 27, 31, 36, 41, 45, 50, 55, 60, 65, 70, 74,
+ 79],
+ [0, 0, 2, 6, 10, 15, 19, 24, 29, 34, 39, 44, 49, 54, 60, 65, 70, 75,
+ 81, 86],
+ [0, 0, 2, 6, 11, 16, 21, 26, 31, 37, 42, 47, 53, 58, 64, 70, 75, 81,
+ 87, 92],
+ [0, 0, 3, 7, 12, 17, 22, 28, 33, 39, 45, 51, 56, 63, 69, 74, 81, 87,
+ 93, 99],
+ [0, 0, 3, 8, 13, 18, 24, 30, 36, 42, 46, 54, 60, 67, 73, 79, 86, 92,
+ 99, 105]
+]
SIGN_TABLES = {.10: TABLE_0_10, .05: TABLE_0_05, .01: TABLE_0_01}
Modified: lnt/trunk/lnt/util/wsgi_restart.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/util/wsgi_restart.py?rev=309791&r1=309790&r2=309791&view=diff
==============================================================================
--- lnt/trunk/lnt/util/wsgi_restart.py (original)
+++ lnt/trunk/lnt/util/wsgi_restart.py Tue Aug 1 21:41:24 2017
@@ -1,5 +1,4 @@
# This code lifted from the mod_wsgi docs.
-
import os
import sys
import time
@@ -16,6 +15,7 @@ _running = False
_queue = Queue.Queue()
_lock = threading.Lock()
+
def _restart(path):
_queue.put(True)
prefix = 'monitor (pid=%d):' % os.getpid()
@@ -23,6 +23,7 @@ def _restart(path):
print >> sys.stderr, '%s Triggering process restart.' % prefix
os.kill(os.getpid(), signal.SIGINT)
+
def _modified(path):
try:
# If path doesn't denote a file and were previously
@@ -55,6 +56,7 @@ def _modified(path):
return False
+
def _monitor():
while 1:
# Check modification times on all files in sys.modules.
@@ -88,6 +90,7 @@ def _monitor():
_thread = threading.Thread(target=_monitor)
_thread.setDaemon(True)
+
def _exiting():
try:
_queue.put(True)
@@ -97,10 +100,12 @@ def _exiting():
atexit.register(_exiting)
+
def track(path):
- if not path in _files:
+ if path not in _files:
_files.append(path)
+
def start(interval=1.0):
global _interval
if interval < _interval:
More information about the llvm-commits
mailing list