Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: enable client SDK unit tests in CI #25

Merged
merged 6 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/actions/ci/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ 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'
test_verbosity:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this, it just appears like the tests are hanging in CI. I can see the value of not having this when running locally, but it's nice to have the record when waiting remotely.

description: 'The verbosity level of the test output.'
required: false
default: 'normal'

runs:
using: composite
Expand Down Expand Up @@ -35,4 +43,4 @@ runs:
shell: bash
run: |
dotnet restore ${{ inputs.test_project_file }}
dotnet test --framework=net6.0 ${{ inputs.test_project_file }}
dotnet test -v=${{ inputs.test_verbosity }} --framework=${{ inputs.target_test_framework }} ${{ inputs.test_project_file }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously, it was passing net6 as the framework. I believe this was causing it to silently just not run tests at all. The target for the client tests is net7.

3 changes: 2 additions & 1 deletion .github/workflows/sdk-client-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -47,4 +48,4 @@ jobs:
with:
workspace_path: ${{ env.WORKSPACE_PATH}}

# TODO: resolve issue with emulator and device tests
# TODO: resolve issue with emulator and device tests
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<TargetFrameworks>$(TESTFRAMEWORK)</TargetFrameworks>
<AssemblyName>LaunchDarkly.ClientSdk.Tests</AssemblyName>
<RootNamespace>LaunchDarkly.Sdk.Client</RootNamespace>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="LaunchDarkly.TestHelpers" Version="2.0.0" />
Expand Down
Loading