From 70723581ac3d9e6be4f37eabd71867b09d0d2a0e Mon Sep 17 00:00:00 2001 From: tobitege <10787084+tobitege@users.noreply.github.com> Date: Wed, 21 Aug 2024 15:48:32 +0200 Subject: [PATCH] (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 --- tests/integration/conftest.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index 41d768c540..98751666ae 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -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)