do not install solc, fix file replace

pull/1799/head
alpharush 2 years ago
parent b54574ed08
commit 23ec8b2390
  1. 17
      tests/e2e/detectors/test_detectors.py

@ -1645,11 +1645,11 @@ ALL_TEST_OBJECTS = [
def get_all_tests() -> List[Test]: def get_all_tests() -> List[Test]:
installed_solcs = set(get_installed_solc_versions()) # installed_solcs = set(get_installed_solc_versions())
required_solcs = {test.solc_ver for test in ALL_TEST_OBJECTS} # required_solcs = {test.solc_ver for test in ALL_TEST_OBJECTS}
missing_solcs = list(required_solcs - installed_solcs) # missing_solcs = list(required_solcs - installed_solcs)
if missing_solcs: # if missing_solcs:
install_solc_versions(missing_solcs) # install_solc_versions(missing_solcs)
return ALL_TEST_OBJECTS return ALL_TEST_OBJECTS
@ -1671,9 +1671,8 @@ def test_detector(test_item: Test):
test_item.solc_ver, test_item.solc_ver,
) )
test_file_path = pathlib.Path(test_dir_path, test_item.test_file).as_posix() test_file_path = pathlib.Path(test_dir_path, test_item.test_file).as_posix()
expected_result_path = ( expected_result_path = pathlib.Path(test_dir_path, test_item.expected_result).absolute().as_posix()
pathlib.Path(test_dir_path, test_item.expected_result).absolute().as_posix()
)
cc = load_from_zip(f"{test_file_path}-{test_item.solc_ver}.zip")[0] cc = load_from_zip(f"{test_file_path}-{test_item.solc_ver}.zip")[0]
sl = Slither(cc) sl = Slither(cc)
@ -1686,7 +1685,7 @@ def test_detector(test_item: Test):
results_as_string = json.dumps(results) results_as_string = json.dumps(results)
for additional_file in test_item.additional_files: for additional_file in test_item.additional_files:
additional_path = str(pathlib.Path(test_dir_path, additional_file).absolute()) additional_path = pathlib.Path(test_dir_path, additional_file).absolute().as_posix()
additional_path = additional_path.replace("\\", "\\\\") additional_path = additional_path.replace("\\", "\\\\")
results_as_string = results_as_string.replace(additional_path, GENERIC_PATH) results_as_string = results_as_string.replace(additional_path, GENERIC_PATH)
test_file_path = test_file_path.replace("\\", "\\\\") test_file_path = test_file_path.replace("\\", "\\\\")

Loading…
Cancel
Save