From 1a92bf2434a73bb7e41265c189847158d1576f07 Mon Sep 17 00:00:00 2001 From: David Fowler Date: Thu, 30 Jan 2025 01:31:58 -0800 Subject: [PATCH 01/28] Added github action to run a subset of tests --- .github/workflows/tests.yml | 84 +++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000000..c2b9a9372b --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,84 @@ +name: Run Integration Tests + +on: + pull_request: + branches: [ main ] + +jobs: + test: + runs-on: ubuntu-latest + timeout-minutes: 60 + strategy: + fail-fast: false + matrix: + include: + - project: tests/Aspire.Hosting.Elasticsearch.Tests/Aspire.Hosting.Elasticsearch.Tests.csproj + name: Elasticsearch + - project: tests/Aspire.Hosting.PostgreSQL.Tests/Aspire.Hosting.PostgreSQL.Tests.csproj + name: PostgreSQL + - project: tests/Aspire.Hosting.Oracle.Tests/Aspire.Hosting.Oracle.Tests.csproj + name: Oracle + - project: tests/Aspire.Hosting.Kafka.Tests/Aspire.Hosting.Kafka.Tests.csproj + name: Kafka + - project: tests/Aspire.Hosting.Tests/Aspire.Hosting.Tests.csproj + name: Hosting + - project: tests/Aspire.Hosting.Redis.Tests/Aspire.Hosting.Redis.Tests.csproj + name: Redis + - project: tests/Aspire.Hosting.Azure.Tests/Aspire.Hosting.Azure.Tests.csproj + name: Azure + - project: tests/Aspire.Playground.Tests/Aspire.Playground.Tests.csproj + name: Playground + # Add more projects as needed + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up .NET Core + uses: actions/setup-dotnet@v4 + with: + dotnet-version: | + 8.x + 9.x + + - name: Trust HTTPS development certificate + run: dotnet dev-certs https --trust + + - name: Verify Docker is running + run: docker info + + - name: Install Azure Functions Core Tools + run: | + sudo apt-get update + sudo apt-get install -y azure-functions-core-tools-4 + + - name: Restore dependencies + run: dotnet restore ${{ matrix.project }} + + - name: Build projects + run: dotnet build ${{ matrix.project }} /p:CI=false --no-restore + + - name: Run tests + id: run-tests + run: | + dotnet test ${{ matrix.project }} \ + -s eng/testing/.runsettings \ + --logger "console;verbosity=normal" \ + --logger "trx" \ + --logger html \ + --blame \ + --blame-hang-timeout 7m \ + --results-directory testresults \ + --no-restore \ + --no-build \ + /p:CI=false + + - name: Compress test results + if: always() + run: zip -r testresults.zip testresults + + - name: Upload test results artifact + if: always() + uses: actions/upload-artifact@v4 + with: + name: testresults-${{ matrix.name }} + path: testresults.zip From d0b40fa0aac5edde02607cf44757bc303fe7b8ef Mon Sep 17 00:00:00 2001 From: David Fowler Date: Thu, 30 Jan 2025 01:56:41 -0800 Subject: [PATCH 02/28] SkipUnstableEmulators --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c2b9a9372b..d130c080ba 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -55,7 +55,7 @@ jobs: run: dotnet restore ${{ matrix.project }} - name: Build projects - run: dotnet build ${{ matrix.project }} /p:CI=false --no-restore + run: dotnet build ${{ matrix.project }} /p:CI=false /p:SkipUnstableEmulators=true --no-restore - name: Run tests id: run-tests From 7de7b5bbe3234a08da56e805a1e763b62754a450 Mon Sep 17 00:00:00 2001 From: David Fowler Date: Thu, 30 Jan 2025 02:20:10 -0800 Subject: [PATCH 03/28] Fix pgweb test --- .../PostgresBuilderExtensions.cs | 7 +++++++ .../PostgresFunctionalTests.cs | 9 +++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/Aspire.Hosting.PostgreSQL/PostgresBuilderExtensions.cs b/src/Aspire.Hosting.PostgreSQL/PostgresBuilderExtensions.cs index ab8f12c48e..b5501e5105 100644 --- a/src/Aspire.Hosting.PostgreSQL/PostgresBuilderExtensions.cs +++ b/src/Aspire.Hosting.PostgreSQL/PostgresBuilderExtensions.cs @@ -293,6 +293,8 @@ public static IResourceBuilder WithPgWeb(this IResourceB pgwebContainerBuilder.WithRelationship(builder.Resource, "PgWeb"); + pgwebContainerBuilder.WithHttpHealthCheck(); + builder.ApplicationBuilder.Eventing.Subscribe(async (e, ct) => { var adminResource = builder.ApplicationBuilder.Resources.OfType().Single(); @@ -304,6 +306,11 @@ public static IResourceBuilder WithPgWeb(this IResourceB Directory.CreateDirectory(serverFileMount.Source!); } + if (!OperatingSystem.IsWindows()) + { + File.SetUnixFileMode(serverFileMount.Source!, UnixFileMode.UserRead | UnixFileMode.UserWrite | UnixFileMode.GroupRead | UnixFileMode.OtherRead); + } + foreach (var postgresDatabase in postgresInstances) { var user = postgresDatabase.Parent.UserNameParameter?.Value ?? "postgres"; diff --git a/tests/Aspire.Hosting.PostgreSQL.Tests/PostgresFunctionalTests.cs b/tests/Aspire.Hosting.PostgreSQL.Tests/PostgresFunctionalTests.cs index 51a6db4d12..6151bd70b2 100644 --- a/tests/Aspire.Hosting.PostgreSQL.Tests/PostgresFunctionalTests.cs +++ b/tests/Aspire.Hosting.PostgreSQL.Tests/PostgresFunctionalTests.cs @@ -162,12 +162,14 @@ public async Task VerifyWithPgWeb() using var app = builder.Build(); - await app.StartAsync(); + var resourceNotificationService = app.Services.GetRequiredService(); - await app.WaitForTextAsync("Starting server...", resourceName: pgWebBuilder.Resource.Name); + await app.StartAsync(); var client = app.CreateHttpClient(pgWebBuilder.Resource.Name, "http"); + await resourceNotificationService.WaitForResourceHealthyAsync(pgWebBuilder.Resource.Name).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); + var httpContent = new MultipartFormDataContent { { new StringContent(dbName), "bookmark_id" } @@ -177,6 +179,9 @@ public async Task VerifyWithPgWeb() var response = await client.PostAsync("/api/connect", httpContent); var d = await response.Content.ReadAsStringAsync(); + + testOutputHelper.WriteLine("RESPONSE: \r\n" + d); + response.EnsureSuccessStatusCode(); } From ff793b58c5fd6828a3c9238212cd8c939a28d611 Mon Sep 17 00:00:00 2001 From: David Fowler Date: Thu, 30 Jan 2025 02:24:05 -0800 Subject: [PATCH 04/28] Try ci true --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d130c080ba..834969960a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -55,7 +55,7 @@ jobs: run: dotnet restore ${{ matrix.project }} - name: Build projects - run: dotnet build ${{ matrix.project }} /p:CI=false /p:SkipUnstableEmulators=true --no-restore + run: dotnet build ${{ matrix.project }} /p:CI=true --no-restore - name: Run tests id: run-tests @@ -70,7 +70,7 @@ jobs: --results-directory testresults \ --no-restore \ --no-build \ - /p:CI=false + /p:CI=true - name: Compress test results if: always() From 8035758425adda72d5f2f1c036a0c0581cef4f49 Mon Sep 17 00:00:00 2001 From: David Fowler Date: Thu, 30 Jan 2025 02:31:15 -0800 Subject: [PATCH 05/28] Get the bin log --- .github/workflows/tests.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 834969960a..10c270b9cb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -55,7 +55,7 @@ jobs: run: dotnet restore ${{ matrix.project }} - name: Build projects - run: dotnet build ${{ matrix.project }} /p:CI=true --no-restore + run: dotnet build ${{ matrix.project }} /p:CI=true --no-restore /bl - name: Run tests id: run-tests @@ -76,6 +76,13 @@ jobs: if: always() run: zip -r testresults.zip testresults + - name: Upload bin log artifact + if: always() + uses: actions/upload-artifact@v4 + with: + name: binlog-${{ matrix.name }} + path: $(System.DefaultWorkingDirectory)/**/*.binlog + - name: Upload test results artifact if: always() uses: actions/upload-artifact@v4 From b8a8bd50a5e74d2d0eba43ee154be96e243c784f Mon Sep 17 00:00:00 2001 From: David Fowler Date: Thu, 30 Jan 2025 02:35:22 -0800 Subject: [PATCH 06/28] Fix? --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 10c270b9cb..8451eb0e1e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -81,7 +81,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: binlog-${{ matrix.name }} - path: $(System.DefaultWorkingDirectory)/**/*.binlog + path: /**/*.binlog - name: Upload test results artifact if: always() From cebd69b52ca136a95270177e5c331a75f9e06fb2 Mon Sep 17 00:00:00 2001 From: David Fowler Date: Thu, 30 Jan 2025 02:37:00 -0800 Subject: [PATCH 07/28] ?? --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8451eb0e1e..85a01c73fb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -81,7 +81,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: binlog-${{ matrix.name }} - path: /**/*.binlog + path: "**/*.binlog" - name: Upload test results artifact if: always() From 7ebc84a5411e6af25251583580d28f2764f38f14 Mon Sep 17 00:00:00 2001 From: David Fowler Date: Thu, 30 Jan 2025 02:38:36 -0800 Subject: [PATCH 08/28] Moar perms --- src/Aspire.Hosting.PostgreSQL/PostgresBuilderExtensions.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Aspire.Hosting.PostgreSQL/PostgresBuilderExtensions.cs b/src/Aspire.Hosting.PostgreSQL/PostgresBuilderExtensions.cs index b5501e5105..c23c764611 100644 --- a/src/Aspire.Hosting.PostgreSQL/PostgresBuilderExtensions.cs +++ b/src/Aspire.Hosting.PostgreSQL/PostgresBuilderExtensions.cs @@ -308,7 +308,11 @@ public static IResourceBuilder WithPgWeb(this IResourceB if (!OperatingSystem.IsWindows()) { - File.SetUnixFileMode(serverFileMount.Source!, UnixFileMode.UserRead | UnixFileMode.UserWrite | UnixFileMode.GroupRead | UnixFileMode.OtherRead); + var mode = UnixFileMode.UserRead | UnixFileMode.UserWrite | UnixFileMode.UserExecute | + UnixFileMode.GroupRead | UnixFileMode.GroupWrite | UnixFileMode.GroupExecute | + UnixFileMode.OtherRead | UnixFileMode.OtherWrite | UnixFileMode.OtherExecute; + + File.SetUnixFileMode(serverFileMount.Source!, mode); } foreach (var postgresDatabase in postgresInstances) From 99b99b538fd3fd45afb8bf274296681e4c4b23c0 Mon Sep 17 00:00:00 2001 From: David Fowler Date: Thu, 30 Jan 2025 02:40:23 -0800 Subject: [PATCH 09/28] This? --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 85a01c73fb..87fc8b80d7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -55,7 +55,7 @@ jobs: run: dotnet restore ${{ matrix.project }} - name: Build projects - run: dotnet build ${{ matrix.project }} /p:CI=true --no-restore /bl + run: dotnet build ${{ matrix.project }} /p:ContinuousIntegration=true --no-restore /bl - name: Run tests id: run-tests @@ -70,7 +70,7 @@ jobs: --results-directory testresults \ --no-restore \ --no-build \ - /p:CI=true + /p:ContinuousIntegration=true - name: Compress test results if: always() From 2f67e918504c23704b9dae7dc87e4021510a859a Mon Sep 17 00:00:00 2001 From: David Fowler Date: Thu, 30 Jan 2025 07:40:00 -0800 Subject: [PATCH 10/28] ContinuousIntegrationBuild --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 87fc8b80d7..363e98ce03 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -55,7 +55,7 @@ jobs: run: dotnet restore ${{ matrix.project }} - name: Build projects - run: dotnet build ${{ matrix.project }} /p:ContinuousIntegration=true --no-restore /bl + run: dotnet build ${{ matrix.project }} /p:ContinuousIntegrationBuild=true --no-restore /bl - name: Run tests id: run-tests @@ -70,7 +70,7 @@ jobs: --results-directory testresults \ --no-restore \ --no-build \ - /p:ContinuousIntegration=true + /p:ContinuousIntegrationBuild=true - name: Compress test results if: always() From 43684676217d9e5b51193bc44399b9225415a289 Mon Sep 17 00:00:00 2001 From: Eric Erhardt Date: Thu, 30 Jan 2025 11:26:58 -0600 Subject: [PATCH 11/28] Remove CIBuild property since this isn't running in AzDO --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 363e98ce03..ae37d723d0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -55,7 +55,7 @@ jobs: run: dotnet restore ${{ matrix.project }} - name: Build projects - run: dotnet build ${{ matrix.project }} /p:ContinuousIntegrationBuild=true --no-restore /bl + run: dotnet build ${{ matrix.project }} --no-restore /bl - name: Run tests id: run-tests From d9c6533873422c7a5023581070f687de3f105d03 Mon Sep 17 00:00:00 2001 From: Jose Perez Rodriguez Date: Thu, 30 Jan 2025 09:27:53 -0800 Subject: [PATCH 12/28] Try using build.sh instead to restore arcade --- .github/workflows/tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 363e98ce03..36edb9681a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -51,16 +51,16 @@ jobs: sudo apt-get update sudo apt-get install -y azure-functions-core-tools-4 - - name: Restore dependencies - run: dotnet restore ${{ matrix.project }} + - name: Run build script + run: ./build.sh -ci - name: Build projects - run: dotnet build ${{ matrix.project }} /p:ContinuousIntegrationBuild=true --no-restore /bl + run: ./build.sh -restore -build -ci ${{ matrix.project }} /bl - name: Run tests id: run-tests run: | - dotnet test ${{ matrix.project }} \ + ./build.sh -test ${{ matrix.project }} \ -s eng/testing/.runsettings \ --logger "console;verbosity=normal" \ --logger "trx" \ From e01943c8853b87634cef0c353f13d61934e65735 Mon Sep 17 00:00:00 2001 From: Eric Erhardt Date: Thu, 30 Jan 2025 11:28:24 -0600 Subject: [PATCH 13/28] Remove from tests too --- .github/workflows/tests.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ae37d723d0..d5c6bfc26c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -69,8 +69,7 @@ jobs: --blame-hang-timeout 7m \ --results-directory testresults \ --no-restore \ - --no-build \ - /p:ContinuousIntegrationBuild=true + --no-build - name: Compress test results if: always() From 153a35c4a7048affd9555b036240040b6547c080 Mon Sep 17 00:00:00 2001 From: Jose Perez Rodriguez Date: Thu, 30 Jan 2025 09:36:37 -0800 Subject: [PATCH 14/28] Remove -ci --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c7a089a141..dd6bd195be 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -52,10 +52,10 @@ jobs: sudo apt-get install -y azure-functions-core-tools-4 - name: Run build script - run: ./build.sh -ci + run: ./build.sh - name: Build projects - run: ./build.sh -restore -build -ci ${{ matrix.project }} /bl + run: ./build.sh -restore -build ${{ matrix.project }} /bl - name: Run tests id: run-tests From e755d0641bb30905422db95b326e2559f5f66143 Mon Sep 17 00:00:00 2001 From: Jose Perez Rodriguez Date: Thu, 30 Jan 2025 09:40:39 -0800 Subject: [PATCH 15/28] create binlog to upload --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index dd6bd195be..8455742a48 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -52,7 +52,7 @@ jobs: sudo apt-get install -y azure-functions-core-tools-4 - name: Run build script - run: ./build.sh + run: ./build.sh /bl - name: Build projects run: ./build.sh -restore -build ${{ matrix.project }} /bl From 59542dc06ca5cc422af270866afc3e6b1ca5b0ab Mon Sep 17 00:00:00 2001 From: Jose Perez Rodriguez Date: Thu, 30 Jan 2025 10:13:59 -0800 Subject: [PATCH 16/28] Try setting CI to false --- .github/workflows/tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8455742a48..e52a7a9cd7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -52,7 +52,8 @@ jobs: sudo apt-get install -y azure-functions-core-tools-4 - name: Run build script - run: ./build.sh /bl + run: | + export CI=false && ./build.sh /bl - name: Build projects run: ./build.sh -restore -build ${{ matrix.project }} /bl From a85052b2e80cbcd72214cf877d3ddbaf0cdc37c9 Mon Sep 17 00:00:00 2001 From: Jose Perez Rodriguez Date: Thu, 30 Jan 2025 10:28:35 -0800 Subject: [PATCH 17/28] Fix --- .github/workflows/tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e52a7a9cd7..238c26f6c3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -53,15 +53,15 @@ jobs: - name: Run build script run: | - export CI=false && ./build.sh /bl + export CI=false && ./build.sh -ci /bl - - name: Build projects - run: ./build.sh -restore -build ${{ matrix.project }} /bl + - name: Build test project + run: export CI=false && ./build.sh -restore -ci -build ${{ matrix.project }} /bl - name: Run tests id: run-tests run: | - ./build.sh -test ${{ matrix.project }} \ + export CI=false && ./build.sh -ci -test ${{ matrix.project }} \ -s eng/testing/.runsettings \ --logger "console;verbosity=normal" \ --logger "trx" \ From 9a556d52ac3e206d3ccbba76a95d4dee6310179b Mon Sep 17 00:00:00 2001 From: Jose Perez Rodriguez Date: Thu, 30 Jan 2025 10:40:43 -0800 Subject: [PATCH 18/28] Add missing projects parameter --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 238c26f6c3..f934463280 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -56,12 +56,12 @@ jobs: export CI=false && ./build.sh -ci /bl - name: Build test project - run: export CI=false && ./build.sh -restore -ci -build ${{ matrix.project }} /bl + run: export CI=false && ./build.sh -restore -ci -build -projects ${{ matrix.project }} /bl - name: Run tests id: run-tests run: | - export CI=false && ./build.sh -ci -test ${{ matrix.project }} \ + export CI=false && ./build.sh -ci -test -projects ${{ matrix.project }} \ -s eng/testing/.runsettings \ --logger "console;verbosity=normal" \ --logger "trx" \ From b0c1a422abb7680547cdce78a194d82ca9049ea7 Mon Sep 17 00:00:00 2001 From: Jose Perez Rodriguez Date: Thu, 30 Jan 2025 10:47:52 -0800 Subject: [PATCH 19/28] append githubworkspace to project path --- .github/workflows/tests.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f934463280..befe686807 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -56,12 +56,13 @@ jobs: export CI=false && ./build.sh -ci /bl - name: Build test project - run: export CI=false && ./build.sh -restore -ci -build -projects ${{ matrix.project }} /bl + run: | + export CI=false && ./build.sh -restore -ci -build -projects ${{ github.workspace }}/{{ matrix.project }} /bl - name: Run tests id: run-tests run: | - export CI=false && ./build.sh -ci -test -projects ${{ matrix.project }} \ + export CI=false && ./build.sh -ci -test -projects ${{ github.workspace }}/{{ matrix.project }} \ -s eng/testing/.runsettings \ --logger "console;verbosity=normal" \ --logger "trx" \ From 3a94f5938aeb90259cd7ddc124504b6dcd6b5a4a Mon Sep 17 00:00:00 2001 From: Jose Perez Rodriguez Date: Thu, 30 Jan 2025 10:54:34 -0800 Subject: [PATCH 20/28] Add missing dollar sign --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index befe686807..a8b63dbb16 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -57,12 +57,12 @@ jobs: - name: Build test project run: | - export CI=false && ./build.sh -restore -ci -build -projects ${{ github.workspace }}/{{ matrix.project }} /bl + export CI=false && ./build.sh -restore -ci -build -projects ${{ github.workspace }}/${{ matrix.project }} /bl - name: Run tests id: run-tests run: | - export CI=false && ./build.sh -ci -test -projects ${{ github.workspace }}/{{ matrix.project }} \ + export CI=false && ./build.sh -ci -test -projects ${{ github.workspace }}/${{ matrix.project }} \ -s eng/testing/.runsettings \ --logger "console;verbosity=normal" \ --logger "trx" \ From 8c1cf5047d2766112af1e22cc8c9c30e146f8794 Mon Sep 17 00:00:00 2001 From: Jose Perez Rodriguez Date: Thu, 30 Jan 2025 12:20:20 -0800 Subject: [PATCH 21/28] Fix test step --- .github/workflows/tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a8b63dbb16..433dd8d1e0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -62,7 +62,8 @@ jobs: - name: Run tests id: run-tests run: | - export CI=false && ./build.sh -ci -test -projects ${{ github.workspace }}/${{ matrix.project }} \ + export CI=false && ./dotnet.sh test ${{ github.workspace }}/${{ matrix.project }} \ + /p:ContinuousIntegrationBuild=true \ -s eng/testing/.runsettings \ --logger "console;verbosity=normal" \ --logger "trx" \ From c7cbdbcd9ea4ee97a7cec1696822c601e09502e0 Mon Sep 17 00:00:00 2001 From: Jose Perez Rodriguez Date: Thu, 30 Jan 2025 13:38:27 -0800 Subject: [PATCH 22/28] Skip Oracle tests that shouldn't run based on ActiveIssue --- .../Aspire.Hosting.Oracle.Tests/OracleFunctionalTests.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/Aspire.Hosting.Oracle.Tests/OracleFunctionalTests.cs b/tests/Aspire.Hosting.Oracle.Tests/OracleFunctionalTests.cs index 3052523d15..15f1bdf567 100644 --- a/tests/Aspire.Hosting.Oracle.Tests/OracleFunctionalTests.cs +++ b/tests/Aspire.Hosting.Oracle.Tests/OracleFunctionalTests.cs @@ -27,7 +27,7 @@ public class OracleFunctionalTests(ITestOutputHelper testOutputHelper) private const string DatabaseReadyText = "Completed: ALTER DATABASE OPEN"; - [Fact] + [Fact(Skip = "https://github.com/dotnet/aspire/issues/5362")] [RequiresDocker] public async Task VerifyEfOracle() { @@ -68,7 +68,7 @@ public async Task VerifyEfOracle() Assert.Equal("BatMobile", cars[0].Brand); } - [Theory] + [Theory(Skip = "https://github.com/dotnet/aspire/issues/5362")] [InlineData(true)] [InlineData(false, Skip = "https://github.com/dotnet/aspire/issues/5191")] [RequiresDocker] @@ -243,7 +243,7 @@ await pipeline.ExecuteAsync(async token => } } - [Theory] + [Theory(Skip = "https://github.com/dotnet/aspire/issues/5362")] [InlineData(true)] [InlineData(false, Skip = "https://github.com/dotnet/aspire/issues/5190")] [RequiresDocker] @@ -346,7 +346,7 @@ await pipeline.ExecuteAsync(async token => } } - [Fact] + [Fact(Skip = "https://github.com/dotnet/aspire/issues/5362")] [RequiresDocker] public async Task VerifyWaitForOnOracleBlocksDependentResources() { From c35db47056c97ba999568a9f5c0d0f82cad03418 Mon Sep 17 00:00:00 2001 From: Jose Perez Rodriguez Date: Thu, 30 Jan 2025 16:28:44 -0800 Subject: [PATCH 23/28] Skipping Aspire.Hosting.Test --- tests/Aspire.Hosting.Tests/DistributedApplicationTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Aspire.Hosting.Tests/DistributedApplicationTests.cs b/tests/Aspire.Hosting.Tests/DistributedApplicationTests.cs index c2d85345af..7eb46a6fed 100644 --- a/tests/Aspire.Hosting.Tests/DistributedApplicationTests.cs +++ b/tests/Aspire.Hosting.Tests/DistributedApplicationTests.cs @@ -775,7 +775,7 @@ await Assert.ThrowsAnyAsync(async () => }).DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout); } - [Fact] + [Fact(Skip = "https://github.com/dotnet/aspire/issues/4599")] [ActiveIssue("https://github.com/dotnet/aspire/issues/4599", typeof(PlatformDetection), nameof(PlatformDetection.IsRunningOnCI))] public async Task ProxylessAndProxiedEndpointBothWorkOnSameResource() { From 7465c9fcd469a63ee40a398d640ccf06ada10a93 Mon Sep 17 00:00:00 2001 From: Jose Perez Rodriguez Date: Fri, 31 Jan 2025 14:00:33 -0800 Subject: [PATCH 24/28] Stop building all of the repo and try to fix test not being able to fetch basedirectory --- .github/workflows/tests.yml | 4 ---- tests/Aspire.Playground.Tests/ProjectSpecificTests.cs | 3 ++- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 433dd8d1e0..d55afae4f9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -51,10 +51,6 @@ jobs: sudo apt-get update sudo apt-get install -y azure-functions-core-tools-4 - - name: Run build script - run: | - export CI=false && ./build.sh -ci /bl - - name: Build test project run: | export CI=false && ./build.sh -restore -ci -build -projects ${{ github.workspace }}/${{ matrix.project }} /bl diff --git a/tests/Aspire.Playground.Tests/ProjectSpecificTests.cs b/tests/Aspire.Playground.Tests/ProjectSpecificTests.cs index b5ea77f5e2..3a5cdee3a6 100644 --- a/tests/Aspire.Playground.Tests/ProjectSpecificTests.cs +++ b/tests/Aspire.Playground.Tests/ProjectSpecificTests.cs @@ -8,6 +8,7 @@ using SamplesIntegrationTests.Infrastructure; using Xunit; using Xunit.Abstractions; +using System.Reflection; namespace Aspire.Playground.Tests; @@ -61,7 +62,7 @@ await WaitForAllTextAsync(app, [RequiresTools(["func"])] public async Task AzureFunctionsTest() { - var appHostPath = Directory.GetFiles(AppContext.BaseDirectory, "AzureFunctionsEndToEnd.AppHost.dll").Single(); + var appHostPath = Directory.GetFiles(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "AzureFunctionsEndToEnd.AppHost.dll").Single(); var appHost = await DistributedApplicationTestFactory.CreateAsync(appHostPath, _testOutput); await using var app = await appHost.BuildAsync(); From 62df1fe76a4d168ebc618ae369975889984cb1f9 Mon Sep 17 00:00:00 2001 From: Jose Perez Rodriguez Date: Fri, 31 Jan 2025 14:16:53 -0800 Subject: [PATCH 25/28] Debug Output for AzureFunctionsTest --- tests/Aspire.Playground.Tests/ProjectSpecificTests.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/Aspire.Playground.Tests/ProjectSpecificTests.cs b/tests/Aspire.Playground.Tests/ProjectSpecificTests.cs index 3a5cdee3a6..71a683514e 100644 --- a/tests/Aspire.Playground.Tests/ProjectSpecificTests.cs +++ b/tests/Aspire.Playground.Tests/ProjectSpecificTests.cs @@ -62,6 +62,9 @@ await WaitForAllTextAsync(app, [RequiresTools(["func"])] public async Task AzureFunctionsTest() { + _testOutput.WriteLine($"**Debug: {Assembly.GetExecutingAssembly().Location}**"); + var files = Directory.GetFiles(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!); + _testOutput.WriteLine($"**Debug: {string.Join(", ", files)}**"); var appHostPath = Directory.GetFiles(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "AzureFunctionsEndToEnd.AppHost.dll").Single(); var appHost = await DistributedApplicationTestFactory.CreateAsync(appHostPath, _testOutput); await using var app = await appHost.BuildAsync(); From 801075a105685ca1e538543f8f815b2ae4c5189d Mon Sep 17 00:00:00 2001 From: Jose Perez Rodriguez Date: Fri, 31 Jan 2025 14:25:38 -0800 Subject: [PATCH 26/28] Enabling project reference which is currently disabled. --- tests/Aspire.Playground.Tests/Aspire.Playground.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Aspire.Playground.Tests/Aspire.Playground.Tests.csproj b/tests/Aspire.Playground.Tests/Aspire.Playground.Tests.csproj index a2f009c483..dff67a97f0 100644 --- a/tests/Aspire.Playground.Tests/Aspire.Playground.Tests.csproj +++ b/tests/Aspire.Playground.Tests/Aspire.Playground.Tests.csproj @@ -48,7 +48,7 @@ - + From 026d09c88f74bbfbcf1b36c15fa92f0eced09e92 Mon Sep 17 00:00:00 2001 From: Jose Perez Rodriguez Date: Fri, 31 Jan 2025 15:14:30 -0800 Subject: [PATCH 27/28] Disable Azure Functions test from CI --- .../Aspire.Playground.Tests.csproj | 2 +- tests/Aspire.Playground.Tests/ProjectSpecificTests.cs | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/tests/Aspire.Playground.Tests/Aspire.Playground.Tests.csproj b/tests/Aspire.Playground.Tests/Aspire.Playground.Tests.csproj index dff67a97f0..a2f009c483 100644 --- a/tests/Aspire.Playground.Tests/Aspire.Playground.Tests.csproj +++ b/tests/Aspire.Playground.Tests/Aspire.Playground.Tests.csproj @@ -48,7 +48,7 @@ - + diff --git a/tests/Aspire.Playground.Tests/ProjectSpecificTests.cs b/tests/Aspire.Playground.Tests/ProjectSpecificTests.cs index 71a683514e..7025871920 100644 --- a/tests/Aspire.Playground.Tests/ProjectSpecificTests.cs +++ b/tests/Aspire.Playground.Tests/ProjectSpecificTests.cs @@ -8,7 +8,6 @@ using SamplesIntegrationTests.Infrastructure; using Xunit; using Xunit.Abstractions; -using System.Reflection; namespace Aspire.Playground.Tests; @@ -57,15 +56,12 @@ await WaitForAllTextAsync(app, await app.StopAsync(); } - [Fact] + [Fact(Skip = "The project reference for this test is skipped in CI.")] [RequiresDocker] [RequiresTools(["func"])] public async Task AzureFunctionsTest() { - _testOutput.WriteLine($"**Debug: {Assembly.GetExecutingAssembly().Location}**"); - var files = Directory.GetFiles(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!); - _testOutput.WriteLine($"**Debug: {string.Join(", ", files)}**"); - var appHostPath = Directory.GetFiles(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "AzureFunctionsEndToEnd.AppHost.dll").Single(); + var appHostPath = Directory.GetFiles(AppContext.BaseDirectory, "AzureFunctionsEndToEnd.AppHost.dll").Single(); var appHost = await DistributedApplicationTestFactory.CreateAsync(appHostPath, _testOutput); await using var app = await appHost.BuildAsync(); From 6bbf7e0e102780285d5fd81cb6802799e82057b5 Mon Sep 17 00:00:00 2001 From: Jose Perez Rodriguez Date: Fri, 31 Jan 2025 20:01:04 -0800 Subject: [PATCH 28/28] Disabling playground tests to investigate Azure Functions test --- .github/workflows/tests.yml | 4 ++-- tests/Aspire.Playground.Tests/ProjectSpecificTests.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d55afae4f9..4e787120bc 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -26,8 +26,8 @@ jobs: name: Redis - project: tests/Aspire.Hosting.Azure.Tests/Aspire.Hosting.Azure.Tests.csproj name: Azure - - project: tests/Aspire.Playground.Tests/Aspire.Playground.Tests.csproj - name: Playground + # - project: tests/Aspire.Playground.Tests/Aspire.Playground.Tests.csproj + # name: Playground # Add more projects as needed steps: - name: Checkout code diff --git a/tests/Aspire.Playground.Tests/ProjectSpecificTests.cs b/tests/Aspire.Playground.Tests/ProjectSpecificTests.cs index 7025871920..b5ea77f5e2 100644 --- a/tests/Aspire.Playground.Tests/ProjectSpecificTests.cs +++ b/tests/Aspire.Playground.Tests/ProjectSpecificTests.cs @@ -56,7 +56,7 @@ await WaitForAllTextAsync(app, await app.StopAsync(); } - [Fact(Skip = "The project reference for this test is skipped in CI.")] + [Fact] [RequiresDocker] [RequiresTools(["func"])] public async Task AzureFunctionsTest()