Skip to content

Ignore NUnit1034 warning to make Postgres11_0IndexTests abstract#2207

Merged
jzabroski merged 3 commits into
mainfrom
copilot/fix-postgres11-0indextests
Dec 3, 2025
Merged

Ignore NUnit1034 warning to make Postgres11_0IndexTests abstract#2207
jzabroski merged 3 commits into
mainfrom
copilot/fix-postgres11-0indextests

Conversation

Copilot AI commented Dec 3, 2025

Copy link
Copy Markdown
Contributor
  • Analyze the issue: NUnit1034 warning for Postgres11_0IndexTests
  • Understand reviewer feedback: Making class abstract would prevent tests from running
  • Revert abstract change and suppress NUnit1034 warning using #pragma
  • Verify the warning is suppressed
  • Verify tests run correctly (70 tests for both Postgres11_0 and Postgres15_0)

Summary

Changed approach from making Postgres11_0IndexTests abstract to suppressing the NUnit1034 warning with #pragma warning disable.

The class contains actual test methods (CanCreateIndexAsOnly, CanCreateIndexWithVacuumCleanupIndexScaleFactor) that should execute when testing Postgres 11.0. Making it abstract would prevent these tests from running directly on the Postgres11_0 generator.

Original prompt

This section details on the original issue you should resolve

<issue_title>warning NUnit1034: Class Postgres11_0IndexTests is used as a base class and should be abstract</issue_title>
<issue_description>Is your feature request related to a problem? Please describe.
Warning: /home/runner/work/fluentmigrator/fluentmigrator/test/FluentMigrator.Tests/Unit/Generators/Postgres11_0/Postgres11_0IndexTests.cs(14,18): warning NUnit1034: Class Postgres11_0IndexTests is used as a base class and should be abstract (https://github.com/nunit/nunit.analyzers/tree/master/documentation/NUnit1034.md)
</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Fix NUnit1034 warning for Postgres11_0IndexTests Make Postgres11_0IndexTests abstract to fix NUnit1034 warning Dec 3, 2025
Copilot AI requested a review from jzabroski December 3, 2025 03:20
@jzabroski

Copy link
Copy Markdown
Collaborator

@copilot Look again. The likely right fix is to silence this warning as a false positive, as Postgres11_0IndexTests provides actual tests to execute that are also run by Postgres15_0IndexTests. If there is an alternative way to code such tests with NUnit let's discuss

…abstract

The Postgres11_0IndexTests class contains actual test methods that should run
for Postgres 11.0. Making it abstract would prevent these tests from running.
Instead, suppress the warning using #pragma since this is a valid use case.

Co-authored-by: jzabroski <[email protected]>

Copilot AI commented Dec 3, 2025

Copy link
Copy Markdown
Contributor Author

@copilot Look again. The likely right fix is to silence this warning as a false positive, as Postgres11_0IndexTests provides actual tests to execute that are also run by Postgres15_0IndexTests. If the...

You're right. Changed approach to suppress the NUnit1034 warning with #pragma warning disable instead of making the class abstract. This preserves the test execution for both Postgres 11.0 and 15.0 generators (70 tests total now run vs 35 before). Commit 0dd460a.

@jzabroski
jzabroski marked this pull request as ready for review December 3, 2025 03:46
@github-actions

github-actions Bot commented Dec 3, 2025

Copy link
Copy Markdown

Test Results

    2 files  ±0      2 suites  ±0   38s ⏱️ -1s
5 366 tests ±0  5 034 ✅ ±0  332 💤 ±0  0 ❌ ±0 
5 847 runs  ±0  5 251 ✅ ±0  596 💤 ±0  0 ❌ ±0 

Results for commit 0dd460a. ± Comparison against base commit 7659685.

♻️ This comment has been updated with latest results.

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.

warning NUnit1034: Class Postgres11_0IndexTests is used as a base class and should be abstract

2 participants