swiftlang / vscode-swift

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

Add Release Test Run Profiles #856

Closed plemarquand closed 2 weeks ago

plemarquand commented 3 weeks ago

Add two new test run profiles, Run Tests (Release Mode) and Debug Tests (Release Mode). These are identical to their Debug mode counterparts, except they pass -c release during the build.

adam-fowler commented 3 weeks ago

Have you tested these work I thought you needed to also add -Xswiftc -enable-testing to get tests working on release. Maybe that's isn't necessary anymore.

plemarquand commented 3 weeks ago

@adam-fowler these were working for me; tests were being rebuilt and then ran as expected. I’m going to do some more testing though, and also add these profiles to the Test Explorer Integration Tests (if they don’t take too long to run).

fumoboy007 commented 3 weeks ago

I believe -Xswiftc -enable-testing is for @testable import. @plemarquand Did you test that case?

adam-fowler commented 3 weeks ago

@plemarquand When running Debug Tests (Release Mode) the debug config still points to the debug version of the xctest file

adam-fowler commented 3 weeks ago

Looks like this needs to be rebased with main

shahmishal commented 2 weeks ago

@swift-server-bot test this please

shahmishal commented 2 weeks ago

@swift-server-bot test this please

adam-fowler commented 2 weeks ago

Looks like this needs to be rebased with main

Sure you rebased this with the latest from main? Debugging XCTest tests still has the issue with the slash on the end of the test name

shahmishal commented 2 weeks ago

@swift-server-bot test this please

adam-fowler commented 2 weeks ago

@plemarquand Worked out what the issue was. When constructing your TestRunArguments in TestRunner.ts you need to check if testKind is TestKind.debugRelease

plemarquand commented 2 weeks ago

@swift-server-bot test this please

plemarquand commented 2 weeks ago

Looks like the new tests that run tests in release mode take so long to compile they push the 6.0/main builds over the 15 minute timeout. I've marked them with @slow and run the CI runs with the FAST_TEST_RUN env flag turned on. Eventually I'd like to a nightly CI job that runs with FAST_TEST_RUN turned off and with a much higher timeout.