Is there a way to use a cmd or powershell command in the Azure build pipeline
Expected result of the command is:
rerun the failed testcases as a task (cmd or Powershell) in the Azure pipeline and merge the output files (xml) with initial outputxunit.xml and the output2 file.
Yes, instead of one command like you have with piping the input to rebot, you would redirect to a new xml file, and then in another command use it for rebot.
Hi, @HelioGuilherme66@JoostW
Have you manage to fix this ?
Iâve pasted below my pipline.
Doesnât matter what I will write in script bold below I always got the same " â[ ERROR ] Collecting failed tests or tasks from âD:\a\1\s\TestOutput\ers_browser.xmlâ failed: Reading XML source âD:\a\1\s\TestOutput\ers_browser.xmlâ failed: Incompatible root element âtestsuiteââ
Python package
Create and test a Python package on multiple Python versions.
Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more:
cron: 0 9 * * 1-5 # cron syntax defining a schedule
displayName: ERS UI Automated Tests - browser library # friendly name given to a specific schedule
branches:
include: [ ERS ] # which branches the schedule applies to
exclude:
- Geet_Branch
- Iza_branch
- Piotr_Branch
- Tiantian-branch
- ERS_Jose # which branches to exclude from the schedule
- Vehicle_and_BrokenUI # which branches to exclude from the schedule
always: true # whether to always run the pipeline or only if there have bee
jobs:
job: job
timeoutInMinutes: 90 # Sets the execution timeout in Azure to 90 min - maximum is 360 min
pool:
vmImage: âwindows-latestâ
strategy:
matrix:
Python39:
python.version: â3.10â
task: CmdLine@2
inputs:
script: âpip install -r $(build.sourcesdirectory)\packages_browser.txtâ # This line is to
displayName: âInstall Packagesâ
I have for now solution. See the yaml below. Error is : [ ERROR ] Collecting failed tests or tasks from âoutputxunit.xmlâ failed: Reading XML source âoutputxunit.xmlâ failed: No such file or directory
@JoostW Basically what you are trying to tell me that your YAML configuration is still doesnât work, right ?
But instead of one error you are getting another >?
Hi @JoostW
Iâve found answer why we are getting this errors and I repaired my YAML.
There is very simply reason you can not us XUNIT file as you are doing there
-x outputxunit.xml you need to create in first run --output outputxunit.xml instead -x
always use OUTPUT file not Xunit file.
My pipline now works fine
Hi @Piotr, I also found the answer, and the pipeline does what it should do (1st the run, rerun failed TCâs, merge and PublishTestResult), see the example of the yaml below: