(test) enhance conftest to lessen false positives in integration tests (#3512)

* conftest: also mask size=xxx parameter in integration tests

* mask random poetry path part

* make regex more flexible
This commit is contained in:
tobitege
2024-08-21 15:48:32 +02:00
committed by GitHub
parent 426f3b5fc0
commit 70723581ac

View File

@@ -50,6 +50,16 @@ def filter_out_symbols(input):
# openhands@379c7fce40b4:/workspace $
input = re.sub(r'(openhands|root)@.*(:/.*)', r'\1[DUMMY_HOSTNAME]\2', input)
# mask the specific part in a poetry path
input = re.sub(
r'(/open[a-z]{5}/poetry/open[a-z]{5}-)[a-zA-Z0-9-]+(-py3\.\d+/bin/python)',
r'\1[DUMMY_STRING]\2',
input,
)
# handle size param
input = re.sub(r' size=\d+ ', ' size=[DUMMY_SIZE] ', input)
# handle sha256 hashes
# sha256=4ecf8be428f55981e2a188f510ba5f9022bed88f5fb404d7d949f44382201e3d
input = re.sub(r'sha256=[a-z0-9]+', 'sha256=[DUMMY_HASH]', input)