mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-18 14:13:53 +08:00
CI: Fix process replay to properly work with local routes (#469)
Updating test_processes.py to easily upload ref routes locally to git instead of azure
This commit is contained in:
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -9,6 +9,7 @@
|
||||
*.ttf filter=lfs diff=lfs merge=lfs -text
|
||||
*.wav filter=lfs diff=lfs merge=lfs -text
|
||||
|
||||
selfdrive/test/process_replay/fakedata/*.zst filter=lfs diff=lfs merge=lfs -text
|
||||
selfdrive/car/tests/test_models_segs.txt filter=lfs diff=lfs merge=lfs -text
|
||||
system/hardware/tici/updater filter=lfs diff=lfs merge=lfs -text
|
||||
selfdrive/ui/qt/spinner_larch64 filter=lfs diff=lfs merge=lfs -text
|
||||
|
||||
@@ -13,7 +13,7 @@ cd $ROOT
|
||||
|
||||
FAILED=0
|
||||
|
||||
IGNORED_FILES="uv\.lock|docs\/CARS.md|LICENSE\.md"
|
||||
IGNORED_FILES="uv\.lock|docs\/CARS.md|LICENSE\.md|.*\.zst"
|
||||
IGNORED_DIRS="^third_party.*|^msgq.*|^msgq_repo.*|^opendbc.*|^opendbc_repo.*|^cereal.*|^panda.*|^rednose.*|^rednose_repo.*|^tinygrad.*|^tinygrad_repo.*|^teleoprtc.*|^teleoprtc_repo.*"
|
||||
|
||||
function run() {
|
||||
|
||||
2
selfdrive/test/process_replay/.gitignore
vendored
2
selfdrive/test/process_replay/.gitignore
vendored
@@ -1 +1 @@
|
||||
fakedata/
|
||||
!fakedata/*
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:00a555e2b8cb5a846ca7aa21d9cb6474ec28cf16dfee7ee4eab2c24b3e41c84c
|
||||
size 1883
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:9362a3123b22fa01c58746cfd77a9f4dc39486e3ba3d8cdca0cbbf7deabab3a2
|
||||
size 356244
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:8ec364c58a24d2b061da26db823ad9f9b022939acc69bf173c5e7692b369ffc2
|
||||
size 167913
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:9b56b74cb9e31cc7ca3e5017b4f90375bec2f640690cb08cba01b6084a3911f6
|
||||
size 3502
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:6f99286c35614806801ae4c77477fdaefa0fa7d960c047b6315edb593c67d5e0
|
||||
size 112449
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:b8d37d1a2c609393cbbe2b7f517967f37ddcc6a57873625b7dc30ea59294a79e
|
||||
size 41741
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:de281abbae0fbc341a365e90041d686b981730d80446d5bc02b938b007f0485c
|
||||
size 255408
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:b396d49350f43fa1ace5f96c46e46a80e305c99e59a487092ef23472a2b37fb6
|
||||
size 51100
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a0ea35f1a0517a7117219d7bba72a9e4bda05ba351840f37f3cda934033103f8
|
||||
size 29356
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:217fcbe96795f4e05fe20d7720ab0a73c2d88196cf72a79f8aeaa31161ac648a
|
||||
size 1348
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:531fae8fa368a3edbcd291174d501095c1760d20ecbf1963f3eb5ce80163251f
|
||||
size 284311
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:ffd02445fb477ddae838191e9bb153ccc49d97bcc7fb74eefce54b91c93fdcbe
|
||||
size 332353
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:4cc6be9b88015adc3b9973747757d741ba23ba794e1795f3a27626c7a49154e6
|
||||
size 269026
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:fa4c3e5624063b8fa5998df09b052e432628cecbfd1c600856937a3db0f0605e
|
||||
size 436619
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:bc135645787b5ca9c4f41d97e8d7b4ae5a6ce1c29b95d27c46ddd74093afa47b
|
||||
size 308650
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:de1909598bb7056dbf86e4e54ea4cbf64ecc7cf56fc72e7a7745ca419191a7f9
|
||||
size 392234
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:523d4fe389cdbfd573c6de96f331156edf35055e3e4fc5069f476af7dd3b8e6b
|
||||
size 334357
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:65e3a6f26f52c1e1f67849facb102f625bb0c5913aa1d376a35d324f5542d794
|
||||
size 1860
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:694e9f0375a5df17be98475cc5eeb4fee02a3fb62f740277a95450feb0da6a98
|
||||
size 470478
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:dfc601f9cbcafe611033a4c3a43fd9adcb0e2dbde21fa6fb8238e9de84fca48d
|
||||
size 201759
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a96509ec410b10459c62af0614366740e1138c1551fadc0afde6672f15516815
|
||||
size 7909
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e887d050e6d5a6d18123956f10ce174bdd9957b1820dbcbe6f608fcd89372bab
|
||||
size 112454
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:8c3cc2bc6ff6eb2a9777eded8090e7e76f80bd8c29e51bdb2fd0782c785d6e33
|
||||
size 40767
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a48a6709fd62240c7225a5f008bd0f29d85183259ead2454df8e007c8682fe17
|
||||
size 260120
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:fc8b42f793728cf1cb9bc9868a106e7171527c1d6549de1afcfe4c6db163b799
|
||||
size 52725
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:074f0bbd96d130e2350d6a3db872696cd35a4c2fe7e32845b53698528a500587
|
||||
size 29645
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:1c4d73bd47043fd6bdbd0625299bda7a5b94cf2f63f1813cd1ec683be8b7ce09
|
||||
size 1199
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:1c4ddf166d015b6886ee3250c977ff1d37542a6a3b364dc58316b30f21dbe56d
|
||||
size 234433
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:0f846846529315b2c43c8e9612708c48192609cd6fd2c4cd3ef6c622e94f034e
|
||||
size 217460
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:803b782e30fc48b51e677ef2c50ac80f3f6283799205b0ed8829d3c6ac61b49c
|
||||
size 1712
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:508ebdd9fdf6138a415c02d04256428752bbdc5c468ea85767da28ce7b88cb2f
|
||||
size 293059
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:83241bc1d9704dcc916e1ef2f48e0851d09cdf8134fb317b06cbda496cbe9808
|
||||
size 164545
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:b4341d37146f3b0fd0b8355a3213d2a1b596bf7a2a41c061f1aebbbaa6aa1172
|
||||
size 3552
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e072d812c3355091fde157a40523b1818a96db3ade15a7810c54a05282288c12
|
||||
size 112322
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:13d8632b9f98b91ec9d723c8eb81ed877884f238f6cbcebcbe42541309f0b820
|
||||
size 35670
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:0470680aebb3701d0f0c972ab47d58e984fcbc4ab584b12044892a5121e9b643
|
||||
size 259316
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:fa9767fe8370fc49e455d5746b6b34a489681ec9103df5a2de2953524ae4c319
|
||||
size 17917
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:02117e335193889d0d13027de4755896bd6f401951e85564169fd4354e1cd523
|
||||
size 29479
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:ad0392cb8f44222127f06df95a278fb05cfecfa1ef641ddf590a3b50fa5b4b74
|
||||
size 1223
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:7701c8d0230dbf234da6e8ee954cd81e67b0a735e98441abe19f6b08a89b84e7
|
||||
size 102213
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e4621b5c40fdd71d155a9cbec1de95befae393d8e1fcf5e4f3cd54dcbc0bb213
|
||||
size 100034
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a75473ce388cf1d6fb54c38400a481464c7ec36765d3807addf16267315f52b8
|
||||
size 1912
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:8749ad0f2c46cd3e92a0ace84041d19f62c360c7da68110ed2c2dd0474560555
|
||||
size 263294
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:91a900de57315a5f15fa1bdfb3f7f6b254b11f4278cf8203d9b91d01b4840716
|
||||
size 259422
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:b0602bdf2a3736b1d38f807b9a5029222721a327ee13c0a1d4ad7e3cadc4d5a1
|
||||
size 6841
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:5b1e513b97426cc282e6f367b2750030ada2c3c11689189239991aa580f9e91a
|
||||
size 113046
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:b3f1c5a027ac87927bf52cd6a7996bfe0a67a1b50f94df16063884f6b5ff3b46
|
||||
size 41696
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:18601597c241726451ab95621a50c25dbaad0b410404ce3fed1be101a9119649
|
||||
size 257159
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:67316952f7551b69c46a8b35fb1cb205034aec2a0f5d94833bc7aec5298a0e8e
|
||||
size 53039
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:54be480a7baeddc99dd05c710d3c48e0313f56dd52249cd58f19f77d69d765e5
|
||||
size 30395
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a2da9e9adaf35f6d525c32f2695d678b0286b1e1db30dc1a07541714af292e95
|
||||
size 1292
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:4cb323a317e3e47451a2e92dcfcb7d74b134eb53fcf58dde834a0f226c30959d
|
||||
size 193087
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d154f6dc1c866bc41dc3a6b95981b0293527261309404230cee3d707486cb096
|
||||
size 268094
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:c34d0a968f789548d507be6e2aa42a308ea76fa29204f00287e07119b725bc90
|
||||
size 1863
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:c885db671ada7b8f9193875ef1eb9dba485712394c212bf70bc35cb7a507cf8f
|
||||
size 305088
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:606cf3036fbcce5be1140953aac7a388a303e6b901b9fe166bc8d5020af76e3f
|
||||
size 281374
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d3add3cdb9c13d8d00b013e5f54dff9040ef6f97972c25cd0375939424fa385e
|
||||
size 4481
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:8ff53a8d947ed2a4de660f3289f56c2b800c0147418237a0d256acbe48476b77
|
||||
size 112877
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:3a5110e087689d493419a20ae06c0e781d1ee41cd02878f532645815ef7f41a8
|
||||
size 41026
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:5a3b80cb04d36f1b62ee647b5c6fbfdc9fc89d82607c6fb81ce177935a952ae4
|
||||
size 253521
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f7c84b169e3284c28985c71bd88431f6e750f71ad8274f85e2522be4b8cb60ba
|
||||
size 16708
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:feb26956eb0a3fefd6019f36025ab6c62a55b97b06e4729e5e6508f58432dd72
|
||||
size 30362
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:9796b749a3cbd3b30336b1e4ac9cefd17586ffc523c9955ffe8cb07c504d15b2
|
||||
size 1196
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:7dcbf1c3abe76b2a6b1627c43ce5ecd2d56cb8ed52d4486415cdf6d6eb22fc07
|
||||
size 265784
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:215bb2d006ae9c686d1b56d676f6e271d62c76b32b54df33a03affa5a106fdf8
|
||||
size 271943
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:eeb8004da1fe98acca5bc96a2d4442a4a4a6b7e91816ad55d6ea52f0b46106dc
|
||||
size 332418
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:57161f08e7ef04bc9d177bf05402f3defa778169f65951020ab594d9efdacd32
|
||||
size 292837
|
||||
@@ -1 +1 @@
|
||||
255ceb08c75bc85379da5ec247e612be3716fb43
|
||||
8ab4d7b987f55855ef64f16afbd3f67996e6935a
|
||||
@@ -16,6 +16,8 @@ from openpilot.selfdrive.test.process_replay.process_replay import CONFIGS, PROC
|
||||
from openpilot.tools.lib.filereader import FileReader
|
||||
from openpilot.tools.lib.logreader import LogReader, save_log
|
||||
|
||||
IS_AZURE_TOKEN_DEFINED = os.getenv("AZURE_TOKEN")
|
||||
|
||||
source_segments = [
|
||||
("BODY", "937ccb7243511b65|2022-05-24--16-03-09--1"), # COMMA.COMMA_BODY
|
||||
("HYUNDAI", "02c45f73a2e5c6e9|2021-01-01--19-08-22--1"), # HYUNDAI.HYUNDAI_SONATA
|
||||
@@ -67,6 +69,28 @@ REF_COMMIT_FN = os.path.join(PROC_REPLAY_DIR, "ref_commit")
|
||||
EXCLUDED_PROCS = {"modeld", "dmonitoringmodeld"}
|
||||
|
||||
|
||||
def preserve_only_specified_files_from_ref_commit(*commits_to_keep):
|
||||
"""Keep only files in fakedata that contain any of the specified commit hashes."""
|
||||
removed = 0
|
||||
for f in os.listdir(FAKEDATA):
|
||||
if not any(commit in f for commit in commits_to_keep):
|
||||
os.remove(os.path.join(FAKEDATA, f))
|
||||
removed += 1
|
||||
if removed > 0:
|
||||
print(f"Removed {removed} old files from {FAKEDATA}")
|
||||
|
||||
|
||||
def handle_output_file(cur_log_fn, local):
|
||||
"""Handle the output file based on whether we're using remote or local storage."""
|
||||
assert os.path.exists(cur_log_fn), f"Cannot find log to upload: {cur_log_fn}"
|
||||
|
||||
if local:
|
||||
os.system(f"git add '{os.path.realpath(cur_log_fn)}'")
|
||||
else:
|
||||
upload_file(cur_log_fn, os.path.basename(cur_log_fn))
|
||||
os.remove(cur_log_fn)
|
||||
|
||||
|
||||
def run_test_process(data):
|
||||
segment, cfg, args, cur_log_fn, ref_log_path, lr_dat = data
|
||||
res = None
|
||||
@@ -77,10 +101,9 @@ def run_test_process(data):
|
||||
save_log(cur_log_fn, log_msgs)
|
||||
|
||||
if args.update_refs or args.upload_only:
|
||||
print(f'Uploading: {os.path.basename(cur_log_fn)}')
|
||||
assert os.path.exists(cur_log_fn), f"Cannot find log to upload: {cur_log_fn}"
|
||||
upload_file(cur_log_fn, os.path.basename(cur_log_fn))
|
||||
os.remove(cur_log_fn)
|
||||
print(f'Processing: {os.path.basename(cur_log_fn)}')
|
||||
handle_output_file(cur_log_fn, args.local)
|
||||
|
||||
return (segment, cfg.proc_name, res)
|
||||
|
||||
|
||||
@@ -119,6 +142,27 @@ def test_process(cfg, lr, segment, ref_log_path, new_log_path, ignore_fields=Non
|
||||
return str(e), log_msgs
|
||||
|
||||
|
||||
def finalize_git_updates(cur_commit, ref_commit_fn):
|
||||
"""Finalize git updates and create commit."""
|
||||
try:
|
||||
# Add all new files first
|
||||
os.system(f"git add {os.path.realpath(ref_commit_fn)}")
|
||||
os.system(f"git add {os.path.realpath(FAKEDATA)}/*.zst")
|
||||
|
||||
# Clean up old files - keep only new ref files since they're becoming the reference
|
||||
preserve_only_specified_files_from_ref_commit(cur_commit)
|
||||
|
||||
# Add the deletions to git
|
||||
os.system(f"git add -u {os.path.realpath(FAKEDATA)}")
|
||||
|
||||
# Create the commit
|
||||
commit_msg = f"test_processes: update ref logs to {cur_commit[:7]}"
|
||||
os.system(f'git commit -m "{commit_msg}"')
|
||||
print("Successfully committed reference log updates")
|
||||
except Exception as e:
|
||||
print(f"Failed to commit changes: {e}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
all_cars = {car for car, _ in segments}
|
||||
all_procs = {cfg.proc_name for cfg in CONFIGS if cfg.proc_name not in EXCLUDED_PROCS}
|
||||
@@ -142,6 +186,8 @@ if __name__ == "__main__":
|
||||
help="Updates reference logs using current commit")
|
||||
parser.add_argument("--upload-only", action="store_true",
|
||||
help="Skips testing processes and uploads logs from previous test run")
|
||||
parser.add_argument("--local", action="store_true",
|
||||
help="Use local git/ storage instead of remote (Azure for Comma)")
|
||||
parser.add_argument("-j", "--jobs", type=int, default=max(cpu_count - 2, 1),
|
||||
help="Max amount of parallel jobs")
|
||||
args = parser.parse_args()
|
||||
@@ -168,6 +214,16 @@ if __name__ == "__main__":
|
||||
if not cur_commit:
|
||||
raise Exception("Couldn't get current commit")
|
||||
|
||||
# Could be set as default in args, but wanted to be more explicit on the flow.
|
||||
if upload and not args.local and not IS_AZURE_TOKEN_DEFINED:
|
||||
print("***** Warning: local/git run was used by default since AZURE_TOKEN was NOT found on the env variables! *****")
|
||||
args.local = True
|
||||
|
||||
# Clean up old files before starting
|
||||
if upload and args.local:
|
||||
print("***** Cleaning up old fakedata for local/git tracked refs *****")
|
||||
preserve_only_specified_files_from_ref_commit(cur_commit, ref_commit)
|
||||
|
||||
print(f"***** testing against commit {ref_commit} *****")
|
||||
|
||||
# check to make sure all car brands are tested
|
||||
@@ -234,4 +290,8 @@ if __name__ == "__main__":
|
||||
f.write(cur_commit)
|
||||
print(f"\n\nUpdated reference logs for commit: {cur_commit}")
|
||||
|
||||
# Only do git operations if we're in local mode
|
||||
if upload and args.local:
|
||||
finalize_git_updates(cur_commit, REF_COMMIT_FN)
|
||||
|
||||
sys.exit(int(failed))
|
||||
|
||||
Reference in New Issue
Block a user