Skip to content

Commit 24504c8

Browse files
authored
Merge pull request #96 from atom-ide-community/test-performance
2 parents 3ab703b + 499f34b commit 24504c8

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

script/test

+20-8
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ function runCoreMainProcessTests (callback) {
102102
cp.on('close', exitCode => { callback(null, {exitCode, step: 'core-main-process', testCommand: `You can run the test again using: \n\t ${executablePath} ${testArguments.join(' ')}`}) })
103103
}
104104

105+
function getCoreRenderProcessTestSuites() {
106+
105107
// Build an array of functions, each running tests for a different rendering test
106108
const coreRenderProcessTestSuites = []
107109
const testPath = path.join(CONFIG.repositoryRootPath, 'spec')
@@ -133,6 +135,12 @@ for (let testFile of testFiles) {
133135
})
134136
}
135137

138+
return coreRenderProcessTestSuites
139+
}
140+
141+
142+
function getPackageTestSuites() {
143+
136144
// Build an array of functions, each running tests for a different bundled package
137145
const packageTestSuites = []
138146
for (let packageName in CONFIG.appMetadata.packageDependencies) {
@@ -195,6 +203,10 @@ for (let packageName in CONFIG.appMetadata.packageDependencies) {
195203
})
196204
}
197205

206+
return packageTestSuites
207+
}
208+
209+
198210
function runBenchmarkTests (callback) {
199211
const benchmarksPath = path.join(CONFIG.repositoryRootPath, 'benchmarks')
200212
const testArguments = ['--benchmark-test', benchmarksPath]
@@ -231,7 +243,7 @@ function requestedTestSuites (platform) {
231243
let suites = []
232244
// Core tess
233245
if (coreAll) {
234-
suites.push(...[runCoreMainProcessTests, ...coreRenderProcessTestSuites])
246+
suites.push(...[runCoreMainProcessTests, ...getCoreRenderProcessTestSuites()])
235247
} else {
236248

237249
// Core main tests
@@ -241,29 +253,29 @@ function requestedTestSuites (platform) {
241253

242254
// Core renderer tests
243255
if (coreRenderer) {
244-
suites.push(...coreRenderProcessTestSuites)
256+
suites.push(...getCoreRenderProcessTestSuites())
245257
} else {
246258
// split
247259
if (coreRenderer1) {
248-
suites.push(...coreRenderProcessTestSuites.slice(0, CORE_RENDER_TO_TEST_IN_PARALLEL))
260+
suites.push(...getCoreRenderProcessTestSuites().slice(0, CORE_RENDER_TO_TEST_IN_PARALLEL))
249261
}
250262
if (coreRenderer2) {
251-
suites.push(...coreRenderProcessTestSuites.slice(CORE_RENDER_TO_TEST_IN_PARALLEL))
263+
suites.push(...getCoreRenderProcessTestSuites().slice(CORE_RENDER_TO_TEST_IN_PARALLEL))
252264
}
253265
}
254266

255267
}
256268

257269
// Package tests
258-
if (packageAll) {
259-
suites.push(...packageTestSuites)
270+
if (packageAll) {
271+
suites.push(...getPackageTestSuites())
260272
} else {
261273
// split
262274
if (packages1) {
263-
suites.push(...packageTestSuites.slice(0, PACKAGES_TO_TEST_IN_PARALLEL))
275+
suites.push(...getPackageTestSuites().slice(0, PACKAGES_TO_TEST_IN_PARALLEL))
264276
}
265277
if (packages2) {
266-
suites.push(...packageTestSuites.slice(PACKAGES_TO_TEST_IN_PARALLEL))
278+
suites.push(...getPackageTestSuites().slice(PACKAGES_TO_TEST_IN_PARALLEL))
267279
}
268280
}
269281

0 commit comments

Comments
 (0)