Skip to content

Conversation

@monaullah
Copy link
Owner

No description provided.

@@ -0,0 +1,4 @@
record Pattern(string Value)
{
public string SomeMethod => Value;
Copy link
Owner Author

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

@monaullah monaullah marked this pull request as draft November 5, 2024 06:52
Copy link
Collaborator

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()
Copy link
Collaborator

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
Copy link
Collaborator

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.

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.

3 participants