swiftlang / vscode-swift

Visual Studio Code Extension for Swift
https://marketplace.visualstudio.com/items?itemName=sswg.swift-lang
Apache License 2.0
708 stars 47 forks source link

TestExplorer should not be triggering builds using SwiftExecOperation #808

Closed adam-fowler closed 1 month ago

adam-fowler commented 1 month ago

If the test list fails then a build is triggered. We can't use SwiftExecOperation for builds they can be long operations. Using SwiftExecOperation means you can't see the result of the build, it is a long process you have no control over.

Use this instead

// get buildall task and execute it
const backgroundTask = await getBuildAllTask(this.folderContext);
if (!backgroundTask) {
    return;
}
try {
    await this.folderContext.taskQueue.queueOperation(new TaskOperation(backgroundTask));
} catch {
    // can ignore if running task fails
}