process replay: automatically push refs on fail (#24414)
* test failure() * let's just change a tune here * debug revert * debug * use current commit, not ref_commit fix * need to figure out better place for this * quick test * test without upload * temp * use azure token * fixes * shouldn't need this * debug * debug * not getting anything? * does this mean nothing gets envvars? * add azure token to docker environment variables * quote * move back * clean up a bit * more clean up * like this sorting better * replace flags with CI and clean up * test FULL_TEST and minimalize diff a bit * now test all * revert tests comments * remove flags * revert this revert this * now make it fail * now update ref_commit to last commit (make sure we can re-start this test if we commit before last one finishes uploading) * fix fix fix fix * bad commit * why is it not throwing an exception? * debug * URLFile returns empty bytes if using cache and remote file doesn't exist * we always need to download anyway * debug... * duh, wrong file. but neither should have it * add that back and just check explicitly * check both * clean up and make a diff * stylize * see if this is a better diff on files changed * update refs * revert changes * only for owners or members * if we have token access * if we have token access * if we have token access * move up * clean up * revert * move update refs to test_processes * clean up * update messages * update msg * update README and delete update_refs * this isn't possible to reach anymore * fix readme * better help message better help message better help message * only show basename when uploading, only if failed to find * test diff * fix printing old ref commit * change to using * update refs * Revert "update refs" This reverts committaco2e352a736a
. * revert * ref refers to reference commit/logs, cur refers to current logs/commit (future ref) * like for better * Apply suggestions from code review Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com> * Update selfdrive/test/process_replay/test_processes.py * every time lol Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com> old-commit-hash:d2d3b7b823
parent
b7d6595fa4
commit
024f42bae5
6 changed files with 96 additions and 78 deletions
@ -1,38 +0,0 @@ |
|||||||
#!/usr/bin/env python3 |
|
||||||
import os |
|
||||||
import sys |
|
||||||
|
|
||||||
from selfdrive.test.openpilotci import upload_file, get_url |
|
||||||
from selfdrive.test.process_replay.compare_logs import save_log |
|
||||||
from selfdrive.test.process_replay.process_replay import replay_process, CONFIGS |
|
||||||
from selfdrive.test.process_replay.test_processes import segments |
|
||||||
from selfdrive.version import get_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_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: |
|
||||||
r, n = segment.rsplit("--", 1) |
|
||||||
lr = LogReader(get_url(r, n)) |
|
||||||
|
|
||||||
for cfg in CONFIGS: |
|
||||||
log_msgs = replay_process(cfg, lr) |
|
||||||
log_fn = os.path.join(process_replay_dir, f"{segment}_{cfg.proc_name}_{ref_commit}.bz2") |
|
||||||
save_log(log_fn, log_msgs) |
|
||||||
|
|
||||||
if not no_upload: |
|
||||||
upload_file(log_fn, os.path.basename(log_fn)) |
|
||||||
os.remove(log_fn) |
|
||||||
|
|
||||||
print("done") |
|
Loading…
Reference in new issue