Skip to content

Commit

Permalink
fix: skip tests which require the ACN node build on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
angrybayblade committed Sep 22, 2023
1 parent 12914f8 commit a1226bc
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 10 deletions.
10 changes: 9 additions & 1 deletion packages/valory/connections/p2p_libp2p/tests/base.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2022 Valory AG
# Copyright 2022-2023 Valory AG
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -23,10 +23,13 @@
import functools
import inspect
import itertools
import platform
import tempfile
from typing import Any, Callable, Type
from unittest import mock

import pytest

from packages.fetchai.protocols.default.message import DefaultMessage


Expand All @@ -40,6 +43,11 @@
DefaultMessage.protocol_specification_id
)

SKIP_WINDOWS = pytest.mark.skipif(
condition=(platform.system() == "Windows"),
reason="https://github.com/golang/go/issues/51007",
)


def libp2p_log_on_failure(fn: Callable) -> Callable:
"""Decorate a method running a libp2p node to print its logs in case test fails."""
Expand Down
12 changes: 5 additions & 7 deletions packages/valory/connections/p2p_libp2p/tests/test_aea_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@

import json
import os
import platform
from pathlib import Path
from typing import List

import pytest
from aea_ledger_cosmos import CosmosCrypto
from aea_ledger_ethereum.ethereum import EthereumCrypto as Ethereum

Expand All @@ -40,14 +38,18 @@
LIBP2P_CERT_NOT_AFTER,
LIBP2P_CERT_NOT_BEFORE,
)
from packages.valory.connections.p2p_libp2p.tests.base import libp2p_log_on_failure_all
from packages.valory.connections.p2p_libp2p.tests.base import (
SKIP_WINDOWS,
libp2p_log_on_failure_all,
)


p2p_libp2p_path = f"vendor.{p2p_libp2p.__name__.split('.', 1)[-1]}"
DEFAULT_NET_SIZE = 4
LIBP2P_LAUNCH_TIMEOUT = 20 # may downloads up to ~66Mb


@SKIP_WINDOWS
class BaseP2PLibp2pConnectionAEATest(AEATestCaseEmpty):
"""Base class for AEA CLI tests"""

Expand Down Expand Up @@ -91,10 +93,6 @@ def run_aea_cli_test(self) -> None:
assert not missing_strings


@pytest.mark.skipif(
condition=(platform.platform() == "Windows"),
reason="https://github.com/golang/go/issues/51007",
)
@libp2p_log_on_failure_all
class TestP2PLibp2pConnectionAEARunningEthereumConfigNode(
BaseP2PLibp2pConnectionAEATest
Expand Down
4 changes: 3 additions & 1 deletion packages/valory/connections/p2p_libp2p/tests/test_build.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2022 Valory AG
# Copyright 2022-2023 Valory AG
# Copyright 2018-2019 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -40,6 +40,7 @@
check_versions as base_check_versions,
)
from packages.valory.connections.p2p_libp2p.check_dependencies import version_to_string
from packages.valory.connections.p2p_libp2p.tests.base import SKIP_WINDOWS


def check_versions() -> None:
Expand Down Expand Up @@ -95,6 +96,7 @@ def test_check_versions_negative_cannot_parse_version(capsys: CaptureFixture) ->
)


@SKIP_WINDOWS
def test_build_node() -> None:
"""Test build node function."""
with tempfile.TemporaryDirectory() as build_dir:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2022 Valory AG
# Copyright 2022-2023 Valory AG
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -134,6 +134,10 @@ def test_libp2p_connection_mixed_ip_address() -> None:
assert _ip_all_private_or_all_public(["fetch.ai", "acn.fetch.ai"]) is True


@pytest.mark.skipif(
condition=(platform.system() == "Windows"),
reason="https://github.com/golang/go/issues/51007",
)
def test_libp2p_connection_node_config_registration_delay() -> None:
"""Test node registration delay configuration"""

Expand Down

0 comments on commit a1226bc

Please sign in to comment.