note: I'm stuck in an org-centric world, so CircleCI is setup w/my dev sandbox, not scratch orgs.
Recently, I set up a CircleCI build to run my sandbox orgs tests w/RunLocalTests on each pull request. I'm running into problems with tests that don't like to be run in parallel mode. Which is a shame, because 10 minute test runs are far better for my sanity. Fixing the tests is underway, but it looks like a good chunk of them are vendor supplied and make use of Pricebook in a way that is unpleasant for testing.
In CircleCI I have populated "artifacts" with the test run results in json and xml, so my thought is to somehow parse one of those files into a list of test classes to re-run using the sfdx force:apex:test:run command with the --synchronous arg.
Is there a way to easily get the failed tests using sfdx commands, or am I stuck with file reading?
ApexTestResult
andApexTestQueueItem
sObjects. That's not quite what you're asking, but it's easy to script.ApexTestResult
records but an error shown on theApexTestQueueItem
.