Skip to content

Clean up CS8632 warnings in Service.Tests (nullable annotations under <Nullable>disable</Nullable>) #3543

@aaronburtle

Description

@aaronburtle

Background

src/Service.Tests/Azure.DataApiBuilder.Service.Tests.csproj declares
<Nullable>disable</Nullable>, but a handful of test files use C# nullable
reference type syntax (e.g. string? result, string? issuer). The compiler
emits CS8632 ("The annotation for nullable reference types should only be
used in code within a '#nullable' annotations context") for every such usage.

Known files (non-exhaustive)

  • src/Service.Tests/Configuration/RuntimeConfigLoaderTests.cs (~3 warnings)
  • src/Service.Tests/UnitTests/RequestParserUnitTests.cs (~4 warnings)
  • src/Service.Tests/UnitTests/SqlQueryExecutorUnitTests.cs (~4 warnings)

A full sweep is needed; the list above came from incidental observation, not
a project-wide audit.

Why it's worth fixing

  • The warnings are noise in CI build logs and can mask real issues.
  • They are inconsistent with the rest of the repo, which builds clean.
  • Some build configurations (e.g. Docker, certain Release flows) already
    enable TreatWarningsAsErrors=True. If Service.Tests ever inherits
    that setting, these become hard build breaks.

Metadata

Metadata

Assignees

Labels

Type

No fields configured for Task.

Projects

Status

Review In Progress

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions