def test_config(self): open(os.path.join(BASEDIR, "selfdrive/test/valgrind_logs.txt"), "w") for cfg in CONFIGS: self.done = False URL = cfg.segment lr = LogReader(get_segment(URL)) self.replay_process(cfg, lr) time.sleep(1) # Wait for the logs to get written
if __name__ == "__main__": no_upload = "--no-upload" in sys.argv process_replay_dir = os.path.dirname(os.path.abspath(__file__)) ref_commit_fn = os.path.join(process_replay_dir, "model_ref_commit") ref_commit = get_git_commit() if ref_commit is None: raise Exception("couldn't get ref commit") with open(ref_commit_fn, "w") as f: f.write(ref_commit) for car_brand, segment in segments: rlog_fn = get_segment(segment, original=True) if rlog_fn is None: print("failed to get segment %s" % segment) sys.exit(1) lr = LogReader(rlog_fn) print('injecting model into % s' % segment) lr = inject_model(lr, segment) route_name, segment_num = segment.rsplit("--", 1) log_fn = "%s/%s/rlog_%s.bz2" % (route_name.replace( "|", "/"), segment_num, ref_commit) tmp_name = 'tmp_%s_%s' % (route_name, segment_num) save_log(tmp_name, lr)
from selfdrive.version import get_git_commit from tools.lib.logreader import LogReader if __name__ == "__main__": no_upload = "--no-upload" in sys.argv process_replay_dir = os.path.dirname(os.path.abspath(__file__)) ref_commit_fn = os.path.join(process_replay_dir, "ref_commit") ref_commit = get_git_commit() with open(ref_commit_fn, "w") as f: f.write(ref_commit) for car_brand, segment in segments: rlog_fn = get_segment(segment) if rlog_fn is None: print("failed to get segment %s" % segment) sys.exit(1) lr = LogReader(rlog_fn) for cfg in CONFIGS: log_msgs = replay_process(cfg, lr) log_fn = os.path.join(process_replay_dir, "%s_%s_%s.bz2" % (segment, cfg.proc_name, ref_commit)) save_log(log_fn, log_msgs) if not no_upload: upload_file(log_fn, os.path.basename(log_fn)) os.remove(log_fn)