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):
438438 update_geth_version_string (changes , new_version , change_next_line = True )
439439
440440
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+
441455if __name__ == "__main__" :
442456 geth_binary = os .environ .get ("GETH_BINARY" , None )
443457 if not geth_binary :
444458 raise ValueError ("GETH_BINARY not set. Cannot generate geth fixture." )
445459
446460 geth_version = re .search (r"geth-v([\d.]+)/" , geth_binary ).group (1 )
447461 generate_go_ethereum_fixture (f"./tests/integration/geth-{ geth_version } -fixture" )
462+ remove_old_fixtures (geth_version )
448463 update_circleci_geth_version (geth_version )
449464 update_fixture_generation_version (geth_version )
450465 update_doc_version (geth_version )
You can’t perform that action at this time.
0 commit comments