Skip to content

Commit

Permalink
Fix some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nirinchev committed May 22, 2024
1 parent 895ecc1 commit 3059d04
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 49 deletions.
4 changes: 3 additions & 1 deletion .github/pkl-workflows/helpers/Lint.pkl
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ import "../GithubAction/GithubAction.pkl" as gha
import "Steps.pkl"
import "Common.pkl"

const actionVerifyTODO = "nirinchev/verify-todo@ffa352ac028b4cdc8bc626471d33aa341b3ab7c9"

function lint(): gha.Job = new {
name = "Verify TODOs"
`runs-on` = new gha.UbuntuLatest{}
steps {
Steps.checkoutWithoutMatchers(false)
new gha.Step {
uses = "nirinchev/verify-todo@9be6f76daddad71433e5deb1b58c517490e5c66e"
uses = actionVerifyTODO
with {
["token"] = "${{ secrets.GITHUB_TOKEN }}"
["include"] = "**/*.+(cs|cpp|hpp)"
Expand Down
2 changes: 1 addition & 1 deletion .github/pkl-workflows/helpers/Steps.pkl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const actionCheckout = "actions/checkout@v4"
const actionUploadArtifact = "actions/upload-artifact@v4"
const actionDownloadArtifact = "actions/download-artifact@v4"
const actionSetupXcode = "maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd"
const actionSetupDotnet = "actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a"
const actionSetupDotnet = "actions/setup-dotnet@5d1464d5da459f3d7085106d52e499f4dc5d0f59"
const actionSetupMsBuild = "microsoft/setup-msbuild@0b44c6745b7e81956596964100aadb92d667c497"

const function checkout(submodules: (Boolean | "recursive")): Listing<gha.Step> = new Listing {
Expand Down
1 change: 1 addition & 0 deletions .github/pkl-workflows/helpers/Test.pkl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ function netFramework(_syncDifferentiators: Listing<String>): gha.StepJobBase =
properties {
["TargetFramework"] = "net461"
}
standaloneExe = true
})
new gha.Step {
name = "Run the tests"
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
run: |-
echo "::add-matcher::.github/problem-matchers/csc.json"
echo "::add-matcher::.github/problem-matchers/msvc.json"
- uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a
- uses: actions/setup-dotnet@5d1464d5da459f3d7085106d52e499f4dc5d0f59
with:
dotnet-version: 6.0.x
- name: Deploy Apps
Expand Down Expand Up @@ -111,7 +111,7 @@ jobs:
if: ${{ runner.os == 'Windows' }}
uses: microsoft/setup-msbuild@0b44c6745b7e81956596964100aadb92d667c497
- name: Build Tests/Realm.Tests
run: msbuild Tests/Realm.Tests -restore -p:Configuration=Release -p:TargetFramework=net461 -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ needs.build-packages.outputs.package_version }}
run: msbuild Tests/Realm.Tests -restore -p:Configuration=Release -p:TargetFramework=net461 -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ needs.build-packages.outputs.package_version }} -p:RealmTestsStandaloneExe=true
- name: Run the tests
run: './Tests/Realm.Tests/bin/Release/net461/Realm.Tests.exe --result=TestResults.xml --labels=After '
- name: Publish Unit Test Results
Expand Down Expand Up @@ -214,7 +214,7 @@ jobs:
NET_VERSION=$(echo '${{ matrix.framework }}.x' | sed 's/net//g')
echo "version=$NET_VERSION" >> $GITHUB_OUTPUT
shell: bash
- uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a
- uses: actions/setup-dotnet@5d1464d5da459f3d7085106d52e499f4dc5d0f59
with:
dotnet-version: ${{ steps.get-net-version.outputs.version }}
- name: Publish Tests/Realm.Tests
Expand Down Expand Up @@ -332,7 +332,7 @@ jobs:
with:
name: Realm.PlatformHelpers.${{ needs.build-packages.outputs.package_version }}
path: ${{ github.workspace }}/Realm/packages/
- uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a
- uses: actions/setup-dotnet@5d1464d5da459f3d7085106d52e499f4dc5d0f59
with:
dotnet-version: 8.0.x
- name: Setup workloads
Expand Down Expand Up @@ -434,7 +434,7 @@ jobs:
with:
name: Realm.PlatformHelpers.${{ needs.build-packages.outputs.package_version }}
path: ${{ github.workspace }}/Realm/packages/
- uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a
- uses: actions/setup-dotnet@5d1464d5da459f3d7085106d52e499f4dc5d0f59
with:
dotnet-version: 8.0.x
- name: Setup workloads
Expand Down Expand Up @@ -608,7 +608,7 @@ jobs:
with:
name: Realm.PlatformHelpers.${{ needs.build-packages.outputs.package_version }}
path: ${{ github.workspace }}/Realm/packages/
- uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a
- uses: actions/setup-dotnet@5d1464d5da459f3d7085106d52e499f4dc5d0f59
with:
dotnet-version: 8.0.x
- name: Setup workloads
Expand Down Expand Up @@ -705,7 +705,7 @@ jobs:
run: |-
echo "::add-matcher::.github/problem-matchers/csc.json"
echo "::add-matcher::.github/problem-matchers/msvc.json"
- uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a
- uses: actions/setup-dotnet@5d1464d5da459f3d7085106d52e499f4dc5d0f59
with:
dotnet-version: 6.0.x
- name: Setup workloads
Expand Down Expand Up @@ -743,7 +743,7 @@ jobs:
run: |-
echo "::add-matcher::.github/problem-matchers/csc.json"
echo "::add-matcher::.github/problem-matchers/msvc.json"
- uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a
- uses: actions/setup-dotnet@5d1464d5da459f3d7085106d52e499f4dc5d0f59
with:
dotnet-version: 6.0.x
- name: Setup workloads
Expand Down Expand Up @@ -859,7 +859,7 @@ jobs:
run: |-
echo "::add-matcher::.github/problem-matchers/csc.json"
echo "::add-matcher::.github/problem-matchers/msvc.json"
- uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a
- uses: actions/setup-dotnet@5d1464d5da459f3d7085106d52e499f4dc5d0f59
with:
dotnet-version: 6.0.x
- name: Terminate Baas
Expand Down Expand Up @@ -938,7 +938,7 @@ jobs:
with:
submodules: false
ref: ${{ github.event.pull_request.head.sha }}
- uses: nirinchev/verify-todo@9be6f76daddad71433e5deb1b58c517490e5c66e
- uses: nirinchev/verify-todo@ffa352ac028b4cdc8bc626471d33aa341b3ab7c9
with:
token: ${{ secrets.GITHUB_TOKEN }}
include: '**/*.+(cs|cpp|hpp)'
Expand Down
10 changes: 10 additions & 0 deletions Tests/Realm.Tests/Database/DynamicEmbeddedTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,11 @@ public void RealmAddEmbeddedObjectToDictionary()
Assert.That(addedDict.Count, Is.EqualTo(2));
Assert.That(addedDict["bar"].DynamicApi.Get<string>(nameof(DynamicSubTask.Summary)), Is.EqualTo("This is a second subtask level 1"));

if (TestHelpers.IsAOTTarget)
{
return;
}

#if !UNITY
var dynamicId = Guid.NewGuid().ToString();

Expand Down Expand Up @@ -610,6 +615,11 @@ public void RealmSetEmbeddedObjectInDictionary()
Assert.That(subTasks["b"].DynamicApi.Get<string>(nameof(DynamicSubTask.Summary)), Is.EqualTo("new at b"));
Assert.That(subTasks["c"].DynamicApi.Get<string>(nameof(DynamicSubTask.Summary)), Is.EqualTo("initial at c"));

if (TestHelpers.IsAOTTarget)
{
return;
}

#if !UNITY
var dynamicId = Guid.NewGuid().ToString();

Expand Down
Loading

0 comments on commit 3059d04

Please sign in to comment.