-
Notifications
You must be signed in to change notification settings - Fork 0
Test coverage config #1
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
base: main
Are you sure you want to change the base?
Conversation
| @@ -0,0 +1,4 @@ | |||
| record Pattern(string Value) | |||
| { | |||
| public string SomeMethod => Value; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to trigger failing test coverage report
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usually in c# .NET you do <proj_name.Tests>. So for our test proj it should be PatternService.Tests.
| public class UnitTest1 | ||
| { | ||
| [Fact] | ||
| public void Test1() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make a local method just in this class to make the test fail to prove that the CI-pipeline fails:
[Fact]
public void ThisTestWillFail()
{
Assert.Equal(5, Add(2, 2));
}
private int LocalTestAdd(int x, int y)
{
return x + y;
}| run: dotnet build --no-restore | ||
| - name: Test | ||
| run: dotnet test --no-build --verbosity normal | ||
| run: dotnet test --no-build --verbosity normal --settings coverage.runsettings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the coverage.runsettings here is the file you have created, this will not find the file as it is looking for this file in this folder. I belive you can use ${{ github.workspace }}/coverage.runsettings. ${{ github.workspace }} should point to the project root folder if I'm not wrong.
No description provided.