From f104d5d98ba31bec00d67285292e358fafed0d40 Mon Sep 17 00:00:00 2001 From: Casey Waldren Date: Thu, 24 Oct 2024 15:11:30 -0700 Subject: [PATCH 1/4] build: fix path for client-side tests in solution --- pkgs/sdk/client/LaunchDarkly.ClientSdk.sln | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/sdk/client/LaunchDarkly.ClientSdk.sln b/pkgs/sdk/client/LaunchDarkly.ClientSdk.sln index 341404ae..8cbee136 100644 --- a/pkgs/sdk/client/LaunchDarkly.ClientSdk.sln +++ b/pkgs/sdk/client/LaunchDarkly.ClientSdk.sln @@ -4,9 +4,9 @@ VisualStudioVersion = 15.0.26730.16 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LaunchDarkly.ClientSdk", "src\LaunchDarkly.ClientSdk.csproj", "{7717A2B2-9905-40A7-989F-790139D69543}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LaunchDarkly.ClientSdk.Device.Tests", "tests\LaunchDarkly.ClientSdk.Device.Tests\LaunchDarkly.ClientSdk.Device.Tests.csproj", "{0D88C80E-8CD8-4064-AE99-9849C7CD6E35}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LaunchDarkly.ClientSdk.Device.Tests", "test\LaunchDarkly.ClientSdk.Device.Tests\LaunchDarkly.ClientSdk.Device.Tests.csproj", "{0D88C80E-8CD8-4064-AE99-9849C7CD6E35}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LaunchDarkly.ClientSdk.Tests", "tests\LaunchDarkly.ClientSdk.Tests\LaunchDarkly.ClientSdk.Tests.csproj", "{36701E5A-EC04-4B47-8739-BACCCB673C77}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LaunchDarkly.ClientSdk.Tests", "test\LaunchDarkly.ClientSdk.Tests\LaunchDarkly.ClientSdk.Tests.csproj", "{36701E5A-EC04-4B47-8739-BACCCB673C77}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution From 65921a3ded9a779da4976ab2b7f42bc71170cd65 Mon Sep 17 00:00:00 2001 From: Casey Waldren Date: Thu, 24 Oct 2024 16:02:42 -0700 Subject: [PATCH 2/4] build: enable client SDK unit tests in CI --- .github/actions/ci/action.yml | 6 +++++- .github/workflows/sdk-client-ci.yml | 3 ++- .../LaunchDarkly.ClientSdk.Tests.csproj | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/actions/ci/action.yml b/.github/actions/ci/action.yml index d2ce625b..636326c6 100644 --- a/.github/actions/ci/action.yml +++ b/.github/actions/ci/action.yml @@ -7,6 +7,10 @@ inputs: test_project_file: description: 'Path to the test project file. If provided, run unit tests, otherwise skip them.' required: false + target_test_framework: + description: 'The target test framework to use.' + required: false + default: 'net6.0' runs: using: composite @@ -35,4 +39,4 @@ runs: shell: bash run: | dotnet restore ${{ inputs.test_project_file }} - dotnet test --framework=net6.0 ${{ inputs.test_project_file }} + dotnet test --framework=${{ inputs.target_test_framework }} ${{ inputs.test_project_file }} diff --git a/.github/workflows/sdk-client-ci.yml b/.github/workflows/sdk-client-ci.yml index e3bff57c..0f43f8b1 100644 --- a/.github/workflows/sdk-client-ci.yml +++ b/.github/workflows/sdk-client-ci.yml @@ -36,6 +36,7 @@ jobs: with: project_file: ${{ env.PROJECT_FILE}} test_project_file: ${{ env.TEST_PROJECT_FILE}} + target_test_framework: "net7.0" - uses: ./.github/actions/contract-tests with: @@ -47,4 +48,4 @@ jobs: with: workspace_path: ${{ env.WORKSPACE_PATH}} -# TODO: resolve issue with emulator and device tests \ No newline at end of file +# TODO: resolve issue with emulator and device tests diff --git a/pkgs/sdk/client/test/LaunchDarkly.ClientSdk.Tests/LaunchDarkly.ClientSdk.Tests.csproj b/pkgs/sdk/client/test/LaunchDarkly.ClientSdk.Tests/LaunchDarkly.ClientSdk.Tests.csproj index 6f60edf9..ca3de204 100644 --- a/pkgs/sdk/client/test/LaunchDarkly.ClientSdk.Tests/LaunchDarkly.ClientSdk.Tests.csproj +++ b/pkgs/sdk/client/test/LaunchDarkly.ClientSdk.Tests/LaunchDarkly.ClientSdk.Tests.csproj @@ -8,6 +8,7 @@ $(TESTFRAMEWORK) LaunchDarkly.ClientSdk.Tests LaunchDarkly.Sdk.Client + true From 21fd10bf4bbcb2467b8a94061750813ece7abbeb Mon Sep 17 00:00:00 2001 From: Casey Waldren Date: Thu, 24 Oct 2024 16:23:34 -0700 Subject: [PATCH 3/4] have tests log output using junit --- .github/actions/ci/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/ci/action.yml b/.github/actions/ci/action.yml index 636326c6..b4f3e350 100644 --- a/.github/actions/ci/action.yml +++ b/.github/actions/ci/action.yml @@ -39,4 +39,4 @@ runs: shell: bash run: | dotnet restore ${{ inputs.test_project_file }} - dotnet test --framework=${{ inputs.target_test_framework }} ${{ inputs.test_project_file }} + dotnet test --logger:"junit" --framework=${{ inputs.target_test_framework }} ${{ inputs.test_project_file }} From d63fa65f76d74e9bcd5615ca0e0d060293196ea7 Mon Sep 17 00:00:00 2001 From: Casey Waldren Date: Thu, 24 Oct 2024 16:29:48 -0700 Subject: [PATCH 4/4] set test verbosity --- .github/actions/ci/action.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/actions/ci/action.yml b/.github/actions/ci/action.yml index b4f3e350..ac3f7e12 100644 --- a/.github/actions/ci/action.yml +++ b/.github/actions/ci/action.yml @@ -11,6 +11,10 @@ inputs: description: 'The target test framework to use.' required: false default: 'net6.0' + test_verbosity: + description: 'The verbosity level of the test output.' + required: false + default: 'normal' runs: using: composite @@ -39,4 +43,4 @@ runs: shell: bash run: | dotnet restore ${{ inputs.test_project_file }} - dotnet test --logger:"junit" --framework=${{ inputs.target_test_framework }} ${{ inputs.test_project_file }} + dotnet test -v=${{ inputs.test_verbosity }} --framework=${{ inputs.target_test_framework }} ${{ inputs.test_project_file }}