Commit 8e77ff61 authored by Jérome Perrin's avatar Jérome Perrin

eggtest: provide nicer test names

This should fix the problem that `Revision History` is unusable on test
results because tests have a different name when they have been running
on different paths
parent 5c131f7f
...@@ -223,7 +223,7 @@ class EggTestSuite(TestSuite): ...@@ -223,7 +223,7 @@ class EggTestSuite(TestSuite):
print test print test
original_dir = os.getcwd() original_dir = os.getcwd()
try: try:
os.chdir(test) os.chdir(self.egg_test_path_dict[test])
return self.runUnitTest(test) return self.runUnitTest(test)
finally: finally:
os.chdir(original_dir) os.chdir(original_dir)
...@@ -263,10 +263,7 @@ class EggTestSuite(TestSuite): ...@@ -263,10 +263,7 @@ class EggTestSuite(TestSuite):
return status_dict return status_dict
def getTestList(self): def getTestList(self):
# (FIXME) The test name should be nicer in order to provide a good report. return self.egg_test_path_dict.keys()
# On task distribution.
source_code_to_test = os.environ.get("SOURCE_CODE_TO_TEST", '.')
return source_code_to_test.split(",")
def runTestSuite(): def runTestSuite():
parser = argparse.ArgumentParser(description='Run a test suite.') parser = argparse.ArgumentParser(description='Run a test suite.')
...@@ -288,17 +285,19 @@ def runTestSuite(): ...@@ -288,17 +285,19 @@ def runTestSuite():
help='The url of the frontend of this test node', help='The url of the frontend of this test node',
default=None) default=None)
parser.add_argument('--source_code_path_list', parser.add_argument('--source_code_path_list',
help='List of Eggs folders to test, splited by commam', help='Coma separated list of Eggs folders to test',
default='.') default='.')
args = parser.parse_args() args = parser.parse_args()
master = taskdistribution.TaskDistributor(args.master_url) master = taskdistribution.TaskDistributor(args.master_url)
os.environ.setdefault("SOURCE_CODE_TO_TEST", args.source_code_path_list)
test_suite_title = args.test_suite_title or args.test_suite test_suite_title = args.test_suite_title or args.test_suite
revision = args.revision revision = args.revision
suite = EggTestSuite(1, test_suite=args.test_suite, suite = EggTestSuite(1, test_suite=args.test_suite,
node_quantity=args.node_quantity, node_quantity=args.node_quantity,
revision=revision) revision=revision,
egg_test_path_dict={os.path.basename(path): path
for path in args.source_code_path_list.split(',')},
)
test_result = master.createTestResult(revision, suite.getTestList(), test_result = master.createTestResult(revision, suite.getTestList(),
args.test_node_title, suite.allow_restart, test_suite_title, args.test_node_title, suite.allow_restart, test_suite_title,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment