Ignore libcurl library warning in the check itself

This commit is contained in:
Fabrice Reix 2023-10-10 11:39:08 +02:00 committed by hurl-bot
parent b20813bc29
commit ecc1c1fc8b
No known key found for this signature in database
GPG Key ID: 1283A2B4A0DCAF8D
2 changed files with 16 additions and 10 deletions

View File

@ -249,7 +249,7 @@ jobs:
bin/test/test_prerequisites.sh
echo "::endgroup::"
echo "::group::Tests"
bin/test/test_integ.sh || true # to be fixed => "error in stderr actual: <hurl: /lib64/libcurl.so.4: no version information available (required by hurl)"
bin/test/test_integ.sh
echo "::endgroup::"
- name: Archive production artifacts
uses: actions/upload-artifact@v3

View File

@ -86,12 +86,12 @@ def test_stdout_pattern(f, result):
# curl debug logs are too dependent on the context, so we filter
# them and not take them into account for testing differences.
expected = remove_curl_debug_lines(expected)
expected = ignore_lines(expected)
expected_lines = expected.split("\n")
expected_pattern_lines = [parse_pattern(line) for line in expected_lines]
actual = decode_string(result.stdout)
actual = remove_curl_debug_lines(actual)
actual = ignore_lines(actual)
actual_lines = re.split(r"\r?\n", actual)
if len(actual_lines) != len(expected_pattern_lines):
@ -127,8 +127,8 @@ def test_stderr(f, result):
if not os.path.exists(f):
return
expected = open(f, encoding="utf-8").read()
actual = decode_string(result.stderr)
expected = ignore_lines(open(f, encoding="utf-8").read())
actual = ignore_lines(decode_string(result.stderr))
if actual != expected:
print(">>> error in stderr")
print(f"actual : <{actual}>\nexpected: <{expected}>")
@ -145,12 +145,12 @@ def test_stderr_pattern(f, result):
# curl debug logs are too dependent on the context, so we filter
# them and not take them into account for testing differences.
expected = remove_curl_debug_lines(expected)
expected = ignore_lines(expected)
expected_lines = expected.split("\n")
expected_pattern_lines = [parse_pattern(line) for line in expected_lines]
actual = decode_string(result.stderr)
actual = remove_curl_debug_lines(actual)
actual = ignore_lines(actual)
actual_lines = re.split(r"\r?\n", actual)
if len(actual_lines) != len(expected_pattern_lines):
@ -190,10 +190,16 @@ def parse_pattern(s: str) -> str:
return s
def remove_curl_debug_lines(text: str) -> str:
def ignore_lines(text: str) -> str:
"""Removes curl debug logs from text and returns the new text."""
lines = text.split("\n")
lines = [line for line in lines if not line.startswith("**")]
lines = []
for line in text.split("\n"):
if line.startswith("**"): # curl debug info
continue
if "/lib64/libcurl.so.4: no version information available" in line:
continue
lines.append(line)
return "\n".join(lines)