Skip to content
Draft
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
17 changes: 8 additions & 9 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,18 @@ jobs:
- name: Test
env: # Or as an environment variable
OpenWeatherAPIKey: ${{ secrets.OpenWeatherAPIKey }}
run: dotnet test InkyCal.sln --no-restore --verbosity normal --logger "trx;LogFileName=test-results.trx"

- name: 'Upload Artifact'
uses: actions/upload-artifact@v4
with:
name: testresults
path: '**/*.trx'
retention-days: 1
# xunit.v3 uses the Microsoft Testing Platform (MTP) runner. Enable MTP support in
# dotnet test via TestingPlatformDotnetTestSupport, then pass --report-trx through
# to the MTP runner to produce TRX files that GitHub can interpret.
run: >
dotnet test InkyCal.sln --no-build --configuration Release
-p:TestingPlatformDotnetTestSupport=true
-- --report-trx --results-directory $GITHUB_WORKSPACE/TestResults

- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure() # run this step even if previous step failed
with:
name: Dotnet testresult # Name of the check run which will be created
path: '**/*.trx' # All test results
path: 'TestResults/*.trx' # All test results
reporter: dotnet-trx # Format of test results
25 changes: 25 additions & 0 deletions InkyCal.Data.Tests/ConfigurationTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using Xunit;

