Skip to content
This repository has been archived by the owner on Feb 24, 2021. It is now read-only.

Add Summary & Breakdown of Test Result Performance to AppVeyor Output #309

Open
PlagueHO opened this issue Jan 26, 2019 · 4 comments
Open
Labels
enhancement The issue is an enhancement request. help wanted The issue is up for grabs for anyone in the community.

Comments

@PlagueHO
Copy link
Contributor

As a DSC resource kit contributor
I want to be able to see the amount of time spent running tests in each file/fixture
So that my test I can identify tests that might be targets for improving performance

See: dsccommunity/xPSDesiredStateConfiguration#477 (comment)

Tagging @mhendric, @johlju

@johlju
Copy link
Contributor

johlju commented Jan 27, 2019

I liked the idea of outputing a table from the NUnitXML. Start with that and see how far it gets us? I think it should be enough. 🤔

@johlju
Copy link
Contributor

johlju commented Jan 27, 2019

Maybe instead of outputting a table, maybe we can add the information to the test pane? If we made this into a helper function, when looping through the NUnitXML we could just add rows to the test pane. That way each file would be at the top of the test pane results. 🤔
I'm good with an ASCII table in the output view too 🙂

if ($PSVersionTable.PSEdition -eq 'Core')
{
$requestObject = @{
testName = $addAppVeyorTestParameters.Name
testFramework = $addAppVeyorTestParameters.Framework
fileName = $addAppVeyorTestParameters.Filename
outcome = $addAppVeyorTestParameters.Outcome
durationMilliseconds = $addAppVeyorTestParameters.Duration
}
if ($result.FailureMessage)
{
$requestObject['ErrorMessage'] = $addAppVeyorTestParameters.ErrorMessage
$requestObject['ErrorStackTrace'] = $addAppVeyorTestParameters.ErrorStackTrace
}
<#
ConvertTo-Json will handle all escaping for us, like escaping
double quotes and backslashes.
#>
$requestBody = $requestObject | ConvertTo-Json
Invoke-RestMethod -Method Post -Uri "$env:APPVEYOR_API_URL/api/tests" -Body $requestBody -ContentType 'application/json' | Out-Null
}
else
{
Add-AppveyorTest @addAppVeyorTestParameters
}

@PlagueHO
Copy link
Contributor Author

Do you mean the AppVeyor Tests:
image

So you're thinking adding test summaries directly to the test results tab in AppVeyor for the run? That could definitely be worth investigating!

@johlju
Copy link
Contributor

johlju commented Jan 28, 2019

Yes exactly. If test name need to have a value then just use the filename there too. I'm thinking one entry per file, and after that all the entries is added from the pester object like it does today. Hopefully they are viewed in the same order they are added, otherwise it won't work :)

@PlagueHO PlagueHO added enhancement The issue is an enhancement request. help wanted The issue is up for grabs for anyone in the community. labels Feb 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement The issue is an enhancement request. help wanted The issue is up for grabs for anyone in the community.
Projects
None yet
Development

No branches or pull requests

2 participants