def __init__(self, output_dir, sender_impl, receiver_impl, peer_to_peer): self.output_dir = output_dir self.sender_impl = sender_impl self.receiver_impl = receiver_impl self.peer_to_peer = peer_to_peer self.command_file = _plano.join(self.output_dir, "command.txt") self.output_file = _plano.join(self.output_dir, "output.txt") self.status_file = _plano.join(self.output_dir, "status.txt")
def __init__(self, command, output_dir, sender_impl, receiver_impl, peer_to_peer): self.command = command self.output_dir = output_dir self.sender_impl = sender_impl self.receiver_impl = receiver_impl self.peer_to_peer = peer_to_peer self.command_file = _plano.join(self.output_dir, "command.txt") self.output_file = _plano.join(self.output_dir, "output.txt") self.status_file = _plano.join(self.output_dir, "status.txt")
def __init__(self, output_dir, impl): self.output_dir = output_dir self.impl = impl self.ready_file = _plano.make_temp_file() self.command_file = _plano.join(self.output_dir, "command.txt") self.output_file = _plano.join(self.output_dir, "output.txt") self.status_file = _plano.join(self.output_dir, "status.txt") self.proc = None
def __init__(self, output_dir, impl): self.output_dir = output_dir self.impl = impl self.ready_file = _plano.make_temp_file() self.command_file = _plano.join(self.output_dir, "command.txt") self.output_file = _plano.join(self.output_dir, "output.txt") self.status_file = _plano.join(self.output_dir, "status.txt") self.output = None self.proc = None
def build(self): _plano.remove(self.work_dir) _plano.copy(self.source_dir, self.work_dir) # Remove any leftover build output from the source dir _plano.remove(_plano.join(self.work_dir, "build")) self.clean()
def status_command(self): _plano.enable_logging(level="warn") for repo_dir in self.args.repo_dir: if not _plano.exists(_plano.join(repo_dir, ".git")): continue _sys.stdout.write("## {:<40} ".format(repo_dir)) with _plano.working_dir(repo_dir): output = _plano.call_for_stdout("git status -sb") _sys.stdout.write(output) _sys.stdout.flush()
def init_command(self): _plano.enable_logging(level="warn") if _plano.exists(_plano.join(self.args.repo_dir, ".git")): self.fail("The directory is already initialized") repo_name = _plano.file_name(self.args.repo_dir) with _plano.working_dir(self.args.repo_dir): _plano.call("git init") _plano.call("git add .") _plano.call("git commit -m \"Initial commit\"") _plano.call("git remote add origin [email protected]:{}/{}.git", self.args.user, repo_name) print("Make sure this repo exists on GitHub and then push:") print("git push -u origin/{}".format(repo_name))
def run_test(self, sender_impl, server_impl, receiver_impl): peer_to_peer = server_impl is None port = _plano.random_port() server = None if server_impl == "activemq": if sender_impl == "activemq-jms" and receiver_impl == "activemq-jms": port = 61616 else: port = 5672 if peer_to_peer: summary = "{} -> {} ".format(sender_impl, receiver_impl) server_name = "none" else: summary = "{} -> {} -> {} ".format(sender_impl, server_impl, receiver_impl) server_name = server_impl test_dir = _plano.join(self.output_dir, sender_impl, server_name, receiver_impl) pair_dir = _plano.join(test_dir, "pair") server_dir = _plano.join(test_dir, "server") pair = _TestPair(self, pair_dir, sender_impl, receiver_impl, peer_to_peer) if not peer_to_peer: server = _TestServer(server_dir, server_impl) if not self.verbose and not self.quiet: print("{:.<111} ".format(summary), end="") _plano.flush() if server is not None: try: server.start(port) except _Timeout as e: self.failures.append(str(e)) # XXX capture the combo if self.verbose: _plano.error(str(e)) else: print("FAILED") if server is not None: server.print_summary() try: pair.run(port, self.args) if not self.verbose and not self.quiet: print("PASSED") except KeyboardInterrupt: raise except _plano.CalledProcessError as e: self.failures.append(str(e)) # XXX capture the combo if self.verbose: _plano.error(str(e)) elif not self.quiet: print("FAILED") pair.print_summary() if server is not None: server.print_summary() except: _traceback.print_exc() finally: _plano.flush() if server is not None: server.stop() self.report(pair, server)
def get_server_impl_file(self, name): return _plano.join(self.home_dir, "exec", "quiver-server-{}".format(name))
def get_arrow_impl_file(self, name): return _plano.join(self.home_dir, "exec", "quiver-arrow-{}".format(name))