Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add e2e test for custom analyzer rules #10076

Conversation

YuliiaKovalova
Copy link
Member

@YuliiaKovalova YuliiaKovalova commented Apr 25, 2024

Context

In order to cover the full flow, in this tests we:

  1. Build the analyzer project(s) and package it/them into a NuGet package(s).
  2. Include a reference to the local package containing the rule(s) in the project that needs analysis (AnalysisCandidate) using a nuget.config file.
  3. Build AnalysisCandidate and verify the output for messages generated by the custom analyzers related to detecting custom rules.
    The structure of the rules was generated using: https://github.com/dotnet/msbuild/tree/main/template_feed/Microsoft.AnalyzerTemplate
  • instantiate missed BuildEventContext in BuildCheckConnectorLogger.cs

@YuliiaKovalova YuliiaKovalova marked this pull request as draft April 25, 2024 10:14
@YuliiaKovalova YuliiaKovalova changed the title Dev/ykovalova/e2e tests for custom rules Add e2e test for custom rules Apr 25, 2024
@YuliiaKovalova YuliiaKovalova changed the title Add e2e test for custom rules Add e2e test for custom analyzer rules Apr 25, 2024
Copy link
Member

@rainersigwald rainersigwald left a comment

Choose a reason for hiding this comment

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

I like the idea of having a full-strength end-to-end-via-package test, but it feels very early for that to be checked in, and the package construction stuff is low-pri for me. Is now the right time?

Copy link
Member

@JanKrivanek JanKrivanek left a comment

Choose a reason for hiding this comment

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

Thank you for tackling this!

@JanKrivanek
Copy link
Member

I like the idea of having a full-strength end-to-end-via-package test, but it feels very early for that to be checked in, and the package construction stuff is low-pri for me. Is now the right time?

Let's discuss the concerns offline (@YuliiaKovalova, @rainersigwald) - I want to understand them better

Copy link
Contributor

@f-alizada f-alizada left a comment

Choose a reason for hiding this comment

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

Cool tests! :) Thank you!

src/BuildCheck.UnitTests/EndToEndTests.cs Outdated Show resolved Hide resolved
src/BuildCheck.UnitTests/EndToEndTests.cs Outdated Show resolved Hide resolved
src/BuildCheck.UnitTests/EndToEndTests.cs Outdated Show resolved Hide resolved
@YuliiaKovalova YuliiaKovalova merged commit 1c3b240 into dotnet:main May 7, 2024
10 checks passed
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.

4 participants