From 92ce4c5af5892de1d216ac28d8844c367bb35cfc Mon Sep 17 00:00:00 2001 From: Henry Asbridge Date: Tue, 15 Jul 2025 18:50:56 +0100 Subject: [PATCH] Update dependencies (#1093) * Update dependencies of lighthouse * Fix race condition in test * Stop using async void in tests. * Hopefully fix qodana issues * Disable qodana PR-mode * Suppress license issue in qodana as not a problem * Exclude svg files from qodana scans --- .github/workflows/qodana_code_quality.yml | 4 +--- .../ProjectLighthouse.Servers.Website.csproj | 2 +- ...rojectLighthouse.Tests.GameApiTests.csproj | 14 +++++------ .../Integration/AuthenticationTests.cs | 6 ++++- ...rojectLighthouse.Tests.WebsiteTests.csproj | 18 +++++++------- .../ProjectLighthouse.Tests.csproj | 16 ++++++------- .../Unit/ModerationTests.cs | 7 +++--- ProjectLighthouse/ProjectLighthouse.csproj | 24 +++++++++---------- qodana.yaml | 6 ++++- 9 files changed, 52 insertions(+), 45 deletions(-) diff --git a/.github/workflows/qodana_code_quality.yml b/.github/workflows/qodana_code_quality.yml index fdd4c7d5..0595c838 100644 --- a/.github/workflows/qodana_code_quality.yml +++ b/.github/workflows/qodana_code_quality.yml @@ -25,11 +25,9 @@ jobs: fetch-depth: 0 # a full history is required for pull request analysis - name: 'Qodana Scan' uses: JetBrains/qodana-action@v2024.3 - with: - pr-mode: false env: QODANA_TOKEN: ${{ secrets.QODANA_TOKEN_1488465344 }} - QODANA_ENDPOINT: 'https://qodana.cloud' + QODANA_ENDPOINT: 'https://api.qodana.cloud' - uses: github/codeql-action/upload-sarif@v3 with: sarif_file: ${{ runner.temp }}/qodana/results/qodana.sarif.json diff --git a/ProjectLighthouse.Servers.Website/ProjectLighthouse.Servers.Website.csproj b/ProjectLighthouse.Servers.Website/ProjectLighthouse.Servers.Website.csproj index 7768663f..853c5285 100644 --- a/ProjectLighthouse.Servers.Website/ProjectLighthouse.Servers.Website.csproj +++ b/ProjectLighthouse.Servers.Website/ProjectLighthouse.Servers.Website.csproj @@ -11,6 +11,6 @@ - + diff --git a/ProjectLighthouse.Tests.GameApiTests/ProjectLighthouse.Tests.GameApiTests.csproj b/ProjectLighthouse.Tests.GameApiTests/ProjectLighthouse.Tests.GameApiTests.csproj index ef720919..60b47519 100644 --- a/ProjectLighthouse.Tests.GameApiTests/ProjectLighthouse.Tests.GameApiTests.csproj +++ b/ProjectLighthouse.Tests.GameApiTests/ProjectLighthouse.Tests.GameApiTests.csproj @@ -8,19 +8,19 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/ProjectLighthouse.Tests.WebsiteTests/Integration/AuthenticationTests.cs b/ProjectLighthouse.Tests.WebsiteTests/Integration/AuthenticationTests.cs index 1fa9feff..ce6316a7 100644 --- a/ProjectLighthouse.Tests.WebsiteTests/Integration/AuthenticationTests.cs +++ b/ProjectLighthouse.Tests.WebsiteTests/Integration/AuthenticationTests.cs @@ -26,7 +26,11 @@ public class AuthenticationTests : LighthouseWebTest string password = CryptoHelper.Sha256Hash(CryptoHelper.GenerateRandomBytes(64).ToArray()); UserEntity user = await database.CreateUser($"unitTestUser{CryptoHelper.GenerateRandomInt32()}", CryptoHelper.BCryptHash(CryptoHelper.Sha256Hash(password))); - this.Driver.Navigate().GoToUrl(this.BaseAddress + "/login"); + // Sometimes not having this causes a race condition + // ReSharper disable once MethodHasAsyncOverload + database.SaveChanges(); + + await this.Driver.Navigate().GoToUrlAsync(this.BaseAddress + "/login"); this.Driver.FindElement(By.Id("text")).SendKeys(user.Username); this.Driver.FindElement(By.Id("password")).SendKeys(password); diff --git a/ProjectLighthouse.Tests.WebsiteTests/ProjectLighthouse.Tests.WebsiteTests.csproj b/ProjectLighthouse.Tests.WebsiteTests/ProjectLighthouse.Tests.WebsiteTests.csproj index c5b336f5..2d78501d 100644 --- a/ProjectLighthouse.Tests.WebsiteTests/ProjectLighthouse.Tests.WebsiteTests.csproj +++ b/ProjectLighthouse.Tests.WebsiteTests/ProjectLighthouse.Tests.WebsiteTests.csproj @@ -8,21 +8,21 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/ProjectLighthouse.Tests/ProjectLighthouse.Tests.csproj b/ProjectLighthouse.Tests/ProjectLighthouse.Tests.csproj index 4c4199a9..15874823 100644 --- a/ProjectLighthouse.Tests/ProjectLighthouse.Tests.csproj +++ b/ProjectLighthouse.Tests/ProjectLighthouse.Tests.csproj @@ -13,23 +13,23 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all - + diff --git a/ProjectLighthouse.Tests/Unit/ModerationTests.cs b/ProjectLighthouse.Tests/Unit/ModerationTests.cs index 32fc3d73..c574abf4 100644 --- a/ProjectLighthouse.Tests/Unit/ModerationTests.cs +++ b/ProjectLighthouse.Tests/Unit/ModerationTests.cs @@ -1,4 +1,5 @@ using System; +using System.Threading.Tasks; using LBPUnion.ProjectLighthouse.Administration.Maintenance.RepeatingTasks; using LBPUnion.ProjectLighthouse.Database; using LBPUnion.ProjectLighthouse.Tests.Helpers; @@ -12,7 +13,7 @@ namespace LBPUnion.ProjectLighthouse.Tests.Unit; public class ModerationTests { [Fact] - public async void DismissExpiredCases_ShouldDismissExpiredCase() + public async Task DismissExpiredCases_ShouldDismissExpiredCase() { await using DatabaseContext database = await MockHelper.GetTestDatabase(); @@ -35,7 +36,7 @@ public class ModerationTests } [Fact] - public async void DismissExpiredCases_ShouldNotDismissActiveCase() + public async Task DismissExpiredCases_ShouldNotDismissActiveCase() { await using DatabaseContext database = await MockHelper.GetTestDatabase(); @@ -58,7 +59,7 @@ public class ModerationTests } [Fact] - public async void DismissExpiredCases_ShouldNotDismissAlreadyDismissedCase() + public async Task DismissExpiredCases_ShouldNotDismissAlreadyDismissedCase() { await using DatabaseContext database = await MockHelper.GetTestDatabase(); diff --git a/ProjectLighthouse/ProjectLighthouse.csproj b/ProjectLighthouse/ProjectLighthouse.csproj index 6fff81a2..e157904d 100644 --- a/ProjectLighthouse/ProjectLighthouse.csproj +++ b/ProjectLighthouse/ProjectLighthouse.csproj @@ -10,26 +10,26 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - + + + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - - - + + + diff --git a/qodana.yaml b/qodana.yaml index 63159eca..c6439c0a 100644 --- a/qodana.yaml +++ b/qodana.yaml @@ -1,5 +1,5 @@ version: "1.0" -linter: jetbrains/qodana-dotnet:2024.1 +linter: jetbrains/qodana-dotnet:2024.3 profile: name: qodana.recommended include: @@ -9,3 +9,7 @@ exclude: paths: - ProjectLighthouse.Localization - ProjectLighthouse/Migrations + - ProjectLighthouse/StaticFiles/css/themes + - ProjectLighthouse/StaticFiles/safari-pinned-tab.svg +dependencyIgnores: + - name: "SixLabors.ImageSharp" # We're open source, so we come under the Apache License \ No newline at end of file