From 7a5c5781664c1281aec181e29a3ac14add9650ad Mon Sep 17 00:00:00 2001 From: Jose Arriaga Maldonado Date: Fri, 31 Oct 2025 11:48:04 -0700 Subject: [PATCH 1/5] Restore tools for test proxy --- .github/workflows/live-test.yml | 3 +++ .github/workflows/release.yml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/live-test.yml b/.github/workflows/live-test.yml index 88e7a23bb..a5a56aa71 100644 --- a/.github/workflows/live-test.yml +++ b/.github/workflows/live-test.yml @@ -29,6 +29,9 @@ jobs: - name: Checkout code uses: actions/checkout@v2 + - name: Restore tools + run: dotnet tool restore --configfile nuget.config + - name: Run live tests run: dotnet test ./tests/OpenAI.Tests.csproj --configuration Release diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8abf3de71..e7e54fa51 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -36,6 +36,9 @@ jobs: - name: Checkout code uses: actions/checkout@v2 + - name: Restore tools + run: dotnet tool restore --configfile nuget.config + # Pack the client NuGet package and include URL back to the repository and release tag - name: Build and Pack run: dotnet pack From f189468b2ead3b15882cfd63dd0c31ada19b17d6 Mon Sep 17 00:00:00 2001 From: Jose Arriaga Maldonado Date: Fri, 31 Oct 2025 12:00:45 -0700 Subject: [PATCH 2/5] Try --add-source --- .github/workflows/live-test.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/live-test.yml b/.github/workflows/live-test.yml index a5a56aa71..c4ba7dbe0 100644 --- a/.github/workflows/live-test.yml +++ b/.github/workflows/live-test.yml @@ -30,7 +30,7 @@ jobs: uses: actions/checkout@v2 - name: Restore tools - run: dotnet tool restore --configfile nuget.config + run: dotnet tool restore --add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json - name: Run live tests run: dotnet test ./tests/OpenAI.Tests.csproj diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e7e54fa51..2d3285f5f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,7 +37,7 @@ jobs: uses: actions/checkout@v2 - name: Restore tools - run: dotnet tool restore --configfile nuget.config + run: dotnet tool restore --add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json # Pack the client NuGet package and include URL back to the repository and release tag - name: Build and Pack From 8a77a8495f04e42ee41ed2d4becb86a62be74fa9 Mon Sep 17 00:00:00 2001 From: Jose Arriaga Maldonado Date: Fri, 31 Oct 2025 12:31:24 -0700 Subject: [PATCH 3/5] Try only Chat tests --- .github/workflows/live-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/live-test.yml b/.github/workflows/live-test.yml index c4ba7dbe0..dacab77fe 100644 --- a/.github/workflows/live-test.yml +++ b/.github/workflows/live-test.yml @@ -35,7 +35,7 @@ jobs: - name: Run live tests run: dotnet test ./tests/OpenAI.Tests.csproj --configuration Release - --filter="TestCategory!=Smoke&TestCategory!=Assistants&TestCategory!=StoredChat&TestCategory!=Images&TestCategory!=Uploads&TestCategory!=Moderations&TestCategory!=FineTuning&TestCategory!=Containers&TestCategory!=Conversation&TestCategory!=MCP&TestCategory!=Manual" + --filter="TestCategory=Chat" --logger "trx;LogFilePrefix=live" --results-directory ${{github.workspace}}/artifacts/test-results ${{ env.version_suffix_args}} From 0b782260b7e44e8687baf055a982d6eacb5539ef Mon Sep 17 00:00:00 2001 From: Jose Arriaga Maldonado Date: Fri, 31 Oct 2025 14:39:12 -0700 Subject: [PATCH 4/5] Add Embeddings and Responses, exclude MPFD --- .github/workflows/live-test.yml | 4 ++-- .github/workflows/release.yml | 10 +++++----- tests/Chat/ChatStoreTests.cs | 3 ++- tests/Chat/ChatTests.cs | 1 + tests/Chat/ChatToolTests.cs | 1 + tests/Responses/ResponseStoreTests.cs | 1 + tests/Responses/ResponsesToolTests.cs | 2 +- 7 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/live-test.yml b/.github/workflows/live-test.yml index dacab77fe..e664a20f5 100644 --- a/.github/workflows/live-test.yml +++ b/.github/workflows/live-test.yml @@ -32,10 +32,10 @@ jobs: - name: Restore tools run: dotnet tool restore --add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json - - name: Run live tests + - name: Run recorded tests run: dotnet test ./tests/OpenAI.Tests.csproj --configuration Release - --filter="TestCategory=Chat" + --filter="(TestCategory=Chat|TestCategory=Embeddings|TestCategory=Responses)&TestCategory!=MPFD" --logger "trx;LogFilePrefix=live" --results-directory ${{github.workspace}}/artifacts/test-results ${{ env.version_suffix_args}} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2d3285f5f..3a9f9bdf7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -40,7 +40,7 @@ jobs: run: dotnet tool restore --add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json # Pack the client NuGet package and include URL back to the repository and release tag - - name: Build and Pack + - name: Build and pack run: dotnet pack --configuration Release --output "${{ github.workspace }}/artifacts/packages" @@ -48,17 +48,17 @@ jobs: /p:PackageReleaseNotes="${{ github.server_url }}/${{ github.repository }}/blob/${{ github.event.release.tag_name }}/CHANGELOG.md" ${{ env.version_suffix_args }} - - name: Unit Test + - name: Run unit tests run: dotnet test --configuration Release --filter="TestCategory=Smoke&TestCategory!=Manual" --logger "trx;LogFileName=${{ github.workspace }}/artifacts/test-results/smoke.trx" ${{ env.version_suffix_args }} - - name: Run Live Tests + - name: Run recorded tests run: dotnet test ./tests/OpenAI.Tests.csproj --configuration Release - --filter="TestCategory!=Smoke&TestCategory!=Assistants&TestCategory!=StoredChat&TestCategory!=Images&TestCategory!=Uploads&TestCategory!=Moderations&TestCategory!=FineTuning&TestCategory!=Containers&TestCategory!=Conversation&TestCategory!=MCP&TestCategory!=Manual" + --filter="(TestCategory=Chat|TestCategory=Embeddings|TestCategory=Responses)&TestCategory!=MPFD" --logger "trx;LogFilePrefix=live" --results-directory ${{ github.workspace }}/artifacts/test-results ${{ env.version_suffix_args }} @@ -121,7 +121,7 @@ jobs: path: ${{ github.workspace }}/build-artifacts deploy: - name: Publish Package + name: Publish package needs: sign runs-on: ubuntu-latest steps: diff --git a/tests/Chat/ChatStoreTests.cs b/tests/Chat/ChatStoreTests.cs index fa62532f4..ec25d9c5e 100644 --- a/tests/Chat/ChatStoreTests.cs +++ b/tests/Chat/ChatStoreTests.cs @@ -11,7 +11,8 @@ namespace OpenAI.Tests.Chat; -[Category("StoredChat")] +[Category("Chat")] +[Category("ChatStore")] public class ChatStoreTests : OpenAIRecordedTestBase { public ChatStoreTests(bool isAsync) : base(isAsync) diff --git a/tests/Chat/ChatTests.cs b/tests/Chat/ChatTests.cs index e3c9e5fc1..4b2e532c7 100644 --- a/tests/Chat/ChatTests.cs +++ b/tests/Chat/ChatTests.cs @@ -786,6 +786,7 @@ public async Task WebSearchWorks() } [RecordedTest] + [Category("MPFD")] public async Task FileIdContentWorks() { OpenAIFileClient fileClient = GetProxiedOpenAIClient(TestScenario.Files); diff --git a/tests/Chat/ChatToolTests.cs b/tests/Chat/ChatToolTests.cs index 237eaefc2..9c40a2070 100644 --- a/tests/Chat/ChatToolTests.cs +++ b/tests/Chat/ChatToolTests.cs @@ -14,6 +14,7 @@ namespace OpenAI.Tests.Chat; [Category("Chat")] +[Category("ChatTools")] public class ChatToolTests : OpenAIRecordedTestBase { public enum SchemaPresence { WithSchema, WithoutSchema } diff --git a/tests/Responses/ResponseStoreTests.cs b/tests/Responses/ResponseStoreTests.cs index 14a16775b..0068a9e52 100644 --- a/tests/Responses/ResponseStoreTests.cs +++ b/tests/Responses/ResponseStoreTests.cs @@ -13,6 +13,7 @@ namespace OpenAI.Tests.Responses; #pragma warning disable OPENAICUA001 [Category("Responses")] +[Category("ResponsesStore")] public partial class ResponseStoreTests : OpenAIRecordedTestBase { public ResponseStoreTests(bool isAsync) : base(isAsync) diff --git a/tests/Responses/ResponsesToolTests.cs b/tests/Responses/ResponsesToolTests.cs index 17cb5de69..4a5f5a797 100644 --- a/tests/Responses/ResponsesToolTests.cs +++ b/tests/Responses/ResponsesToolTests.cs @@ -18,7 +18,7 @@ namespace OpenAI.Tests.Responses; [Category("Responses")] -[Category("MCP")] +[Category("ResponsesTools")] public partial class ResponsesToolTests : OpenAIRecordedTestBase { public ResponsesToolTests(bool isAsync) : base(isAsync) From 9795e4f3983dc18d7c1a58f95dfff3b9a7239f01 Mon Sep 17 00:00:00 2001 From: Jose Arriaga Maldonado Date: Fri, 31 Oct 2025 14:52:09 -0700 Subject: [PATCH 5/5] Fix format --- .github/workflows/live-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/live-test.yml b/.github/workflows/live-test.yml index e664a20f5..f1359007c 100644 --- a/.github/workflows/live-test.yml +++ b/.github/workflows/live-test.yml @@ -37,8 +37,8 @@ jobs: --configuration Release --filter="(TestCategory=Chat|TestCategory=Embeddings|TestCategory=Responses)&TestCategory!=MPFD" --logger "trx;LogFilePrefix=live" - --results-directory ${{github.workspace}}/artifacts/test-results - ${{ env.version_suffix_args}} + --results-directory ${{ github.workspace }}/artifacts/test-results + ${{ env.version_suffix_args }} env: OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}