File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
tests/integration/generate_fixtures Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change
1
+ Remove old test fixtures when generating a new test fixture.
Original file line number Diff line number Diff line change @@ -438,13 +438,28 @@ def update_circleci_geth_version(new_version):
438
438
update_geth_version_string (changes , new_version , change_next_line = True )
439
439
440
440
441
+ def remove_old_fixtures (current_geth_version ):
442
+ """
443
+ Remove any geth fixture files that are not for the current version.
444
+ """
445
+ for file in os .listdir ("./tests/integration" ):
446
+ if (
447
+ file .startswith ("geth-" )
448
+ and file .endswith ("-fixture.zip" )
449
+ and current_geth_version not in file
450
+ ):
451
+ os .remove (os .path .join ("./tests/integration" , file ))
452
+ print (f"Removed old fixture: { file } " )
453
+
454
+
441
455
if __name__ == "__main__" :
442
456
geth_binary = os .environ .get ("GETH_BINARY" , None )
443
457
if not geth_binary :
444
458
raise ValueError ("GETH_BINARY not set. Cannot generate geth fixture." )
445
459
446
460
geth_version = re .search (r"geth-v([\d.]+)/" , geth_binary ).group (1 )
447
461
generate_go_ethereum_fixture (f"./tests/integration/geth-{ geth_version } -fixture" )
462
+ remove_old_fixtures (geth_version )
448
463
update_circleci_geth_version (geth_version )
449
464
update_fixture_generation_version (geth_version )
450
465
update_doc_version (geth_version )
You can’t perform that action at this time.
0 commit comments