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

Retrieve Test Results #11

Open
soniachan opened this issue Apr 17, 2020 · 2 comments
Open

Retrieve Test Results #11

soniachan opened this issue Apr 17, 2020 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@soniachan
Copy link

How can we retrieve the unit test test results (*.xml)?
There are no test reports in 3_assert folder after test execution.

@Fleid
Copy link
Owner

Fleid commented Apr 21, 2020

Hi @soniachan, at the moment the results are generated as a .txt file in each test case folder.
The file is empty if the test is correct, it will contain the diff between execution and expected otherwise:


InputObject                                   SideIndicator
-----------                                   -------------
    "avg_temperature_t5": 28.8366922041976,   =>
    "avg_temperature_t5": 28.836692209941976, <=

I'm open to generating another format if need be?

@Fleid Fleid self-assigned this Apr 21, 2020
@Fleid Fleid added the enhancement New feature or request label Apr 21, 2020
@soniachan
Copy link
Author

Hi @Fleid

I am looking for ways to display the test case results in bamboo build.
Currently I can only workaround by invoking pester with another powershell script running the unit test. However, test cases are not displayed in bamboo with this approach.

.\runPesterTests.ps1

$files = Get-ChildItem -Path $PSScriptRoot -Include *.Tests -Recurse
foreach ($file in $files) {
    $test_folder = $file.Name
    $pester_xml = ".\$test_folder\test_output_xml.xml"
    $result = Invoke-Pester -Script ".\$test_folder\$test_folder.ps1" -OutputFile $pester_xml -OutputFormat NUnitXml

    if ($result.FailedCount -gt 0) {
        Write-Error "$test_folder $($result.FailedCount) tests did not pass!"
    }
}

$test_folder.ps1

$asaProjectName = "ASAHelloWorld"
$unittestFolder = "$asaProjectName.Tests"

# set solutionPath to hub_realtime_analytics\azure\stream_analytic
$solutionPath = (get-item $PSScriptRoot).parent.fullname

describe 'ASAHelloWorld' {

  it 'unit-test' {
    New-AutProject -installPath $solutionPath\$unittestFolder -verbose
    Start-AutRun -solutionPath $solutionPath -asaProjectName $asaProjectName -verbose
  }

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants