##// END OF EJS Templates
Some gardening on iptest result reporting
Thomas Kluyver -
Show More
@@ -72,6 +72,15 b' class TestController(object):'
72 self.stdout, _ = self.process.communicate()
72 self.stdout, _ = self.process.communicate()
73 return self.process.returncode
73 return self.process.returncode
74
74
75 def dump_failure(self):
76 """Print buffered results of a test failure.
77
78 Called after tests fail while running in parallel. The base
79 implementation just prints the output from the test subprocess, but
80 subclasses can override it to add extra information.
81 """
82 print(self.stdout)
83
75 def cleanup_process(self):
84 def cleanup_process(self):
76 """Cleanup on exit by killing any leftover processes."""
85 """Cleanup on exit by killing any leftover processes."""
77 subp = self.process
86 subp = self.process
@@ -182,7 +191,6 b' class JSController(TestController):'
182 def launch(self):
191 def launch(self):
183 self.ipydir = TemporaryDirectory()
192 self.ipydir = TemporaryDirectory()
184 self.nbdir = TemporaryDirectory()
193 self.nbdir = TemporaryDirectory()
185 print("Running %s tests in directory: %r" % (self.section, self.nbdir.name))
186 os.makedirs(os.path.join(self.nbdir.name, os.path.join(u'sub ∂ir1', u'sub ∂ir 1a')))
194 os.makedirs(os.path.join(self.nbdir.name, os.path.join(u'sub ∂ir1', u'sub ∂ir 1a')))
187 os.makedirs(os.path.join(self.nbdir.name, os.path.join(u'sub ∂ir2', u'sub ∂ir 1b')))
195 os.makedirs(os.path.join(self.nbdir.name, os.path.join(u'sub ∂ir2', u'sub ∂ir 1b')))
188 self.dirs.append(self.ipydir)
196 self.dirs.append(self.ipydir)
@@ -208,6 +216,10 b' class JSController(TestController):'
208 self.server.start()
216 self.server.start()
209 self.server_port = q.get()
217 self.server_port = q.get()
210
218
219 def dump_failure(self):
220 print("Ran tests with notebook directory %r" % self.nbdir)
221 super(JSController, self).dump_failure()
222
211 def cleanup(self):
223 def cleanup(self):
212 self.server.terminate()
224 self.server.terminate()
213 self.server.join()
225 self.server.join()
@@ -400,9 +412,9 b' def run_iptestall(options):'
400 pool = multiprocessing.pool.ThreadPool(options.fast)
412 pool = multiprocessing.pool.ThreadPool(options.fast)
401 for (controller, res) in pool.imap_unordered(do_run, to_run):
413 for (controller, res) in pool.imap_unordered(do_run, to_run):
402 res_string = 'OK' if res == 0 else 'FAILED'
414 res_string = 'OK' if res == 0 else 'FAILED'
403 print(justify('IPython test group: ' + controller.section, res_string))
415 print(justify('Test group: ' + controller.section, res_string))
404 if res:
416 if res:
405 print(bytes_to_str(controller.stdout))
417 controller.dump_failure()
406 failed.append(controller)
418 failed.append(controller)
407 if res == -signal.SIGINT:
419 if res == -signal.SIGINT:
408 print("Interrupted")
420 print("Interrupted")
General Comments 0
You need to be logged in to leave comments. Login now