Fix GitHub Actions tests by updating NUnit.ConsoleRunner version#717
Merged
Fix GitHub Actions tests by updating NUnit.ConsoleRunner version#717
Conversation
Updated the NUnit.ConsoleRunner path in the build workflow from version 3.15.0 to 3.21.1 to match the version specified in the project's packages.lock.json file. This resolves the mismatch that was causing test execution failures in GitHub Actions.
Added step to install WiX Toolset v3.11.2 using Chocolatey and set the WIX_PATH environment variable. Also updated the build command to use the correct WIX_PATH environment variable instead of the undefined 'wix' variable. This ensures the MSI installer can be built successfully during the GitHub Actions workflow.
Removed unnecessary Chocolatey installation of WiX Toolset and instead use the pre-installed WiX Toolset v3.14 that comes with the windows-2025 runner. This makes the build faster and more reliable by avoiding the installation step.
Downgraded RavenDB.Client and RavenDB.Embedded from 7.1.5 to 3.5.9 to match RavenDB.Database version. This ensures all RavenDB packages are on the compatible 3.5.9 version. Also updated renovate.json to disable automatic updates for all RavenDB packages to prevent future version conflicts.
Fixed typo in the test project build configuration property. This was preventing the test project from being built in Release mode, causing the test execution to fail.
Removed packages.lock.json files that contained stale references to RavenDB 7.1.5. These will be regenerated during NuGet restore with the correct RavenDB 3.5.9 versions specified in the .csproj files.
Updated all RavenDB packages to use version 3.5.9-patch-35280 since there is no stable release of RavenDB.Embedded 3.5.9. This patch version is the only compatible version that supports the EmbeddableDocumentStore class used in the codebase.
Added -PreRelease flag to nuget restore command to ensure prerelease packages (like RavenDB 3.5.9-patch-35280) are downloaded. Without this flag, NuGet would not restore the prerelease RavenDB packages specified in the project files.
Replaced all usages of the obsolete NestedDiagnosticsLogicalContext.Push with ScopeContext.PushNestedState as recommended by NLog 6.0. This API was marked obsolete in NLog 5.0 and causes compilation errors. Updated files: - Snittlistan.Queue/MessageQueueListenerBase.cs - Snittlistan.Web/Infrastructure/TaskPublisher.cs - Snittlistan.Web/Areas/V2/Controllers/Api/TaskController.cs
Reverted RavenDB packages from 3.5.9-patch-35280 (prerelease) back to stable version 3.5.9. Also removed the -PreRelease flag from NuGet restore since we're using stable package versions.
Added using alias to disambiguate between Snittlistan.Web.Areas.V2.Domain.Activity and System.Diagnostics.Activity. This resolves the CS0104 compilation error introduced by NLog 6.0 which uses System.Diagnostics features.
…sPrintController 1. CustomTraceListener: Initialize _level field with default LogLevel.Info to prevent null reference when WriteLine is called without Write 2. EliteMedalsPrintController: Add null-forgiving operators (!) to all PDF AcroForm field accesses since the template is expected to have these fields present
Changed _level from LogLevel? to LogLevel (non-nullable) to fix CS8604 error when passing to Logger.Log method. Updated TryGetValue logic to use a temporary variable and only assign to _level if the lookup succeeds, preserving the default LogLevel.Info value when the level string is not found in the dictionary.
Replaced obsolete NUnit assertion methods with NUnit 4 compatible syntax: - Assert.NotNull(x) → Assert.That(x, Is.Not.Null) - Assert.Null(x) → Assert.That(x, Is.Null) - Assert.True(x) → Assert.That(x, Is.True) - Assert.False(x) → Assert.That(x, Is.False) - Assert.IsAssignableFrom<T>(x) → Assert.That(x, Is.AssignableFrom<T>()) Updated 10 test files with 28 assertion replacements.
Corrected the parameter order in Assert.That call - the constraint must come before the optional message parameter. Changed from: Assert.That(equal, message, Is.True) to Assert.That(equal, Is.True, message)
…lve binding conflicts Added System.Runtime.CompilerServices.Unsafe version 6.0.0 as an explicit package reference to all projects to resolve MSB3277 assembly binding conflicts. This ensures all projects use the same version of the assembly, preventing version conflicts from transitive dependencies. Updated projects: - Snittlistan.Tool - Snittlistan.Queue - Snittlistan.Queue.ConsoleHost - Snittlistan.Queue.WindowsServiceHost - Snittlistan.Web
Updated binding redirects to match current package versions: - System.Web.Mvc: 5.2.8.0 → 5.3.0.0 - System.Net.Http.Formatting: 5.2.8.0 → 5.3.0.0 - System.Web.Http: 5.2.8.0 → 5.3.0.0 - Newtonsoft.Json: 12.0.0.0 → 13.0.0.0 - System.Runtime.CompilerServices.Unsafe: 4.0.5.0 → 6.0.0.0 This resolves FileLoadException errors during test execution caused by assembly version mismatches.
Changed the PR comment step to post a concise build summary with a link to the test results artifact instead of the entire HTML file contents. This prevents exceeding GitHub's comment size limit. The comment now includes: - Build version - Link to the workflow run with artifacts
Added explicit System.Collections.Immutable 8.0.0 package reference to the test project and updated the binding redirect to cover all versions from 0.0.0.0-8.0.0.0 redirecting to 8.0.0.0. This resolves the FileLoadException during test setup where version 5.0.0.0 was requested but couldn't be loaded.
Build Complete ✅Version: 25.52.5.564 📊 Test results are available in the build artifacts |
Changes: 1. Removed IgnoreExitCode="true" from build.build so test failures now fail the build (proper CI/CD behavior) 2. Updated GitHub Actions workflow to always upload artifacts and post PR comments even when tests fail by adding "if: success() || failure()" 3. Updated PR comment to show build status (✅ success or ❌ failure) so you always get feedback on test results Now test failures will: - Fail the build ✗ - Still upload test results HTML ✓ - Still post PR comment with status ✓
Build Complete ✅Version: 25.52.5.565 📊 Test results are available in the build artifacts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updated the NUnit.ConsoleRunner path in the build workflow from version
3.15.0 to 3.21.1 to match the version specified in the project's
packages.lock.json file. This resolves the mismatch that was causing
test execution failures in GitHub Actions.