]> OCCT Git - occt.git/commitdiff
Testing - Marking Win retesting failed #314
authorPasukhin Dmitry <dpasukhi@opencascade.com>
Fri, 31 Jan 2025 23:04:55 +0000 (00:04 +0100)
committerGitHub <noreply@github.com>
Fri, 31 Jan 2025 23:04:55 +0000 (23:04 +0000)
.github/workflows/build-and-test-multiplatform.yml

index 9f3d71d80f7600a76bdbc37acb892e38768ceb23..8c04035a42ccdeff53c785487467240156c046ed 100644 (file)
@@ -596,8 +596,15 @@ jobs:
       if: steps.check_failures.outputs.failed_count > 0
       run: |
         cd install/results/windows-x64-retest
+        $failedCount = 0
         if (Test-Path tests.log) {
-          $failedCount = (Select-String -Path tests.log -Pattern "Total cases:.*FAILED" | ForEach-Object { $_.Matches } | ForEach-Object { $_.Groups[1].Value }) -as [int]
+          $content = Get-Content tests.log
+          $totalLine = $content | Select-String "Total cases:"
+          if ($totalLine) {
+            if ($totalLine -match "FAILED") {
+              $failedCount = ($totalLine | ForEach-Object { $_.Line -replace '.*?(\d+) FAILED.*','$1' }) -as [int]
+            }
+          }
           if ($failedCount -gt 0) {
             Write-Error "Number of FAILED tests ($failedCount) exceeds threshold of 0"
             echo "FAILED_COUNT=$failedCount" >> $env:GITHUB_ENV
@@ -830,8 +837,15 @@ jobs:
       if: steps.check_failures.outputs.failed_count > 0
       run: |
         cd install/results/windows-clang-x64-retest
+        $failedCount = 0
         if (Test-Path tests.log) {
-          $failedCount = (Select-String -Path tests.log -Pattern "Total cases:.*FAILED" | ForEach-Object { $_.Matches } | ForEach-Object { $_.Groups[1].Value }) -as [int]
+          $content = Get-Content tests.log
+          $totalLine = $content | Select-String "Total cases:"
+          if ($totalLine) {
+            if ($totalLine -match "FAILED") {
+              $failedCount = ($totalLine | ForEach-Object { $_.Line -replace '.*?(\d+) FAILED.*','$1' }) -as [int]
+            }
+          }
           if ($failedCount -gt 0) {
             Write-Error "Number of FAILED tests ($failedCount) exceeds threshold of 0"
             echo "FAILED_COUNT=$failedCount" >> $env:GITHUB_ENV