diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ee4f88d7..c1f92183 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,6 +40,18 @@ jobs: matrix: ${{ needs.matrix.outputs.matrix }} cache_nonce: ${{ needs.matrix.outputs.cache_nonce }} + nat-integration: + name: NAT integration tests + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v4 + with: + submodules: recursive + ref: ${{ github.event.pull_request.head.sha }} + - name: Run NAT integration tests + run: make testNatIntegration + linting: runs-on: ubuntu-latest if: github.event_name == 'pull_request' diff --git a/Makefile b/Makefile index 2a1a05a3..77512966 100644 --- a/Makefile +++ b/Makefile @@ -128,7 +128,13 @@ deps: | libbacktrace endif libplum: - + "$(MAKE)" -C vendor/nim-libplum/vendor/libplum libplum.a CC=$(CC) $(HANDLE_OUTPUT) + cmake -B vendor/nim-libplum/vendor/libplum/build \ + -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_SHARED_LIBS=OFF \ + vendor/nim-libplum/vendor/libplum $(HANDLE_OUTPUT) + + $(MAKE) -C vendor/nim-libplum/vendor/libplum/build $(HANDLE_OUTPUT) + cp vendor/nim-libplum/vendor/libplum/build/libplum.a \ + vendor/nim-libplum/vendor/libplum/libplum.a update: | update-common diff --git a/build.nims b/build.nims index 1ecc0319..484d365a 100644 --- a/build.nims +++ b/build.nims @@ -82,7 +82,7 @@ task testNatPortMapping, "Run UPnP NAT integration test (requires miniupnpd cont buildBinary "storage", outName = "storage", params = "-d:chronicles_runtime_filtering -d:chronicles_log_level=TRACE" - putEnv("STORAGE_INTEGRATION_TEST_INCLUDES", "integration/1_minute/testnatupnp.nim") + putEnv("STORAGE_INTEGRATION_TEST_INCLUDES", "nat/testnatupnp.nim") test "testIntegration", outName = "testIntegrationNat" # Used to build the testing binarie in Docker @@ -90,7 +90,7 @@ task buildNatPortMappingBinaries, "Build UPnP NAT test binaries without running buildBinary "storage", outName = "storage", params = "-d:chronicles_runtime_filtering -d:chronicles_log_level=TRACE" - putEnv("STORAGE_INTEGRATION_TEST_INCLUDES", "integration/1_minute/testnatupnp.nim") + putEnv("STORAGE_INTEGRATION_TEST_INCLUDES", "nat/testnatupnp.nim") buildBinary "testIntegration", outName = "testIntegrationNat", srcDir = "tests/" task build, "build Logos Storage binary": diff --git a/tests/integration/1_minute/testnatupnp.nim b/tests/nat/testnatupnp.nim similarity index 90% rename from tests/integration/1_minute/testnatupnp.nim rename to tests/nat/testnatupnp.nim index 747246a9..9552ae71 100644 --- a/tests/integration/1_minute/testnatupnp.nim +++ b/tests/nat/testnatupnp.nim @@ -2,11 +2,11 @@ import std/[json, strutils, sequtils] import pkg/chronos import pkg/questionable/results -import ../multinodes -import ../storageclient -import ../storageconfig +import ../integration/multinodes +import ../integration/storageclient +import ../integration/storageconfig -import ../nathelper +import ../integration/nathelper const DetectionTimeout = 15_000