-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
actualize current state of the process-rerun
- Loading branch information
1 parent
4d3ebd7
commit e2c80a4
Showing
48 changed files
with
874 additions
and
1,452 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
node_modules | ||
allure-results | ||
package-lock.json | ||
ex.js | ||
spa-report | ||
.idea | ||
playground.* | ||
playground.* | ||
built | ||
coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,7 @@ | ||
a.js | ||
ex.js | ||
tsconfig.json | ||
po | ||
lib | ||
specs | ||
util | ||
config | ||
node_modules | ||
allure-results | ||
protractor.conf.js | ||
package-lock.json | ||
unit_specs | ||
lol.js | ||
coverage | ||
playground.* | ||
tsconfig.json | ||
jest.config.js | ||
readme.md |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = { | ||
preset: 'ts-jest', | ||
testEnvironment: 'node', | ||
testTimeout: 10000 | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import {buildExecRunner} from './execProc' | ||
// import {buildSpawnRunner} from './spawnProc'; | ||
|
||
function buildCommandExecutor(notRetriable, {spawn = false, ...runOpts}) { | ||
return buildExecRunner(notRetriable, runOpts) | ||
// TODO will be implemented | ||
// if (spawn) { | ||
// return buildSpawnRunner(notRetriable, runOpts) | ||
// } else { | ||
// } | ||
} | ||
|
||
export { | ||
buildCommandExecutor | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class ProcessRerunError extends Error { | ||
constructor(type, message) { | ||
super(message); | ||
this.name = `${type}${this.constructor.name}`; | ||
Error.captureStackTrace(this, this.constructor); | ||
} | ||
} | ||
|
||
export { | ||
ProcessRerunError | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import {exec} from 'child_process'; | ||
import {millisecondsToMinutes} from '../utils' | ||
import {logger} from '../logger'; | ||
import {ProcessRerunError} from '../error'; | ||
|
||
function execute(cmd: string, executionHolder: {stackTrace: string}, execOpts = {}, debugProcess) { | ||
const startTime = +Date.now(); | ||
if ((typeof cmd) !== 'string') { | ||
throw new ProcessRerunError('Type', `cmd (first argument should be a string), current type is ${typeof cmd}`); | ||
} | ||
if ((typeof executionHolder) !== 'object') { | ||
throw new ProcessRerunError('Type', `executionHolder (second argument should be an object), current type is ${typeof executionHolder}`); | ||
} | ||
if (executionHolder === null) { | ||
throw new ProcessRerunError('Type', `executionHolder (second argument should be an object), current type is null`); | ||
} | ||
|
||
const execProc = exec(cmd, execOpts, (error, stdout, stderr) => { | ||
|
||
logger.info('___________________________________________________________________________'); | ||
logger.info(`command for process: ${cmd}`); | ||
logger.info(`process duration: ${millisecondsToMinutes(+Date.now() - startTime)}`); | ||
logger.info(`PID: ${execProc.pid}`); | ||
logger.info(`stdout: ${stdout}`); | ||
if (stderr) logger.error(`stderr: ${stderr}`); | ||
if (error) logger.error(`error: ${error}`); | ||
logger.info('___________________________________________________________________________'); | ||
|
||
executionHolder.stackTrace += `${stdout}${stderr}`; | ||
}); | ||
|
||
return execProc; | ||
} | ||
|
||
export { | ||
execute | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.