From 57843cc45454032df54618aaea3d9dafe772b895 Mon Sep 17 00:00:00 2001 From: Jedd Morgan <45512892+JR-Morgan@users.noreply.github.com> Date: Thu, 12 Feb 2026 18:20:55 +0000 Subject: [PATCH 1/2] Test(integration): Add reusable workflow for running integration tests from the server repo (#443) * experiment * rename * we'll give this a go * fix path * correct path * the correct path this time * build docker image first * correct docker build * try this * ensure editor config is observed * typo --- ...gration-test-callable-from-server-repo.yml | 61 +++++++++++++++++++ .github/workflows/integration-test.yml | 2 +- Speckle.Sdk.slnx | 1 + docker-compose-internal.yml | 2 +- 4 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/integration-test-callable-from-server-repo.yml diff --git a/.github/workflows/integration-test-callable-from-server-repo.yml b/.github/workflows/integration-test-callable-from-server-repo.yml new file mode 100644 index 00000000..c6179c1c --- /dev/null +++ b/.github/workflows/integration-test-callable-from-server-repo.yml @@ -0,0 +1,61 @@ +name: Integration Test + +on: + workflow_call: + inputs: + speckle-sharp-sdk-ref: + required: true + type: string + +jobs: + integration-test: + env: + CLIENT_DIR: "./client" + CLIENT_REPO: "specklesystems/speckle-sharp-sdk" + SERVER_DIR: "./server" + SERVER_REPO: "specklesystems/speckle-server-internal" + SOLUTION: "Speckle.Sdk.sln" + SPECKLE_SERVER_IMAGE: "speckle-server:local" + runs-on: ubuntu-latest + steps: + - name: Checkout ${{ env.CLIENT_REPO }} + uses: actions/checkout@v6 + with: + path: ${{ env.CLIENT_DIR }} + repository: ${{ env.CLIENT_REPO }} + ref: ${{ inputs.speckle-sharp-sdk-ref }} + + - name: Checkout ${{ env.SERVER_REPO }} + uses: actions/checkout@v6 + with: + repository: ${{ env.SERVER_REPO }} + path: ${{ env.SERVER_DIR }} + + - name: Setup .NET SDK + uses: actions/setup-dotnet@v5 + with: + dotnet-version: 8.x.x + # cache: true + # cache-dependency-path: "**/packages.lock.json" + + - name: 🏗️ Build Server + run: docker build --file "./packages/server/Dockerfile" --tag ${{ env.SPECKLE_SERVER_IMAGE }} . + working-directory: ${{ env.SERVER_DIR }} + + - name: ⚙️ Spin up Server + run: docker compose --file "../${{ env.CLIENT_DIR }}/docker-compose-internal.yml" up --wait + working-directory: ${{ env.SERVER_DIR }} + env: + SPECKLE_SERVER_IMAGE: ${{ env.SPECKLE_SERVER_IMAGE }} + + - name: 📦 Restore .NET Solution + run: dotnet restore ${{ env.SOLUTION }} --locked-mode + working-directory: ${{ env.CLIENT_DIR }} + + - name: 🏗️ Build .NET Solution + run: dotnet build ${{ env.SOLUTION }} --configuration Release --no-restore -warnaserror + working-directory: ${{ env.CLIENT_DIR }} + + - name: 🔨 Run .NET Integration Tests + run: dotnet test ${{ env.SOLUTION }} --filter "(Category=Integration)&(Server!=Public)" --configuration Release --no-build --no-restore --verbosity=normal + working-directory: ${{ env.CLIENT_DIR }} diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index ec74abd5..3ed1c7b8 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -37,7 +37,7 @@ jobs: password: ${{ github.token }} - name: ⚙️ Spin up Server - run: docker compose -f ${{ inputs.docker-compose-file }} up --wait + run: docker compose --file ${{ inputs.docker-compose-file }} up --wait - name: 📦 Restore run: dotnet restore ${{ env.Solution }} --locked-mode diff --git a/Speckle.Sdk.slnx b/Speckle.Sdk.slnx index 3f7ded3f..2461b2a0 100644 --- a/Speckle.Sdk.slnx +++ b/Speckle.Sdk.slnx @@ -18,6 +18,7 @@ + diff --git a/docker-compose-internal.yml b/docker-compose-internal.yml index a4eee0df..11d2d9b6 100644 --- a/docker-compose-internal.yml +++ b/docker-compose-internal.yml @@ -52,7 +52,7 @@ services: start_period: 10s speckle-server: - image: ghcr.io/specklesystems/speckle-server:latest + image: ${SPECKLE_SERVER_IMAGE:-ghcr.io/specklesystems/speckle-server:latest} restart: always healthcheck: test: From a81aaca8feb525b407e67ec6addd81204ef238a7 Mon Sep 17 00:00:00 2001 From: Jedd Morgan <45512892+JR-Morgan@users.noreply.github.com> Date: Fri, 20 Feb 2026 12:02:34 +0000 Subject: [PATCH 2/2] Updated tests for recent server changes (#445) --- .../Api/GraphQL/Resources/ProjectResourceExceptionalTests.cs | 2 +- .../Api/GraphQL/Resources/SubscriptionResourceTests.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ProjectResourceExceptionalTests.cs b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ProjectResourceExceptionalTests.cs index 94034402..ab14c650 100644 --- a/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ProjectResourceExceptionalTests.cs +++ b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ProjectResourceExceptionalTests.cs @@ -106,7 +106,7 @@ public class ProjectResourceExceptionalTests : IAsyncLifetime ProjectUpdateRoleInput input = new(_secondUser.Account.id.NotNull(), "NonExistentProject", newRole); var ex = await Assert.ThrowsAsync(async () => _ = await Sut.UpdateRole(input)); - ex.InnerExceptions.Single().Should().BeOfType(); + ex.InnerExceptions.Single().Should().BeAssignableTo(); //v3 server responds with SpeckleGraphQLStreamNotFoundException exception, v2 reponds with SpeckleGraphQLForbiddenException } [Theory] diff --git a/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/SubscriptionResourceTests.cs b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/SubscriptionResourceTests.cs index 3ef89104..dff86650 100644 --- a/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/SubscriptionResourceTests.cs +++ b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/SubscriptionResourceTests.cs @@ -15,7 +15,7 @@ public class SubscriptionResourceTests : IAsyncLifetime #else private const int WAIT_PERIOD = 400; // For CI runs, a much smaller wait time is acceptable #endif - private const int TIMEOUT = WAIT_PERIOD + 1000; + private const int TIMEOUT = WAIT_PERIOD + WAIT_PERIOD + 600; private IClient _testUser; private Project _testProject; private Model _testModel;