Skip to content

Commit 903aac7

Browse files
committed
Fix tests
1 parent 01b562b commit 903aac7

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

tests/integration/test_logger.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,8 @@
1313
# limitations under the License.
1414

1515
import platform
16-
1716
from unittest import mock
1817

19-
import pytest
20-
2118
from tests import REPORT_PORTAL_SERVICE
2219
from tests.helpers import utils
2320

@@ -36,11 +33,12 @@ def test_launch_log(mock_client_init):
3633

3734

3835
@mock.patch(REPORT_PORTAL_SERVICE)
39-
@pytest.mark.skipif(
40-
platform.system() == "Linux" and platform.release() == "6.8.0-1017-azure",
41-
reason="GitHub Actions Linux runner has an issue with binary data reading",
42-
)
4336
def test_binary_file_log(mock_client_init):
37+
if platform.system() == "Linux" and platform.release() == "6.8.0-1017-azure":
38+
# GitHub Actions Linux runner has an issue with binary data reading
39+
data_type = "application/octet-stream"
40+
else:
41+
data_type = "image/jpeg"
4442
result = utils.run_robot_tests(["examples/binary_file_log_as_text.robot"])
4543
assert result == 0 # the test successfully passed
4644

@@ -49,5 +47,5 @@ def test_binary_file_log(mock_client_init):
4947
assert len(calls) == 3
5048

5149
messages = set(map(lambda x: x[1]["message"], calls))
52-
error_msg = 'Binary data of type "image/jpeg" logging skipped, as it was processed as text and hence corrupted.'
50+
error_msg = f'Binary data of type "{data_type}" logging skipped, as it was processed as text and hence corrupted.'
5351
assert error_msg in messages

tests/integration/test_remove_keywords.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
import platform
1516
from unittest import mock
1617

1718
import pytest
@@ -44,6 +45,11 @@ def test_remove_keyword_not_provided(mock_client_init):
4445
assert statuses == ["PASSED"] * 9
4546

4647

48+
def is_gha_agent() -> bool:
49+
# GitHub Actions Linux runner has an issue with binary data reading
50+
return platform.system() == "Linux" and platform.release() == "6.8.0-1017-azure"
51+
52+
4753
@pytest.mark.parametrize(
4854
"file, keyword_to_remove, exit_code, expected_statuses, log_number, skip_idx, skip_message",
4955
[
@@ -273,7 +279,8 @@ def test_remove_keyword_not_provided(mock_client_init):
273279
["PASSED"] * 5,
274280
3,
275281
2,
276-
'Binary data of type "image/jpeg" logging skipped, as it was processed as text and hence corrupted.',
282+
f'Binary data of type "{"application/octet-stream" if is_gha_agent else "image/jpeg"}" logging skipped, as'
283+
" it was processed as text and hence corrupted.",
277284
),
278285
(
279286
"examples/rkie_keyword.robot",

0 commit comments

Comments
 (0)