Skip to content

Commit

Permalink
[devops] Append to the agent log, instead of creating the file. (#21281)
Browse files Browse the repository at this point in the history
Append to the agent log, instead of creating the file, when an exception occcurs.

The problem is that creating the file fails if it already exists:

    Exception occurred: Exception calling "Parse" with "1" argument(s): "String '' was not recognized as a valid DateTime."
    New-Item: /Users/builder/azdo/_work/4/s/xamarin-macios/tools/devops/automation/scripts/generate_agent_logs.ps1:52
    Line |
      52 |      New-Item -Path $Output -Value "$_"
         |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         | The file '/Users/builder/azdo/_work/4/s/agent-logs.log' already exists.
  • Loading branch information
rolfbjarne committed Sep 20, 2024
1 parent ba954b9 commit 16a6284
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tools/devops/automation/scripts/generate_agent_logs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ try {
log show --predicate $Predicate --style $Style --start "$start" --end "$end" > $Output
}
} catch {
Write-Host "Exception occurred: $_"
# Create the output file, because we later try to upload it as an artifact, and *not* uploading
# if there's *no* file is much harder than just creating the file.
New-Item -Path $Output -Value "$_"
Write-Host "Exception occurred: $_" | Tee-Object -FilePath $Output -Append
}

7 comments on commit 16a6284

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📚 [CI Build] Artifacts 📚

Artifacts were not provided.

Pipeline on Agent
Hash: [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💻 [CI Build] Tests on macOS X64 - Mac Sonoma (14) passed 💻

All tests on macOS X64 - Mac Sonoma (14) passed.

Pipeline on Agent
Hash: 16a6284e589d748b051188283a40bd38d5c24886 [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💻 [CI Build] Tests on macOS M1 - Mac Big Sur (11) passed 💻

All tests on macOS M1 - Mac Big Sur (11) passed.

Pipeline on Agent
Hash: 16a6284e589d748b051188283a40bd38d5c24886 [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💻 [CI Build] Tests on macOS M1 - Mac Ventura (13) passed 💻

All tests on macOS M1 - Mac Ventura (13) passed.

Pipeline on Agent
Hash: 16a6284e589d748b051188283a40bd38d5c24886 [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💻 [CI Build] Tests on macOS M1 - Mac Monterey (12) passed 💻

All tests on macOS M1 - Mac Monterey (12) passed.

Pipeline on Agent
Hash: 16a6284e589d748b051188283a40bd38d5c24886 [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ API diff for current PR / commit

NET (empty diffs)
  • iOS: (empty diff detected)
  • tvOS: (empty diff detected)
  • MacCatalyst: (empty diff detected)
  • macOS: (empty diff detected)

✅ API diff vs stable

.NET (No breaking changes)

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: 16a6284e589d748b051188283a40bd38d5c24886 [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 [CI Build] Test results 🔥

Test results

❌ Tests failed on VSTS: test results

6 tests crashed, 1 tests failed, 33 tests passed.

Failures

❌ introspection tests

🔥 Failed catastrophically on VSTS: test results - introspection (no summary found).

Html Report (VSDrops) Download

❌ linker tests

🔥 Failed catastrophically on VSTS: test results - linker (no summary found).

Html Report (VSDrops) Download

❌ monotouch tests (MacCatalyst)

1 tests failed, 8 tests passed.
  • monotouch-test/Mac Catalyst [dotnet]/Debug (managed static registrar) [dotnet]: Failed (Test run failed.
    Tests run: 3048 Passed: 2869 Inconclusive: 11 Failed: 14 Ignored: 165)

Html Report (VSDrops) Download

❌ monotouch tests (macOS)

🔥 Failed catastrophically on VSTS: test results - monotouch_macos (no summary found).

Html Report (VSDrops) Download

❌ monotouch tests (tvOS)

🔥 Failed catastrophically on VSTS: test results - monotouch_tvos (no summary found).

Html Report (VSDrops) Download

❌ msbuild tests

🔥 Failed catastrophically on VSTS: test results - msbuild (no summary found).

Html Report (VSDrops) Download

❌ xcframework tests

🔥 Failed catastrophically on VSTS: test results - xcframework (no summary found).

Html Report (VSDrops) Download

Successes

✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 1 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 7 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

Pipeline on Agent
Hash: 16a6284e589d748b051188283a40bd38d5c24886 [CI build]

Please sign in to comment.