namespace InkyCal.Data.Tests
{
/// <summary>
/// Validates that the application configuration is present.
/// These tests do not require a database connection.
/// </summary>
/// <remarks>
/// At least one passing test must exist in this project.
/// When all other tests are skipped (e.g., because no database is available),
/// the Microsoft Testing Platform runner would otherwise report "Zero tests ran"
/// and return a non-zero exit code, causing CI to fail.
/// </remarks>
public class ConfigurationTests
{
[Fact]
public void ConnectionStringIsConfigured()
{
var connectionString = Server.Config.Config.ConnectionString;
Assert.NotNull(connectionString);
Assert.NotEmpty(connectionString);
}
}
}
4 changes: 2 additions & 2 deletions InkyCal.Data.Tests/InkyCal.Data.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
Expand All @@ -20,7 +20,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Testing.Extensions.TrxReport" Version="2.1.0" />
<PackageReference Include="Microsoft.Testing.Extensions.TrxReport" Version="1.9.1" />
<PackageReference Include="MiniProfiler.EntityFrameworkCore" Version="4.5.4" />
<PackageReference Include="MiniProfiler.Shared" Version="4.5.4" />
<PackageReference Include="coverlet.collector" Version="8.0.1">
Expand Down
58 changes: 29 additions & 29 deletions InkyCal.Data.Tests/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
},
"Microsoft.Testing.Extensions.TrxReport": {
"type": "Direct",
"requested": "[2.1.0, )",
"resolved": "2.1.0",
"contentHash": "cXmP225WcMLLOSrW8xekaNhfzdBwXX3cbXbE5qSzmLbK0KZe3z8rAObKj70FWiPPPzm2W22x0ZW93gsmAfK6Mg==",
"requested": "[1.9.1, )",
"resolved": "1.9.1",
"contentHash": "JssTbdxzI+uCUciUv7XbEtRHoJPNrIGZJ1p2nVPQHwVaFt3AClvDjHYyv81IYvYMVDtuIi+t+bjm2i8YnorZQA==",
"dependencies": {
"Microsoft.Testing.Extensions.TrxReport.Abstractions": "2.1.0",
"Microsoft.Testing.Platform": "2.1.0"
"Microsoft.Testing.Extensions.TrxReport.Abstractions": "1.9.1",
"Microsoft.Testing.Platform": "1.9.1"
}
},
"MiniProfiler.EntityFrameworkCore": {
Expand Down Expand Up @@ -66,20 +66,20 @@
},
"Azure.Core": {
"type": "Transitive",
"resolved": "1.51.1",
"contentHash": "JRANrRvN5O5FFRh+pMUb8qqWU7jBQ39qXEbVr7Rkb1/s7rqc6RSzVHKGBz5Ro1gDy2WSGjG5YEOJKpPIBiCMcA==",
"resolved": "1.52.0",
"contentHash": "If2gP0B4kDAwOw3kvMFs7gEounDhLyeleoWMih0xPdGAvhKpcWQwoPI3L/L0gmcQt0hrtqDnRni1jaIaxwdL7w==",
"dependencies": {
"Microsoft.Bcl.AsyncInterfaces": "10.0.2",
"System.ClientModel": "1.9.0",
"System.Memory.Data": "10.0.1"
"Microsoft.Bcl.AsyncInterfaces": "10.0.3",
"System.ClientModel": "1.10.0",
"System.Memory.Data": "10.0.3"
}
},
"Azure.Identity": {
"type": "Transitive",
"resolved": "1.19.0",
"contentHash": "01KY5RC7XHwh3azcZ46GMhVR7ajRsRPFh5ivVuvs7N9nVAYK+9/g2eqXTjBneorm9PTYAUfmHvd1dIdmzBym3w==",
"resolved": "1.20.0",
"contentHash": "yWOcmVL3SP5aVZqJ24V8IXdGRT6GW3/SD/al2w1Xe0MIcT8DuXpPOyKE9Pbk8/XxMtjHX14A82U6gwvDaU/GIw==",
"dependencies": {
"Azure.Core": "1.51.1",
"Azure.Core": "1.52.0",
"Microsoft.Extensions.Configuration.Abstractions": "10.0.3",
"Microsoft.Extensions.Hosting.Abstractions": "10.0.3",
"Microsoft.Identity.Client": "4.83.1",
Expand Down Expand Up @@ -115,8 +115,8 @@
},
"Microsoft.Bcl.AsyncInterfaces": {
"type": "Transitive",
"resolved": "10.0.2",
"contentHash": "qE5JhRoeJbAipLqpUCZyNfNwnpAvUttXgIQDnTiJ15d8ji+/bPgoPkB3xLzK5cQTobN2D2ditUesUlDHb7p3Pg=="
"resolved": "10.0.3",
"contentHash": "TV62UsrJZPX6gbt3c4WrtXh7bmaDIcMqf9uft1cc4L6gJXOU07hDGEh+bFQh/L2Az0R1WVOkiT66lFqS6G2NmA=="
},
"Microsoft.Bcl.Cryptography": {
"type": "Transitive",
Expand Down Expand Up @@ -489,16 +489,16 @@
},
"Microsoft.Testing.Extensions.TrxReport.Abstractions": {
"type": "Transitive",
"resolved": "2.1.0",
"contentHash": "D8xmIJYQFJ6D49Rx5/vPrkZZxb338Jkew+eSqZLBfBiWKw4QZKy3i1BOXiLfz0lOmaNErwDz/YWRojCdNl+B9Q==",
"resolved": "1.9.1",
"contentHash": "AL46Xe1WBi85Ntd4mNPvat5ZSsZ2uejiVqoKCypr8J3wK0elA5xJ3AN4G/Q4GIwzUFnggZoH/DBjnr9J18IO/g==",
"dependencies": {
"Microsoft.Testing.Platform": "2.1.0"
"Microsoft.Testing.Platform": "1.9.1"
}
},
"Microsoft.Testing.Platform": {
"type": "Transitive",
"resolved": "2.1.0",
"contentHash": "aHkjNTGIA+Zbdw6RJgSFrbDrCjO0CgqpElqYcvkRSeUhBv2bKarnvU3ep786U7UqrPlArT/B7VmImRibJD0Zrg=="
"resolved": "1.9.1",
"contentHash": "QafNtNSmEI0zazdebnsIkDKmFtTSpmx/5PLOjURWwozcPb3tvRxzosQSL8xwYNM1iPhhKiBksXZyRSE2COisrA=="
},
"Microsoft.Testing.Platform.MSBuild": {
"type": "Transitive",
Expand All @@ -515,13 +515,13 @@
},
"System.ClientModel": {
"type": "Transitive",
"resolved": "1.9.0",
"contentHash": "1wdwKtMMMEFEYsxJmtrOd3G+7zVOVO3MlVZAsbKv9H0PnIx6J27fYAarMn0eQS0vKJPQL018DOb7YRK1O97p0A==",
"resolved": "1.10.0",
"contentHash": "lBEWs54F5Y5pZ9hC+8z4S/X76957ex+DPk7WecRHlbIHtrPfbRMMlOgI3iDn4Jpb3bSxvBnKaaHoD59auFjlBA==",
"dependencies": {
"Microsoft.Extensions.Configuration.Abstractions": "10.0.2",
"Microsoft.Extensions.Hosting.Abstractions": "10.0.2",
"Microsoft.Extensions.Logging.Abstractions": "10.0.2",
"System.Memory.Data": "10.0.1"
"Microsoft.Extensions.Configuration.Abstractions": "10.0.3",
"Microsoft.Extensions.Hosting.Abstractions": "10.0.3",
"Microsoft.Extensions.Logging.Abstractions": "10.0.3",
"System.Memory.Data": "10.0.3"
}
},
"System.Configuration.ConfigurationManager": {
Expand Down Expand Up @@ -549,8 +549,8 @@
},
"System.Memory.Data": {
"type": "Transitive",
"resolved": "10.0.1",
"contentHash": "BZC4mhdL569AXV56ep9YO6ShjhxFXGP7SwVX0Bc/e0dJPWnS6aBEXZJXqh64RVx8HquqWHkJUINBydLRQ1yq0g=="
"resolved": "10.0.3",
"contentHash": "MaGhRfGunmrj/nHjtsi9XkhlYJ/ERGWrbA+BiSKNtGnAjc9XlG5EhAvak6VRcX5LYzPF6pBO8nJ613dTgzabig=="
},
"System.Security.Cryptography.Pkcs": {
"type": "Transitive",
Expand Down Expand Up @@ -632,7 +632,7 @@
"inkycal.data": {
"type": "Project",
"dependencies": {
"Azure.Identity": "[1.19.0, )",
"Azure.Identity": "[1.20.0, )",
"InkyCal.Models": "[1.0.0, )",
"InkyCal.Server.Config": "[1.0.0, )",
"Microsoft.AspNetCore.Identity.EntityFrameworkCore": "[10.0.5, )",
Expand Down
4 changes: 2 additions & 2 deletions InkyCal.Models.Tests/InkyCal.Models.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
Expand All @@ -19,7 +19,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Testing.Extensions.TrxReport" Version="2.1.0" />
<PackageReference Include="Microsoft.Testing.Extensions.TrxReport" Version="1.9.1" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="10.21.0.135717">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
20 changes: 10 additions & 10 deletions InkyCal.Models.Tests/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
},
"Microsoft.Testing.Extensions.TrxReport": {
"type": "Direct",
"requested": "[2.1.0, )",
"resolved": "2.1.0",
"contentHash": "cXmP225WcMLLOSrW8xekaNhfzdBwXX3cbXbE5qSzmLbK0KZe3z8rAObKj70FWiPPPzm2W22x0ZW93gsmAfK6Mg==",
"requested": "[1.9.1, )",
"resolved": "1.9.1",
"contentHash": "JssTbdxzI+uCUciUv7XbEtRHoJPNrIGZJ1p2nVPQHwVaFt3AClvDjHYyv81IYvYMVDtuIi+t+bjm2i8YnorZQA==",
"dependencies": {
"Microsoft.Testing.Extensions.TrxReport.Abstractions": "2.1.0",
"Microsoft.Testing.Platform": "2.1.0"
"Microsoft.Testing.Extensions.TrxReport.Abstractions": "1.9.1",
"Microsoft.Testing.Platform": "1.9.1"
}
},
"SonarAnalyzer.CSharp": {
Expand Down Expand Up @@ -66,16 +66,16 @@
},
"Microsoft.Testing.Extensions.TrxReport.Abstractions": {
"type": "Transitive",
"resolved": "2.1.0",
"contentHash": "D8xmIJYQFJ6D49Rx5/vPrkZZxb338Jkew+eSqZLBfBiWKw4QZKy3i1BOXiLfz0lOmaNErwDz/YWRojCdNl+B9Q==",
"resolved": "1.9.1",
"contentHash": "AL46Xe1WBi85Ntd4mNPvat5ZSsZ2uejiVqoKCypr8J3wK0elA5xJ3AN4G/Q4GIwzUFnggZoH/DBjnr9J18IO/g==",
"dependencies": {
"Microsoft.Testing.Platform": "2.1.0"
"Microsoft.Testing.Platform": "1.9.1"
}
},
"Microsoft.Testing.Platform": {
"type": "Transitive",
"resolved": "2.1.0",
"contentHash": "aHkjNTGIA+Zbdw6RJgSFrbDrCjO0CgqpElqYcvkRSeUhBv2bKarnvU3ep786U7UqrPlArT/B7VmImRibJD0Zrg=="
"resolved": "1.9.1",
"contentHash": "QafNtNSmEI0zazdebnsIkDKmFtTSpmx/5PLOjURWwozcPb3tvRxzosQSL8xwYNM1iPhhKiBksXZyRSE2COisrA=="
},
"Microsoft.Testing.Platform.MSBuild": {
"type": "Transitive",
Expand Down
Loading