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

AppVeyor UploadTestResults #807

Open
anorisoft opened this issue Mar 11, 2021 · 10 comments
Open

AppVeyor UploadTestResults #807

anorisoft opened this issue Mar 11, 2021 · 10 comments

Comments

@anorisoft
Copy link

Test results are not uploaded to AppVeyor.

https://stackoverflow.com/questions/46370959/cake-build-and-nunit3-generating-empty-results-file

@gep13
Copy link
Member

gep13 commented Mar 11, 2021

You are correct, Cake.Recipe does not currently have functionality for including this.

If this is something that you are interested in adding to the project, then a PR to add this in would be appreciated, and we can begin a review process.

@anorisoft
Copy link
Author

How are the test results currently published? Is Appveyor still supported by Cake Recipe?

@gep13
Copy link
Member

gep13 commented Mar 11, 2021

Yes, using AppVeyor is still very much supported in Cake.Recipe. Currently, Cake.Recipe takes the approach of generating a report for the unit tests, rather than reporting it to the CI system it is running on. You could add a custom task that does this work within your project.

@anorisoft
Copy link
Author

How can I use the report for the unit tests. With NUnit the console output is written but nothing in the directory. If I find time I will make a PR. What strategy do you recommend? Should I better make my own fork where I customize the scripts or can I just add my own scrips?

@gep13
Copy link
Member

gep13 commented Mar 12, 2021

If you are looking to modify the functionality that is offered within Cake.Recipe, then you can do that by changing/overridding the built in tasks. This is documented here:

https://cake-contrib.github.io/Cake.Recipe/docs/extending/modify-built-in-tasks

If what you are changing is something that you think would be useful to other people, then a PR to add this functionality into Cake.Recipe itself would be the correct way to go.

@anorisoft
Copy link
Author

That's a good way to go. This way I can try out my idea. If it works, I'll do a PR.

@anorisoft
Copy link
Author

anorisoft commented Mar 12, 2021

I have tried but something does not work. I delete all test tasks and overwrite them with the example. The result does not change.

BuildParameters.SetParameters(
    context: Context,
    buildSystem: BuildSystem,
    sourceDirectoryPath: "./Source",
    testDirectoryPath: "./Tests",
    title: "Anori.Extensions",
    repositoryOwner: "anorisoft",
    repositoryName: "Anori.Extensions",
    appVeyorAccountName: "anorisoft",
    shouldGenerateDocumentation: true,
    shouldRunDupFinder: false,
	shouldRunCodecov: true,
    shouldRunCoveralls: true,
    shouldRunDotNetCorePack: true);

Information("Clear NUnit3Test");
Information("NUnit3Test {0}", ((CakeTask)BuildParameters.Tasks.TestNUnitTask.Task).Actions.Count);
((CakeTask)BuildParameters.Tasks.TestNUnitTask.Task).Actions.Clear();
Information("NUnit3Test {0}", ((CakeTask)BuildParameters.Tasks.TestNUnitTask.Task).Actions.Count);
((CakeTask)BuildParameters.Tasks.TestMSTestTask.Task).Actions.Clear();
((CakeTask)BuildParameters.Tasks.TestVSTestTask.Task).Actions.Clear();

Information("Add Extended NUnit3Test");
BuildParameters.Tasks.TestNUnitTask
    .Does(() => {
        Information("Do something...");
    })
    .Does(() => {
        Information("Do something else...");
    });

BuildParameters.Tasks.TestMSTestTask 
    .Does(() => {
        Information("Do something...");
    })
    .Does(() => {
        Information("Do something else...");
    });

 BuildParameters.Tasks.TestVSTestTask 
    .Does(() => {
        Information("Do something...");
    })
    .Does(() => {
        Information("Do something else...");
    });

@anorisoft
Copy link
Author

Oh. It was the wrong Task.

BuildParameters.Tasks.DotNetCoreTestTask

@anorisoft
Copy link
Author

Does DotNetCoreTester have a result file that you could send to appveyor?

@anorisoft
Copy link
Author

Hi. What is the normal way with cake recipe to display issue reports. How should I bring the report.html file to gitHub. Is there a description of the workflow?

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

No branches or pull requests

2 participants