File tree Expand file tree Collapse file tree 4 files changed +25
-1
lines changed Expand file tree Collapse file tree 4 files changed +25
-1
lines changed Original file line number Diff line number Diff line change 45
45
46
46
tests :
47
47
name : ${{ contains(github.event.pull_request.labels.*.name, 'full-test-run') && 'Full Test Run' || 'Test'}}
48
+ needs : package
48
49
uses : swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
49
50
with :
51
+ needs_token : true
50
52
# Linux
51
53
linux_exclude_swift_versions : ' [{"swift_version": "nightly-6.1"},{"swift_version": "nightly-6.2"},{"swift_version": "nightly-main"}]'
52
54
linux_env_vars : |
@@ -55,13 +57,18 @@ jobs:
55
57
NVM_DIR=/usr/local/nvm
56
58
CI=1
57
59
FAST_TEST_RUN=${{ contains(github.event.pull_request.labels.*.name, 'full-test-run') && '0' || '1'}}
60
+ VSCODE_SWIFT_VSIX_ID=${{needs.package.outputs.artifact-id}}
61
+ GITHUB_REPOSITORY=${{github.repository}}
58
62
linux_pre_build_command : . .github/workflows/scripts/setup-linux.sh
59
63
linux_build_command : ./scripts/test.sh
60
64
# Windows
61
65
windows_exclude_swift_versions : ' [{"swift_version": "nightly-6.1"},{"swift_version": "nightly-6.2"},{"swift_version": "nightly"}]'
62
66
windows_env_vars : |
63
67
CI=1
64
68
FAST_TEST_RUN=${{ contains(github.event.pull_request.labels.*.name, 'full-test-run') && '0' || '1'}}
69
+ VSCODE_SWIFT_VSIX_ID=${{needs.package.outputs.artifact-id}}
70
+ VSCODE_SWIFT_VSIX=vscode-swift.vsix
71
+ GITHUB_REPOSITORY=${{github.repository}}
65
72
windows_pre_build_command : .github\workflows\scripts\windows\setup.ps1
66
73
windows_build_command : scripts\test_windows.ps1
67
74
enable_windows_docker : false
Original file line number Diff line number Diff line change @@ -70,6 +70,9 @@ module.exports = defineConfig({
70
70
extensionDevelopmentPath : vsixPath
71
71
? [ `${ __dirname } /.vscode-test/extensions/${ publisher } .${ name } -${ version } ` ]
72
72
: undefined ,
73
+ env : {
74
+ VSCODE_TEST : "1" ,
75
+ } ,
73
76
mocha : {
74
77
ui : "tdd" ,
75
78
color : true ,
@@ -106,6 +109,9 @@ module.exports = defineConfig({
106
109
extensionDevelopmentPath : vsixPath
107
110
? [ `${ __dirname } /.vscode-test/extensions/${ publisher } .${ name } -${ version } ` ]
108
111
: undefined ,
112
+ env : {
113
+ VSCODE_TEST : "1" ,
114
+ } ,
109
115
mocha : {
110
116
ui : "tdd" ,
111
117
color : true ,
@@ -130,6 +136,9 @@ module.exports = defineConfig({
130
136
files : [ "dist/test/common.js" , "dist/test/unit-tests/**/*.test.js" ] ,
131
137
version : process . env [ "VSCODE_VERSION" ] ?? "stable" ,
132
138
launchArgs : launchArgs . concat ( "--disable-extensions" ) ,
139
+ env : {
140
+ VSCODE_TEST : "1" ,
141
+ } ,
133
142
mocha : {
134
143
ui : "tdd" ,
135
144
color : true ,
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ import {
23
23
execFile ,
24
24
getErrorDescription ,
25
25
IS_PRODUCTION_BUILD ,
26
+ IS_RUNNING_UNDER_TEST ,
26
27
} from "../utilities/utilities" ;
27
28
import { createSwiftTask } from "../tasks/SwiftTaskProvider" ;
28
29
import configuration from "../configuration" ;
@@ -244,7 +245,7 @@ export class TestRunProxy {
244
245
}
245
246
246
247
private clearEnqueuedTest ( test : vscode . TestItem ) {
247
- if ( IS_PRODUCTION_BUILD ) {
248
+ if ( IS_PRODUCTION_BUILD && ! IS_RUNNING_UNDER_TEST ) {
248
249
// `runState.enqueued` exists only for test validation purposes.
249
250
return ;
250
251
}
Original file line number Diff line number Diff line change @@ -36,6 +36,13 @@ export const IS_PRODUCTION_BUILD = process.env.NODE_ENV === "production";
36
36
*/
37
37
export const IS_RUNNING_IN_CI = process . env . CI === "1" ;
38
38
39
+ /**
40
+ * Whether or not the code is being run as part of a test suite.
41
+ *
42
+ * This will NOT be removed when the extension is packaged into a VSIX.
43
+ */
44
+ export const IS_RUNNING_UNDER_TEST = process . env . VSCODE_TEST === "1" ;
45
+
39
46
/**
40
47
* Get required environment variable for Swift product
41
48
*
You can’t perform that action at this time.
0 commit comments