From 95b9859bcd75604f00cfa807e9451a7372ac6798 Mon Sep 17 00:00:00 2001 From: vladopajic Date: Thu, 29 May 2025 18:14:12 +0200 Subject: [PATCH] chore(interop): move interop code to separate folder (#1413) --- .github/workflows/interop.yml | 8 ++++---- .github/workflows/linters.yml | 2 +- .../hole-punching}/Dockerfile | 2 +- .../hole-punching}/hole_punching.nim | 3 +-- .../hole-punching}/version.json | 0 {tests/transport-interop => interop/transport}/Dockerfile | 4 ++-- {tests/transport-interop => interop/transport}/main.nim | 0 .../transport-interop => interop/transport}/version.json | 0 8 files changed, 9 insertions(+), 10 deletions(-) rename {tests/hole-punching-interop => interop/hole-punching}/Dockerfile (91%) rename {tests/hole-punching-interop => interop/hole-punching}/hole_punching.nim (98%) rename {tests/hole-punching-interop => interop/hole-punching}/version.json (100%) rename {tests/transport-interop => interop/transport}/Dockerfile (84%) rename {tests/transport-interop => interop/transport}/main.nim (100%) rename {tests/transport-interop => interop/transport}/version.json (100%) diff --git a/.github/workflows/interop.yml b/.github/workflows/interop.yml index 645caee71..96e77c058 100644 --- a/.github/workflows/interop.yml +++ b/.github/workflows/interop.yml @@ -27,7 +27,7 @@ jobs: - uses: actions/checkout@v4 - uses: docker/setup-buildx-action@v3 - name: Build image - run: docker buildx build --load -t nim-libp2p-head -f tests/transport-interop/Dockerfile . + run: docker buildx build --load -t nim-libp2p-head -f interop/transport/Dockerfile . - name: Run tests uses: libp2p/test-plans/.github/actions/run-transport-interop-test@master with: @@ -35,7 +35,7 @@ jobs: # without suffix action fails because "hole-punching-interop" artifacts have # the same name as "transport-interop" artifacts test-results-suffix: transport-interop - extra-versions: ${{ github.workspace }}/tests/transport-interop/version.json + extra-versions: ${{ github.workspace }}/interop/transport/version.json s3-cache-bucket: ${{ vars.S3_LIBP2P_BUILD_CACHE_BUCKET_NAME }} s3-access-key-id: ${{ vars.S3_LIBP2P_BUILD_CACHE_AWS_ACCESS_KEY_ID }} s3-secret-access-key: ${{ secrets.S3_LIBP2P_BUILD_CACHE_AWS_SECRET_ACCESS_KEY }} @@ -48,12 +48,12 @@ jobs: - uses: actions/checkout@v4 - uses: docker/setup-buildx-action@v3 - name: Build image - run: docker buildx build --load -t nim-libp2p-head -f tests/hole-punching-interop/Dockerfile . + run: docker buildx build --load -t nim-libp2p-head -f interop/hole-punching/Dockerfile . - name: Run tests uses: libp2p/test-plans/.github/actions/run-interop-hole-punch-test@master with: test-filter: nim-libp2p-head - extra-versions: ${{ github.workspace }}/tests/hole-punching-interop/version.json + extra-versions: ${{ github.workspace }}/interop/hole-punching/version.json s3-cache-bucket: ${{ vars.S3_LIBP2P_BUILD_CACHE_BUCKET_NAME }} s3-access-key-id: ${{ vars.S3_LIBP2P_BUILD_CACHE_AWS_ACCESS_KEY_ID }} s3-secret-access-key: ${{ secrets.S3_LIBP2P_BUILD_CACHE_AWS_SECRET_ACCESS_KEY }} diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index 3ad7c546a..50bcda766 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -22,6 +22,6 @@ jobs: uses: arnetheduck/nph-action@v1 with: version: 0.6.1 - options: "examples libp2p tests tools *.nim*" + options: "examples libp2p tests interop tools *.nim*" fail: true suggest: true diff --git a/tests/hole-punching-interop/Dockerfile b/interop/hole-punching/Dockerfile similarity index 91% rename from tests/hole-punching-interop/Dockerfile rename to interop/hole-punching/Dockerfile index 1cef2aed5..990324493 100644 --- a/tests/hole-punching-interop/Dockerfile +++ b/interop/hole-punching/Dockerfile @@ -11,7 +11,7 @@ RUN cd nim-libp2p && nimble install_pinned && nimble install "redis@#b341fe240db COPY . nim-libp2p/ -RUN cd nim-libp2p && nim c --skipParentCfg --NimblePath:./nimbledeps/pkgs --mm:refc -d:chronicles_log_level=DEBUG -d:chronicles_default_output_device=stderr -d:release --threads:off --skipProjCfg -o:hole-punching-tests ./tests/hole-punching-interop/hole_punching.nim +RUN cd nim-libp2p && nim c --skipParentCfg --NimblePath:./nimbledeps/pkgs --mm:refc -d:chronicles_log_level=DEBUG -d:chronicles_default_output_device=stderr -d:release --threads:off --skipProjCfg -o:hole-punching-tests ./interop/hole-punching/hole_punching.nim FROM --platform=linux/amd64 debian:bullseye-slim RUN --mount=type=cache,target=/var/cache/apt apt-get update && apt-get install -y dnsutils jq curl tcpdump iproute2 libssl-dev diff --git a/tests/hole-punching-interop/hole_punching.nim b/interop/hole-punching/hole_punching.nim similarity index 98% rename from tests/hole-punching-interop/hole_punching.nim rename to interop/hole-punching/hole_punching.nim index 60e24ef70..85dd91f21 100644 --- a/tests/hole-punching-interop/hole_punching.nim +++ b/interop/hole-punching/hole_punching.nim @@ -15,8 +15,7 @@ import protocols/connectivity/autonat/service, protocols/ping, ] -import ../stubs/autonatclientstub -import ../errorhelpers +import ../../tests/[stubs/autonatclientstub, errorhelpers] logScope: topics = "hp interop node" diff --git a/tests/hole-punching-interop/version.json b/interop/hole-punching/version.json similarity index 100% rename from tests/hole-punching-interop/version.json rename to interop/hole-punching/version.json diff --git a/tests/transport-interop/Dockerfile b/interop/transport/Dockerfile similarity index 84% rename from tests/transport-interop/Dockerfile rename to interop/transport/Dockerfile index 161c25ca8..91fa292f3 100644 --- a/tests/transport-interop/Dockerfile +++ b/interop/transport/Dockerfile @@ -13,6 +13,6 @@ COPY . nim-libp2p/ RUN \ cd nim-libp2p && \ - nim c --skipProjCfg --skipParentCfg --NimblePath:./nimbledeps/pkgs -p:nim-libp2p --mm:refc -d:libp2p_quic_support -d:chronicles_log_level=WARN -d:chronicles_default_output_device=stderr --threads:off ./tests/transport-interop/main.nim + nim c --skipProjCfg --skipParentCfg --NimblePath:./nimbledeps/pkgs -p:nim-libp2p --mm:refc -d:libp2p_quic_support -d:chronicles_log_level=WARN -d:chronicles_default_output_device=stderr --threads:off ./interop/transport/main.nim -ENTRYPOINT ["/app/nim-libp2p/tests/transport-interop/main"] +ENTRYPOINT ["/app/nim-libp2p/interop/transport/main"] diff --git a/tests/transport-interop/main.nim b/interop/transport/main.nim similarity index 100% rename from tests/transport-interop/main.nim rename to interop/transport/main.nim diff --git a/tests/transport-interop/version.json b/interop/transport/version.json similarity index 100% rename from tests/transport-interop/version.json rename to interop/transport/version.json