Skip to content

Commit 499f34b

Browse files
committed
function to create packageTestSuites only when needed
1 parent 95dbf77 commit 499f34b

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

script/test

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ for (let testFile of testFiles) {
138138
return coreRenderProcessTestSuites
139139
}
140140

141+
142+
function getPackageTestSuites() {
143+
141144
// Build an array of functions, each running tests for a different bundled package
142145
const packageTestSuites = []
143146
for (let packageName in CONFIG.appMetadata.packageDependencies) {
@@ -200,6 +203,10 @@ for (let packageName in CONFIG.appMetadata.packageDependencies) {
200203
})
201204
}
202205

206+
return packageTestSuites
207+
}
208+
209+
203210
function runBenchmarkTests (callback) {
204211
const benchmarksPath = path.join(CONFIG.repositoryRootPath, 'benchmarks')
205212
const testArguments = ['--benchmark-test', benchmarksPath]
@@ -260,15 +267,15 @@ function requestedTestSuites (platform) {
260267
}
261268

262269
// Package tests
263-
if (packageAll) {
264-
suites.push(...packageTestSuites)
270+
if (packageAll) {
271+
suites.push(...getPackageTestSuites())
265272
} else {
266273
// split
267274
if (packages1) {
268-
suites.push(...packageTestSuites.slice(0, PACKAGES_TO_TEST_IN_PARALLEL))
275+
suites.push(...getPackageTestSuites().slice(0, PACKAGES_TO_TEST_IN_PARALLEL))
269276
}
270277
if (packages2) {
271-
suites.push(...packageTestSuites.slice(PACKAGES_TO_TEST_IN_PARALLEL))
278+
suites.push(...getPackageTestSuites().slice(PACKAGES_TO_TEST_IN_PARALLEL))
272279
}
273280
}
274281

0 commit comments

Comments
 (0)