You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Attach the build transcript and path to the build description to the test at the end of BuildOperationTester.checkBuild().
We can do this now that Swift Testing support attachments.
Also give callers of checkBuild() the opportunity to opt out of adding these attachments, and have BuildTaskBehaviorTests.stressConcurrentCancellation() do so, as its particular nature can sometimes crash the tests when adding attachments.
@@ -1476,19 +1480,14 @@ package final class BuildOperationTester {
1476
1480
// Check the results.
1477
1481
letresults=tryBuildResults(core: core, workspace: workspace, buildDescriptionResults: results, tasksByTaskIdentifier: delegate.tasksByTaskIdentifier.merging(delegate.dynamicTasksByTaskIdentifier, uniquingKeysWith:{ a, b in a }), fs: fs, events: events, dynamicTaskDependencies: dynamicDependencies, buildDatabasePath: persistent ? results.buildDescription.buildDatabasePath :nil)
1478
1482
1479
-
/*@MainActor func addAttachments() {
1480
-
// TODO: This `runActivity` call should be wider in scope, but this would significantly complicate the code flow due to threading requirements without having async/await.
// TODO: <rdar://59432231> Longer term, we should find a way to share code with CoreQualificationTester, which has a number of APIs for emitting build operation debug info.
// TODO: <rdar://59432231> Longer term, we should find a way to share code with CoreQualificationTester, which has a number of APIs for emitting build operation debug info.
1484
+
if attachBuildArifacts {
1485
+
Attachment.record(results.buildTranscript, named:"Build Transcript"+(name.map({" for Build Operation \"\($0)\""})??""))
1486
+
if localFS.exists(results.buildDescription.packagePath){
1487
+
Attachment.record(results.buildDescription.packagePath.str, named:"Build Description"+(name.map({" for Build Operation \"\($0)\""})??""))
// The threads this test spawns to run the build can outlive the lifetime of the test itself, so it passed attachBuildArifacts = false since if that happens then the test might crash because the reporter needed to add the attachments will no longer exist.
0 commit comments