Adding option to skip main process tests. Cleaning up resources in tests.

This commit is contained in:
Steven Hobson-Campbell 2017-08-22 19:05:12 -07:00
parent 4968a21b82
commit 59f6065e9b
5 changed files with 22 additions and 5 deletions

View File

@ -20,6 +20,7 @@
"legal-eagle": "0.14.0",
"lodash.template": "4.4.0",
"minidump": "0.9.0",
"minimist": "^1.2.0",
"mkdirp": "0.5.1",
"normalize-package-data": "2.3.5",
"npm": "5.3.0",

View File

@ -3,6 +3,7 @@
'use strict'
require('colors')
const argv = require('minimist')(process.argv.slice(2))
const assert = require('assert')
const async = require('async')
const childProcess = require('child_process')
@ -150,17 +151,26 @@ function runBenchmarkTests (callback) {
let testSuitesToRun = testSuitesForPlatform(process.platform)
function testSuitesForPlatform (platform) {
let suites = [];
switch (platform) {
case 'darwin':
return [runCoreMainProcessTests, runCoreRenderProcessTests, runBenchmarkTests].concat(packageTestSuites)
suites = [runCoreMainProcessTests, runCoreRenderProcessTests, runBenchmarkTests].concat(packageTestSuites)
break
case 'win32':
return (process.arch === 'x64') ? [runCoreMainProcessTests, runCoreRenderProcessTests] : [runCoreMainProcessTests]
suites = (process.arch === 'x64') ? [runCoreMainProcessTests, runCoreRenderProcessTests] : [runCoreMainProcessTests]
break
case 'linux':
return [runCoreMainProcessTests]
suites = [runCoreMainProcessTests]
break
default:
console.log(`Unrecognized platform: ${platform}`)
return []
}
if(argv.skipMainProccessTests) {
suites = suites.filter(suite => suite !== runCoreMainProcessTests);
}
return suites;
}
async.series(testSuitesToRun, function (err, exitCodes) {

View File

@ -12,6 +12,9 @@ describe "GitRepositoryProvider", ->
provider = new GitRepositoryProvider(atom.project, atom.config, atom.confirm)
afterEach ->
if provider?
provider.pathToRepository[key].destroy() for key in Object.keys(provider.pathToRepository)
try
temp.cleanupSync()

View File

@ -94,6 +94,8 @@ describe "Project", ->
waitsForPromise ->
atom.workspace.open('a')
notQuittingProject = null
quittingProject = null
bufferA = null
layerA = null
markerA = null
@ -105,12 +107,14 @@ describe "Project", ->
bufferA.append('!')
waitsForPromise ->
notQuittingProject?.destroy()
notQuittingProject = new Project({notificationManager: atom.notifications, packageManager: atom.packages, confirm: atom.confirm})
notQuittingProject.deserialize(atom.project.serialize({isUnloading: false})).then ->
expect(notQuittingProject.getBuffers()[0].getMarkerLayer(layerA.id)?.getMarker(markerA.id)).toBeUndefined()
expect(notQuittingProject.getBuffers()[0].undo()).toBe(false)
waitsForPromise ->
quittingProject?.destroy()
quittingProject = new Project({notificationManager: atom.notifications, packageManager: atom.packages, confirm: atom.confirm})
quittingProject.deserialize(atom.project.serialize({isUnloading: true})).then ->
expect(quittingProject.getBuffers()[0].getMarkerLayer(layerA.id)?.getMarker(markerA.id)).not.toBeUndefined()

View File

@ -40,7 +40,6 @@ PaneContainer = require './pane-container'
PaneAxis = require './pane-axis'
Pane = require './pane'
Dock = require './dock'
Project = require './project'
TextEditor = require './text-editor'
TextBuffer = require 'text-buffer'
Gutter = require './gutter'