From e0814c9860e64661b0b315c6240e45af376d4238 Mon Sep 17 00:00:00 2001 From: pacrob <5199899+pacrob@users.noreply.github.com> Date: Sat, 25 Jan 2025 15:16:54 -0700 Subject: [PATCH] move interop tests tools into tests folder --- Makefile | 3 ++- docs/contributing.rst | 2 +- setup.py | 1 + tests/interop/conftest.py | 4 ++-- tests/interop/test_bindings.py | 2 +- tests/interop/test_echo.py | 12 ++++++------ tests/interop/test_pubsub.py | 6 +++--- {libp2p/tools => tests/utils}/interop/__init__.py | 0 {libp2p/tools => tests/utils}/interop/constants.py | 0 {libp2p/tools => tests/utils}/interop/daemon.py | 0 {libp2p/tools => tests/utils}/interop/envs.py | 0 {libp2p/tools => tests/utils}/interop/process.py | 0 {libp2p/tools => tests/utils}/interop/utils.py | 0 13 files changed, 16 insertions(+), 14 deletions(-) rename {libp2p/tools => tests/utils}/interop/__init__.py (100%) rename {libp2p/tools => tests/utils}/interop/constants.py (100%) rename {libp2p/tools => tests/utils}/interop/daemon.py (100%) rename {libp2p/tools => tests/utils}/interop/envs.py (100%) rename {libp2p/tools => tests/utils}/interop/process.py (100%) rename {libp2p/tools => tests/utils}/interop/utils.py (100%) diff --git a/Makefile b/Makefile index d78b722f..f7f1243b 100644 --- a/Makefile +++ b/Makefile @@ -38,7 +38,8 @@ lint: ) test: - python -m pytest tests + # remove core specification once interop tests pass + python -m pytest tests/core # protobufs management diff --git a/docs/contributing.rst b/docs/contributing.rst index d760d02c..84ad23df 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -100,7 +100,7 @@ GitHub interface and make sure all tests are passing. In general pull requests t do not pass the CI build yet won't get reviewed unless explicitly requested. If the pull request introduces changes that should be reflected in the release notes, -please add a `newsfragment` file as explained +please add a newsfragment file as explained `here `_. If possible, the change to the release notes file should be included in the commit that diff --git a/setup.py b/setup.py index 1aa753b9..a2cdcc1e 100644 --- a/setup.py +++ b/setup.py @@ -23,6 +23,7 @@ extras_require = { "towncrier>=24,<25", ], "test": [ + "p2pclient==0.2.0", "pytest>=7.0.0", "pytest-xdist>=2.4.0", "pytest-trio>=0.5.2", diff --git a/tests/interop/conftest.py b/tests/interop/conftest.py index 39efbe31..372135aa 100644 --- a/tests/interop/conftest.py +++ b/tests/interop/conftest.py @@ -21,10 +21,10 @@ from libp2p.tools.factories import ( HostFactory, PubsubFactory, ) -from libp2p.tools.interop.daemon import ( +from tests.utils.interop.daemon import ( make_p2pd, ) -from libp2p.tools.interop.utils import ( +from tests.utils.interop.utils import ( connect, ) diff --git a/tests/interop/test_bindings.py b/tests/interop/test_bindings.py index 4fbc309e..759cf5de 100644 --- a/tests/interop/test_bindings.py +++ b/tests/interop/test_bindings.py @@ -4,7 +4,7 @@ import trio from libp2p.tools.factories import ( HostFactory, ) -from libp2p.tools.interop.utils import ( +from tests.utils.interop.utils import ( connect, ) diff --git a/tests/interop/test_echo.py b/tests/interop/test_echo.py index 00a990f6..7fe09426 100644 --- a/tests/interop/test_echo.py +++ b/tests/interop/test_echo.py @@ -16,15 +16,15 @@ from libp2p.peer.peerinfo import ( from libp2p.tools.factories import ( HostFactory, ) -from libp2p.tools.interop.envs import ( - GO_BIN_PATH, -) -from libp2p.tools.interop.process import ( - BaseInteractiveProcess, -) from libp2p.typing import ( TProtocol, ) +from tests.utils.interop.envs import ( + GO_BIN_PATH, +) +from tests.utils.interop.process import ( + BaseInteractiveProcess, +) ECHO_PATH = GO_BIN_PATH / "echo" ECHO_PROTOCOL_ID = TProtocol("/echo/1.0.0") diff --git a/tests/interop/test_pubsub.py b/tests/interop/test_pubsub.py index 1132831d..2b70b815 100644 --- a/tests/interop/test_pubsub.py +++ b/tests/interop/test_pubsub.py @@ -22,12 +22,12 @@ from libp2p.pubsub.subscription import ( from libp2p.tools.factories import ( PubsubFactory, ) -from libp2p.tools.interop.utils import ( - connect, -) from libp2p.utils import ( read_varint_prefixed_bytes, ) +from tests.utils.interop.utils import ( + connect, +) TOPIC_0 = "ABALA" TOPIC_1 = "YOOOO" diff --git a/libp2p/tools/interop/__init__.py b/tests/utils/interop/__init__.py similarity index 100% rename from libp2p/tools/interop/__init__.py rename to tests/utils/interop/__init__.py diff --git a/libp2p/tools/interop/constants.py b/tests/utils/interop/constants.py similarity index 100% rename from libp2p/tools/interop/constants.py rename to tests/utils/interop/constants.py diff --git a/libp2p/tools/interop/daemon.py b/tests/utils/interop/daemon.py similarity index 100% rename from libp2p/tools/interop/daemon.py rename to tests/utils/interop/daemon.py diff --git a/libp2p/tools/interop/envs.py b/tests/utils/interop/envs.py similarity index 100% rename from libp2p/tools/interop/envs.py rename to tests/utils/interop/envs.py diff --git a/libp2p/tools/interop/process.py b/tests/utils/interop/process.py similarity index 100% rename from libp2p/tools/interop/process.py rename to tests/utils/interop/process.py diff --git a/libp2p/tools/interop/utils.py b/tests/utils/interop/utils.py similarity index 100% rename from libp2p/tools/interop/utils.py rename to tests/utils/interop/utils.py