Skip to content

Warning fixes#162

Merged
alex-clickhouse merged 5 commits intomainfrom
warning-fixes
Jan 6, 2026
Merged

Warning fixes#162
alex-clickhouse merged 5 commits intomainfrom
warning-fixes

Conversation

@alex-clickhouse
Copy link
Copy Markdown
Collaborator

@alex-clickhouse alex-clickhouse commented Jan 6, 2026

Fix warnings that need to be fixed, suppress those that don't. Build now completes with no warnings.


Note

Build/Project

  • Add SuppressTfmSupportBuildWarnings to ClickHouse.Driver.csproj and test csproj; add NoWarn=CS8002 to test csproj

Tests

  • Make AbstractConnectionTestFixture abstract
  • Update JsonTypeTests to use Assert.That style and precise comparisons
  • In RolesTests, remove nullable annotation from commandRoles parameter while keeping default null
  • In ClickHouseClientSettingsTests, wrap self-comparison with #pragma to suppress CS1718

Written by Cursor Bugbot for commit 05bfc54. This will update automatically on new commits. Configure here.

The Microsoft.Extensions.* and System.* packages v10.x don't officially
support net6.0, but we still target and test on it for compatibility.

Also suppress CS8002 warnings for Dapper packages that lack strong names.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR eliminates compiler warnings to achieve a clean build by strategically suppressing infrastructure-related warnings and fixing code-level warning sources.

Key changes:

  • Suppressed build warnings for target framework support across project and test files
  • Fixed test code issues: made AbstractConnectionTestFixture abstract, updated test assertions to NUnit 4 style, removed unnecessary nullable annotation, and suppressed intentional self-comparison warning

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
ClickHouse.Driver/ClickHouse.Driver.csproj Suppresses TFM support build warnings for the main driver package
ClickHouse.Driver.Tests/ClickHouse.Driver.Tests.csproj Suppresses TFM warnings and CS8002 (missing referenced assembly) for test project
ClickHouse.Driver.Tests/AbstractConnectionTestFixture.cs Makes test fixture class abstract (was never directly instantiated)
ClickHouse.Driver.Tests/Types/JsonTypeTests.cs Updates assertions from ClassicAssert to NUnit 4 Assert.That style
ClickHouse.Driver.Tests/ADO/RolesTests.cs Removes nullable annotation from optional parameter (still defaults to null)
ClickHouse.Driver.Tests/ADO/ClickHouseClientSettingsTests.cs Suppresses CS1718 warning for intentional self-comparison test

Comment thread ClickHouse.Driver.Tests/ADO/RolesTests.cs
Assert.That((string)result["nested"]["level2_string"], Is.EqualTo("nested_value"));

// Assert non-hinted property
ClassicAssert.IsInstanceOf<JsonValue>(result["unhinted_float"]);
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

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

This assertion still uses the deprecated ClassicAssert API while the surrounding assertions were updated to Assert.That style. For consistency with the rest of the changes in this file, update this to Assert.That(result[\"unhinted_float\"], Is.InstanceOf<JsonValue>()).

Copilot generated this review using guidance from repository custom instructions.
@codecov
Copy link
Copy Markdown

codecov bot commented Jan 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@alex-clickhouse alex-clickhouse merged commit bf98358 into main Jan 6, 2026
17 checks passed
@alex-clickhouse alex-clickhouse deleted the warning-fixes branch January 12, 2026 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants