MSTest package reference#28
Conversation
Corrigindo referência de versão dos pacotes relacionados ao framework de testes.
WalkthroughOs arquivos de projeto de testes unitários foram atualizados para versões mais recentes de pacotes relacionados ao MSTest e infraestrutura de testes. Em um projeto, houve também reestruturação dos grupos de referências e um downgrade de versão do Microsoft.NET.Test.Sdk. Não houve alterações em código-fonte, apenas nas configurações dos arquivos de projeto. Changes
Estimated code review effort1 (~5 minutos) Poem
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 5
🔭 Outside diff range comments (1)
InvoiceReminder.API.UnitTests/InvoiceReminder.API.UnitTests.csproj (1)
1-2: Atualize a versão do SDK MSTest em todos os projetos de testePara manter o Sdk alinhado com os pacotes MSTest
3.9.3e evitar warnings de binding ou comportamentos inesperados, ajuste o atributoSdkem cada arquivo de teste listado abaixo:• InvoiceReminder.JobScheduler.UnitTests/InvoiceReminder.JobScheduler.UnitTests.csproj
• InvoiceReminder.DomainEntities.UnitTests/InvoiceReminder.DomainEntities.UnitTests.csproj
• InvoiceReminder.ExternalServices.UnitTests/InvoiceReminder.ExternalServices.UnitTests.csproj
• InvoiceReminder.ArchitectureTests/InvoiceReminder.ArchitectureTests.csproj
• InvoiceReminder.Application.UnitTests/InvoiceReminder.Application.UnitTests.csproj
• InvoiceReminder.Infrastructure.UnitTests/InvoiceReminder.Infrastructure.UnitTests.csproj
• InvoiceReminder.API.UnitTests/InvoiceReminder.API.UnitTests.csproj-<Project Sdk="MSTest.Sdk/3.6.4"> +<Project Sdk="MSTest.Sdk/3.9.3">Após atualizar, execute
dotnet testem todos os projetos de teste para garantir que tudo continua passando sem falhas.
🧹 Nitpick comments (2)
InvoiceReminder.ArchitectureTests/InvoiceReminder.ArchitectureTests.csproj (1)
31-37: VáriosItemGroupseparados apenas por pacotes de teste
Consolidar osPackageReferencede teste em um únicoItemGroupreduz ruído visual sem impacto funcional.InvoiceReminder.JobScheduler.UnitTests/InvoiceReminder.JobScheduler.UnitTests.csproj (1)
16-16: Alinhe o patch do Microsoft.NET.Test.Sdk com o pacote de CodeCoverageO pacote Microsoft.Testing.Extensions.CodeCoverage já está em 17.14.2; manter o mesmo patch no Microsoft.NET.Test.Sdk evita divergência de binários e reduz risco de binding-redirect implícito.
- <PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.14.1" /> + <PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.14.2" />
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
InvoiceReminder.API.UnitTests/InvoiceReminder.API.UnitTests.csproj(1 hunks)InvoiceReminder.Application.UnitTests/InvoiceReminder.Application.UnitTests.csproj(1 hunks)InvoiceReminder.ArchitectureTests/InvoiceReminder.ArchitectureTests.csproj(1 hunks)InvoiceReminder.DomainEntities.UnitTests/InvoiceReminder.DomainEntities.UnitTests.csproj(1 hunks)InvoiceReminder.ExternalServices.UnitTests/InvoiceReminder.ExternalServices.UnitTests.csproj(2 hunks)InvoiceReminder.Infrastructure.UnitTests/InvoiceReminder.Infrastructure.UnitTests.csproj(1 hunks)InvoiceReminder.JobScheduler.UnitTests/InvoiceReminder.JobScheduler.UnitTests.csproj(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Analyze (csharp)
🔇 Additional comments (15)
InvoiceReminder.ExternalServices.UnitTests/InvoiceReminder.ExternalServices.UnitTests.csproj (2)
1-1: Alinhar a versão do SDK do projeto com os pacotes MSTestOs pacotes
MSTest.*foram atualizados para 3.9.3, mas o atributoSdkdo projeto continua em 3.6.4. Essa divergência pode gerar avisos ou falhas de compatibilidade (principalmente em geradores de código).
Sugestão de ajuste:-<Project Sdk="MSTest.Sdk/3.6.4"> +<Project Sdk="MSTest.Sdk/3.9.3">[ suggest_essential_refactor ]
32-56: Upgrade consistente; confirme build e execução dos testesAs versões dos pacotes
Microsoft.NET.Test.Sdk,Microsoft.Testing.Extensions.*eMSTest.*foram todas sincronizadas para a série 17.14.x / 3.9.x, o que é positivo para manter uniformidade entre os projetos de teste.
Recomendo apenas rodar o pipeline completo (build + testes) para garantir que não haja quebras de API introduzidas pelo upgrade deMicrosoft.NET.Test.Sdk.InvoiceReminder.ArchitectureTests/InvoiceReminder.ArchitectureTests.csproj (2)
21-25: Estrutura de referências de projeto ficou mais clara – bom ajuste.
SepararProjectReferenceem umItemGroupdedicado melhora a legibilidade do.csproje evita misturar dependências de build com dependências de testes.
40-43: MSTest.Sdk 3.6.4 x MSTest.TestAdapter/TestFramework 3.9.3 – possível incompatibilidade
OProject Sdk="MSTest.Sdk/3.6.4"já trazMSTest.TestAdapter/Framework3.6.x como transitivas. Atualizar só os pacotes viaUpdatepara 3.9.3 pode quebrar contratos internos do SDK. Verifique se há suporte oficial para misturar versões.Caso seja necessário manter 3.9.3, considere subir também o SDK:
-<Project Sdk="MSTest.Sdk/3.6.4"> +<Project Sdk="MSTest.Sdk/3.9.3">InvoiceReminder.Infrastructure.UnitTests/InvoiceReminder.Infrastructure.UnitTests.csproj (1)
34-34: Verifique consistência de patch-level entreMicrosoft.NET.Test.Sdke extensões.O
Microsoft.Testing.Extensions.CodeCoveragejá está em17.14.2, enquanto o runner principal (Microsoft.NET.Test.Sdk) ficou em17.14.1. Em geral, manter todos os pacotes da família17.14.xno mesmo patch evita avisos de compatibilidade e falhas sutis na coleta de cobertura ou geração de relatórios.InvoiceReminder.API.UnitTests/InvoiceReminder.API.UnitTests.csproj (4)
32-34: Upgrade doMicrosoft.NET.Test.SdkOKA versão 17.14.1 corrige problemas de cobertura e integra com o .NET 9 — atualização bem-vinda.
40-42:Microsoft.Testing.Extensions.TrxReportatualizado com sucessoVersão 1.7.3 traz melhorias de performance no parser TRX; sem breaking changes conhecidas.
44-49:MSTest.Analyzersatualizado — confirme regra CSxxxx suprimidaA atualização pode habilitar novas regras. Se existirem supressões (ex.:
#pragma warning disable), valide se ainda são necessárias.
51-57: Adapter & Framework alinhados
MSTest.TestAdaptereMSTest.TestFrameworkagora na mesma versão (3.9.3) => bom alinhamento.InvoiceReminder.DomainEntities.UnitTests/InvoiceReminder.DomainEntities.UnitTests.csproj (2)
36-37: Upgrade doMicrosoft.Testing.Extensions.TrxReportparece OKNenhum impacto funcional esperado; boa prática manter a ferramenta de report atualizada.
40-52: Pacotes MSTest sincronizados para 3.9.3Ótima atualização — versões uniformes de
Analyzers,TestAdaptereTestFrameworkreduzem incompatibilidades internas.InvoiceReminder.JobScheduler.UnitTests/InvoiceReminder.JobScheduler.UnitTests.csproj (2)
24-24: Upgrade do TrxReport parece corretoA versão 1.7.3 resolve bugs de geração de relatórios e é compatível com o SDK 17.14.x.
28-40: Bom alinhamento das versões MSTest para 3.9.3A sincronização do Analyzers, TestAdapter e TestFramework elimina conflitos de assembly e traz as melhorias da release 3.9.x.
InvoiceReminder.Application.UnitTests/InvoiceReminder.Application.UnitTests.csproj (2)
38-39: Atualização do TrxReport parece seguraA migração de
Microsoft.Testing.Extensions.TrxReportpara 1.7.3 é incremental, sem breaking-changes conhecidas.
Nada a apontar.
30-31: Comentário incorreto – referência “Update” é a maneira certa de sobrescrever a versão implícitaA linha
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.14.1" />não adiciona um novo pacote duplicado, mas apenas atualiza a versão do
Microsoft.NET.Test.Sdkque já é referenciado de forma implícita pelo SDKMSTest.Sdk/3.6.4. Esse é o procedimento recomendado para ajustar versões de pacotes trazidos pelo SDK sem gerar conflitos de restore.Não há ajustes necessários neste arquivo.
Likely an incorrect or invalid review comment.
| <PackageReference Update="MSTest.Analyzers" Version="3.9.3"> | ||
| <PrivateAssets>all</PrivateAssets> | ||
| <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
| </PackageReference> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Update="MSTest.TestAdapter" Version="3.8.3" /> | ||
| <PackageReference Update="MSTest.TestAdapter" Version="3.9.3" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Update="MSTest.TestFramework" Version="3.8.3" /> | ||
| <PackageReference Update="MSTest.TestFramework" Version="3.9.3" /> | ||
| </ItemGroup> |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Alinhar versões do ecossistema MSTest para evitar incompatibilidade
Os pacotes MSTest.Analyzers, MSTest.TestAdapter e MSTest.TestFramework foram atualizados para 3.9.3, porém o SDK raiz continua em 3.6.4.
Prática recomendada: manter todos na mesma versão principal/menor para garantir que regras de analisador, adapter e framework conversem corretamente com o SDK.
Proposta:
-<Project Sdk="MSTest.Sdk/3.6.4">
+<Project Sdk="MSTest.Sdk/3.9.3">Isso eliminará possíveis avisos de compatibilidade e garante suporte completo a novas features introduzidas na série 3.9.
Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In
InvoiceReminder.Application.UnitTests/InvoiceReminder.Application.UnitTests.csproj
around lines 42 to 54, the MSTest package versions are inconsistent, with some
updated to 3.9.3 while the root SDK remains at 3.6.4. To fix this, update the
root MSTest SDK version to 3.9.3 to align with the other MSTest packages,
ensuring all MSTest components use the same major and minor version to avoid
compatibility issues and enable full support for new features.
| <ItemGroup> | ||
| <PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.13.0" /> | ||
| </ItemGroup> |
There was a problem hiding this comment.
Versão do Microsoft.NET.Test.Sdk divergente do restante da solução
Os outros projetos de teste foram atualizados para 17.14.1, enquanto aqui houve downgrade para 17.13.0. Misturar runners de versão diferente costuma gerar falhas intermitentes ou relatórios de cobertura incompatíveis.
Sugestão de ajuste:
- <PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.13.0" />
+ <PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.14.1" />🤖 Prompt for AI Agents
In InvoiceReminder.ArchitectureTests/InvoiceReminder.ArchitectureTests.csproj at
lines 27 to 29, the Microsoft.NET.Test.Sdk package version is set to 17.13.0,
which is inconsistent with other test projects using version 17.14.1. Update the
Version attribute of the PackageReference for Microsoft.NET.Test.Sdk to 17.14.1
to align with the rest of the solution and avoid potential test runner conflicts
or coverage report issues.
| <PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.14.1" /> | ||
| </ItemGroup> |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Verifique o “mix” de SDKs antes do merge
Você atualizou Microsoft.NET.Test.Sdk para 17.14.1, porém o projeto continua ancorado em <Project Sdk="MSTest.Sdk/3.6.4">.
Isso pode gerar conflitos de assembly-binding e warnings de versão, pois:
MSTest.Sdk3.6.4 traz transitive refs do trioMSTest.*em versão 3.6.*.- Agora você injeta explicitamente
MSTest.*3.9.3 +Microsoft.NET.Test.Sdk17.14.1.
Recomendo alinhar tudo em torno da mesma major/minor (ex.: subir o cabeçalho para MSTest.Sdk/3.9.3 ou voltar para Microsoft.NET.Sdk + refs explícitas) antes de prosseguir.
Exemplo de ajuste sugerido fora deste trecho:
-<Project Sdk="MSTest.Sdk/3.6.4">
+<Project Sdk="MSTest.Sdk/3.9.3">Para confirmar a versão do SDK e as referências de pacote neste projeto de testes, execute:
🏁 Script executed:
#!/bin/bash
grep -n "<Project Sdk" InvoiceReminder.DomainEntities.UnitTests/InvoiceReminder.DomainEntities.UnitTests.csproj
grep -n "PackageReference.*Microsoft.NET.Test.Sdk" InvoiceReminder.DomainEntities.UnitTests/InvoiceReminder.DomainEntities.UnitTests.csprojLength of output: 369
Alinhar versão do Project Sdk com o pacote de testes
O projeto de testes está declarando
<Project Sdk="MSTest.Sdk/3.6.4">enquanto o Microsoft.NET.Test.Sdk foi elevado para a versão 17.14.1. Esse “mix” de versões pode causar conflitos de binding e avisos de versão em tempo de build.
Pontos a ajustar:
- InvoiceReminder.DomainEntities.UnitTests/InvoiceReminder.DomainEntities.UnitTests.csproj
- Linha 1:
<Project Sdk="MSTest.Sdk/3.6.4"> - Linha 28:
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.14.1" />
- Linha 1:
Sugestões de correção (escolha uma abordagem):
- Atualizar o header do projeto para usar o MSTest.Sdk/3.9.3, mantendo tudo em major/minor 3.9.x.
- Ou migrar para
<Project Sdk="Microsoft.NET.Sdk">e referenciar explicitamenteMicrosoft.NET.Test.Sdk,MSTest.TestAdaptereMSTest.TestFrameworkcom versões alinhadas.
Exemplo de diff para a primeira opção:
-<Project Sdk="MSTest.Sdk/3.6.4">
+<Project Sdk="MSTest.Sdk/3.9.3">🤖 Prompt for AI Agents
In
InvoiceReminder.DomainEntities.UnitTests/InvoiceReminder.DomainEntities.UnitTests.csproj
at lines 1 and 28-29, the Project Sdk version MSTest.Sdk/3.6.4 conflicts with
the updated Microsoft.NET.Test.Sdk package version 17.14.1, causing potential
binding issues. To fix this, update the Project Sdk declaration on line 1 to
MSTest.Sdk/3.9.3 to align with the test package version, ensuring consistent
major/minor versions and avoiding conflicts.
| <PackageReference Update="MSTest.Analyzers" Version="3.9.3"> | ||
| <PrivateAssets>all</PrivateAssets> | ||
| <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
| </PackageReference> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Update="MSTest.TestAdapter" Version="3.8.3" /> | ||
| <PackageReference Update="MSTest.TestAdapter" Version="3.9.3" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Update="MSTest.TestFramework" Version="3.8.3" /> | ||
| <PackageReference Update="MSTest.TestFramework" Version="3.9.3" /> | ||
| </ItemGroup> |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Alinhe a versão do SDK declarado no topo com os pacotes MSTest 3.9.3.
O projeto usa <Project Sdk="MSTest.Sdk/3.6.4">, mas os pacotes MSTest.* foram atualizados para 3.9.3. Manter versões divergentes entre o SDK e o Adapter/TestFramework pode gerar:
• avisos MSB3277 de conflito de assembly;
• falhas de descoberta de testes em tempo de execução;
• perda de diagnósticos recentes do Analyzers.
Sugestão:
-<Project Sdk="MSTest.Sdk/3.6.4">
+<Project Sdk="MSTest.Sdk/3.9.3">Caso o objetivo seja usar apenas o SDK padrão (Microsoft.NET.Sdk) com pacotes externos, considere substituir pelo Microsoft.NET.Sdk e remover a dependência explícita de MSTest.Sdk.
Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In
InvoiceReminder.Infrastructure.UnitTests/InvoiceReminder.Infrastructure.UnitTests.csproj
around lines 46 to 58, the project SDK version MSTest.Sdk/3.6.4 declared at the
top is outdated compared to the MSTest package versions 3.9.3 used in the
dependencies. To fix this, either update the SDK version to match 3.9.3 or
replace the SDK declaration with Microsoft.NET.Sdk and remove the explicit
MSTest.Sdk dependency to avoid assembly conflicts, test discovery failures, and
analyzer issues.
| @@ -1,4 +1,4 @@ | |||
| <Project Sdk="MSTest.Sdk/3.6.4"> | |||
| <Project Sdk="MSTest.Sdk/3.6.4"> | |||
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Atualize o SDK do projeto para manter compatibilidade com os pacotes MSTest 3.9.3
Os pacotes MSTest.TestFramework/Adapter/Analyzers foram elevados para 3.9.3, mas o SDK do projeto continua em 3.6.4. Isso pode gerar warnings ou comportamentos inesperados (features de assert, message diagnostics, etc.) caso exista quebra de contrato entre as versões.
-<Project Sdk="MSTest.Sdk/3.6.4">
+<Project Sdk="MSTest.Sdk/3.9.3">Para confirmar o Sdk e as versões dos pacotes MSTest configurados neste projeto, vou inspecionar o arquivo csproj:
🏁 Script executed:
#!/bin/bash
# Exibe as primeiras linhas do csproj para verificar o atributo <Project Sdk=…>
sed -n '1,20p' InvoiceReminder.JobScheduler.UnitTests/InvoiceReminder.JobScheduler.UnitTests.csproj
echo "Referências aos pacotes MSTest e suas versões:"
grep -E "<PackageReference.*MSTest.TestFramework" -n InvoiceReminder.JobScheduler.UnitTests/InvoiceReminder.JobScheduler.UnitTests.csproj
grep -E "<PackageReference.*MSTest.TestAdapter" -n InvoiceReminder.JobScheduler.UnitTests/InvoiceReminder.JobScheduler.UnitTests.csproj
grep -E "<PackageReference.*Analyzer" -n InvoiceReminder.JobScheduler.UnitTests/InvoiceReminder.JobScheduler.UnitTests.csprojLength of output: 1713
Atualizar o SDK do projeto para 3.9.3
Para manter a compatibilidade com os pacotes MSTest.TestFramework, MSTest.TestAdapter e MSTest.Analyzers (todos na versão 3.9.3), atualize o atributo Sdk no arquivo de teste:
• Arquivo: InvoiceReminder.JobScheduler.UnitTests/InvoiceReminder.JobScheduler.UnitTests.csproj
• Linha: 1
-<Project Sdk="MSTest.Sdk/3.6.4">
+<Project Sdk="MSTest.Sdk/3.9.3">🤖 Prompt for AI Agents
In
InvoiceReminder.JobScheduler.UnitTests/InvoiceReminder.JobScheduler.UnitTests.csproj
at line 1, update the Project Sdk attribute from "MSTest.Sdk/3.6.4" to
"MSTest.Sdk/3.9.3" to ensure compatibility with MSTest.TestFramework,
MSTest.TestAdapter, and MSTest.Analyzers packages version 3.9.3.
Corrigindo referência de versão dos pacotes relacionados ao framework de testes.
✨
Description by Callstackai
This PR updates the version references for MSTest packages across multiple unit test projects.
Diagrams of code changes
sequenceDiagram participant PR as Pull Request participant AT as Architecture Tests participant Tests as Test Projects PR->>AT: Add Project References Note over AT: Added references to:<br/>API, Application,<br/>Data, Domain projects PR->>Tests: Update Test Packages Note over Tests: Updated versions for:<br/>Microsoft.NET.Test.Sdk (17.14.1)<br/>MSTest.* packages (3.9.3)<br/>TrxReport (1.7.3) PR->>Tests: Update Project SDK Note over Tests: Changed to MSTest.Sdk/3.6.4<br/>for some test projectsFiles Changed
This PR includes files in programming languages that we currently do not support. We have not reviewed files with the extensions
.csproj. See list of supported languages.Summary by CodeRabbit