Closed lvanvugt closed 2 years ago
Note that BcContainerHelper cmdlet Run-TestsInBcContainer allows you to append to the TestResults.xml created by a previous call to the same cmdlet.
@AdminHodor, I am wondering why there is no response yet. I might be not clear enough. If so, let me know.
I did respond through mail (with Freddy).
But forgot to flip the switch to "part of upcoming release" - it's been on the roadmap since last week .. but didn't update the status ;-).
You might want to include that discussion here as a (first kind of) documentation.
@waldo1001 any update on this?
As you noticed, we have not the ability to have multiple test runs, which "aggregates" in one output in DevOps.
Do we assume right that this is enough? Is there any reason why they should be joined?
Do we assume right that this is enough?
Maybe I misunderstand this question, but my answer now is: no, as it is not enough. That's the basis to this issue.
Is there any reason why they should be joined?
To have one result telling me that a collection of tests are successful and not each individual test app.
But for now we might just park this as MS test collateral is not able to be run easily in one stretch.
Thing is, the entire testability-framework is getting an overhaul. I'd want to limit unnecessary investment, if you know what I mean ;-). If you're ok to close this issue, I'm more than ok as well ;-)
Any progress on this?
Well, MS is very quiet on anything Testability-related changes. It seems that the big overhaul isn't that big after all, and I don't know what to expect in terms of this.. .
I'll put it back on the list, since the only info that I got of changing test-behavior was NOT in terms of "running tests" from powershell.
Any progress on this?
None at all. As this was agreed to be low prio, we tend to focus on other things.
Can you explain a business case on how this would benefit us? We simply never concatenate, and still have all tests available in our pipelines output.. ?
Business case: running different tests apps in one pipeline one after the other not loading the test of all apps into one suite. This way you have a better overview in which test a a failure happens. The tests results tab in the pipeline portal does not give me that insight. In between the different test runs I would also be able to remove the previous run test app and install the next one.
@waldo1001, this issue has now become more important. Have a look here: https://github.com/PacktPublishing/Automated-Testing-in-Microsoft-Dynamics-365-Business-Central-Second-Edition/issues/16#issuecomment-1138298015.
I'm trying to see why this is now more important, Luc .. .
Here is an example of running tests of 41 apps, with an out-of-the-devops-box "aggregated" result:
or including succeeded tests:
Can you please explain what data I'm missing in this overview?
The more important is related to that I am now in need of getting the results aggregated.
Nevertheless, how do you get your results aggregated. Apparently (seeing the screenshots above and looking great) you have a way, right? So, what should I do to achieve this?
We're not doing anything special, simply:
- And after each run, publish the testresult (probably that's the "tip" to make this work):
Simplicity counts. I guess I am to "intelligent" for that. LOL
Let me know if this works for you ;-)
Meanwhile found a solution to merge the multiple test result xml files into one and publish that alone. Works like a charm (too).
- task: ALOpsAppTest@1
displayName: 'ALOPS - Run TestSuite 1
inputs:
...
resultfilename: 'TestResults1.xml'
continueOnError: true
- task: ALOpsAppTest@1
displayName: 'ALOPS - Run TestSuite 2'
inputs:
...
resultfilename: 'TestResults2.xml'
continueOnError: true
- task: PowerShell@2
displayName: 'Merge test Results'
inputs:
targetType: 'inline'
script: |
$TestResults1 = [xml](Get-Content -Path $(Build.SourcesDirectory)/TestResults1.xml)
$TestResults2 = [xml](Get-Content -Path $(Build.SourcesDirectory)/TestResults2.xml)
$TestResults2.DocumentElement.ChildNodes | ForEach-Object { $TestResults1.DocumentElement.AppendChild($TestResults1.ImportNode($_, $true)) | Out-Null }
Set-Content -Path $(Build.SourcesDirectory)/TestResults.xml -Value ($TestResults1.OuterXml)
- task: PublishTestResults@2
displayName: 'Publish Test Results **/TestResults.xml'
inputs:
testResultsFormat: XUnit
testResultsFiles: '**/TestResults.xml'
failTaskOnFailedTests: true
testRunTitle: 'BC Test Results: $(Build.BuildId)'
Let me know if this works for you ;-)
Will keep that in mind. Does not meet my requirements right now. Will, however, close the issue.
In issue #310 I asked
Due to that question and the discussion following it, you have added a new feature to ALOps (in upcoming release). As you can read there new info from MS made clear this will probably not going to work right. MS has bucketed there test runs, meaning that most tests are run in different buckets/runs. It's similar (not the same) to what I have done on my TestFixtureInitializer project. In the latter project each MS test app has it's own bucket (i.e. build pipeline); 31 at this very moment. Now, I wanted to experiment to see if I could enlarge my buckets by combining a number of test apps into one pipeline, even though each test app tests will be run in it's own AL Test Tool test suite. See the pipeline yaml below, where each test app test run will be triggered by a dedicated ALOpsAppTest step (in case of this pipeline three times the ALOpsAppTest step). Test are indeed executed, but the resulting TestResults.xml fetched and published by the PublishTestResults step does only contain the results of the last test run.
Question
Is there a way to combine the test results of all ALOpsAppTest steps into one TestResults.xml?
the used yaml
Additional discussion I reckon the feature you have added because of #310 will allow me to get this done too, but if the above way also works I could be able to combine different bucket runs with clean docker containers consecutively (in one pipeline) and aggregate the results.