gemini-gui
Advanced tools
Comparing version 5.0.2 to 5.1.0
@@ -221,3 +221,4 @@ 'use strict'; | ||
const srcPath = path.resolve(this._reusePath, srcRelPath); | ||
return fs.copyAsync(srcPath, dstPath); | ||
// it is ok that image can be defunct | ||
return fs.copyAsync(srcPath, dstPath).catch(() => {}); | ||
} | ||
@@ -224,0 +225,0 @@ |
@@ -19,3 +19,3 @@ 'use strict'; | ||
.option('-p, --port <port>', 'Port to launch server on', 8000) | ||
.option('-h, --hostname <hostname>', 'Hostname to launch server on', 'localhost') | ||
.option('--hostname <hostname>', 'Hostname to launch server on', 'localhost') | ||
.option('-c, --config <file>', 'Gemini config file', path.resolve, '') | ||
@@ -22,0 +22,0 @@ .option('-g, --grep <pattern>', 'run only suites matching the pattern', RegExp) |
'use strict'; | ||
var SuiteControls = require('./suite-controls'), | ||
utils = require('../utils'), | ||
utils = require('../client-utils'), | ||
successTemplate = require('../views/partials/success-result.hbs'), | ||
@@ -96,2 +96,10 @@ failTemplate = require('../views/partials/fail-result.hbs'), | ||
this.domNode.classList.remove('section_collapsed'); | ||
var lazyImageNodes = this.domNode.querySelectorAll('.image-box__image-lazy'); | ||
if (lazyImageNodes.length) { | ||
lazyImageNodes.forEach(function(imageNode) { | ||
imageNode.setAttribute('src', imageNode.getAttribute('data-src')); | ||
imageNode.classList.remove('.image-box__image-lazy'); | ||
}); | ||
} | ||
}, | ||
@@ -104,3 +112,6 @@ | ||
toggle: function() { | ||
this.domNode.classList.toggle('section_collapsed'); | ||
if (this.domNode.classList.contains('section_collapsed')) { | ||
return this.expand(); | ||
} | ||
this.collapse(); | ||
}, | ||
@@ -107,0 +118,0 @@ |
@@ -11,3 +11,3 @@ 'use strict'; | ||
const extract = utils.decompress; | ||
const ReuseError = utils.Error; | ||
const ReuseError = utils.ExtendableError; | ||
@@ -21,11 +21,9 @@ const downloadReport = (reuseUrl, timeout) => { | ||
.load() | ||
.then(() => extract({source: archivePath, destination: tempDir})) | ||
.then(() => extract(archivePath, tempDir)) | ||
// tempDir at this moment contains only report archive and unpacked report in some directory | ||
.then(() => { | ||
const reportDirName = fs.readdirSync(tempDir) | ||
.find((f) => fs.statSync(path.resolve(tempDir, f)).isDirectory()); | ||
.filter((f) => fs.statSync(path.resolve(tempDir, f)).isDirectory())[0]; | ||
return path.resolve(tempDir, reportDirName); | ||
}) | ||
.catch((e) => { | ||
throw new ReuseError(`Failed to reuse report from ${reuseUrl}`, e); | ||
}); | ||
@@ -46,10 +44,15 @@ }; | ||
return prepareReport(urlOrPath, timeout) | ||
.then((report) => { | ||
try { | ||
const data = require(path.resolve(report, 'data')); | ||
return {data, report}; | ||
} catch (e) { | ||
throw new ReuseError(`Nothing to reuse in ${report}`, e); | ||
.then( | ||
(report) => { | ||
try { | ||
const data = require(path.resolve(report, 'data')); | ||
return {data, report}; | ||
} catch (e) { | ||
throw new ReuseError(`Nothing to reuse in ${report}`, e); | ||
} | ||
}, | ||
(e) => { | ||
throw new ReuseError(`Failed to reuse report from ${urlOrPath}`, e); | ||
} | ||
}); | ||
); | ||
}; |
@@ -102,3 +102,7 @@ 'use strict'; | ||
}; | ||
}) | ||
.catch(e => { | ||
console.error(e); | ||
process.exit(1); | ||
}); | ||
}; |
@@ -6,3 +6,3 @@ 'use strict'; | ||
const Index = require('./common/tests-index'); | ||
const utils = require('./utils'); | ||
const clientUtils = require('./client-utils'); | ||
@@ -76,3 +76,3 @@ const getStatus = (skipped, reuse) => { | ||
const data = {suite, children, states, status}; | ||
data.suite.skipComment && (data.suite.skipComment = utils.wrapLinkByTag(data.suite.skipComment)); | ||
data.suite.skipComment && (data.suite.skipComment = clientUtils.wrapLinkByTag(data.suite.skipComment)); | ||
@@ -105,7 +105,11 @@ this._index.add(data); | ||
const metaInfoObj = Object.assign( | ||
{}, | ||
state.metaInfo, | ||
reuse && reuse.result.metaInfo && JSON.parse(reuse.result.metaInfo) | ||
); | ||
let extraMeta = {}; | ||
if (reuse && reuse.result.metaInfo) { | ||
try { | ||
extraMeta = JSON.parse(reuse.result.metaInfo); | ||
// eslint-disable-next-line no-empty | ||
} catch (e) {} | ||
} | ||
const metaInfoObj = Object.assign({}, state.metaInfo, extraMeta); | ||
const metaInfo = !_.isEmpty(metaInfoObj) | ||
@@ -118,7 +122,12 @@ ? JSON.stringify(metaInfoObj, null, 4) | ||
// if status is 'success' then actualPath is present, but there is no image | ||
const currentPath = reuse && reuse.result.actualPath && status !== 'success' | ||
&& this._app.createCurrentPathFor(); | ||
const diffPath = reuse && reuse.result.diffPath && this._app.createDiffPathFor(); | ||
const reuseResult = reuse && reuse.result; | ||
let currentPath; | ||
let diffPath; | ||
if (reuseResult) { | ||
// if status is 'success' then actualPath is present, but there is no image | ||
currentPath = reuseResult.actualPath && status !== 'success' && this._app.createCurrentPathFor(); | ||
diffPath = reuseResult.diffPath && this._app.createDiffPathFor(); | ||
} | ||
const copyImagePromises = [ | ||
@@ -125,0 +134,0 @@ currentPath ? this._app.copyImage(reuse.result.actualPath, currentPath) : Promise.resolve(), |
'use strict'; | ||
const fs = require('fs'); | ||
const zlib = require('zlib'); | ||
const Promise = require('bluebird'); | ||
const format = require('util').format; | ||
const tar = require('tar-fs'); | ||
exports.decompress = Promise.promisify(require('node-targz').decompress); | ||
// this code is executed on client side, so we can not use features from es5 | ||
exports.wrapLinkByTag = function(text) { | ||
return text.replace(/https?:\/\/[^\s]*/g, function(url) { | ||
return format('<a target="_blank" href="%s">%s</a>', url, url); | ||
exports.decompress = function(source, destination) { | ||
return new Promise((resolve, reject) => { | ||
fs.createReadStream(source) | ||
.on('error', reject) | ||
.pipe(zlib.createGunzip()) | ||
.on('error', reject) | ||
.pipe(tar.extract(destination)) | ||
.on('error', reject) | ||
.on('finish', resolve); | ||
}); | ||
}; | ||
exports.Error = function(message, cause) { | ||
this.message = message; | ||
Error.captureStackTrace(this, this.constructor); | ||
if (cause && cause.stack) { | ||
this.stack = this.stack.concat('\n\nCaused by:\n' + cause.stack); | ||
class ExtendableError extends Error { | ||
constructor(message, cause) { | ||
super(); | ||
this.message = message; | ||
Error.captureStackTrace(this, this.constructor); | ||
if (cause && cause.stack) { | ||
this.stack = this.stack.concat('\n\nCaused by:\n' + cause.stack); | ||
} | ||
} | ||
}; | ||
} | ||
exports.ExtendableError = ExtendableError; |
{ | ||
"name": "gemini-gui", | ||
"version": "5.0.2", | ||
"version": "5.1.0", | ||
"description": "GUI for gemini testing utility", | ||
@@ -28,6 +28,5 @@ "main": "lib/index.js", | ||
"inherit": "^2.2.3", | ||
"json-stringify-safe": "^5.0.1", | ||
"large-download": "^0.1.0", | ||
"json-stringify-safe": "^5.0.1", | ||
"lodash": "^3.10.1", | ||
"node-targz": "^0.2.0", | ||
"opener": "^1.4.0", | ||
@@ -37,2 +36,3 @@ "resolve": "^1.0.0", | ||
"shelljs": "^0.6.0", | ||
"tar-fs": "^1.16.0", | ||
"temp": "^0.8.1" | ||
@@ -39,0 +39,0 @@ }, |
@@ -34,3 +34,3 @@ # Gemini GUI | ||
* `--port`, `-p` - specify port to run `GUI` backend on. | ||
* `--hostname`, `-h` - specify hostname to run `GUI` backend on. | ||
* `--hostname` - specify hostname to run `GUI` backend on. | ||
* `--root-url`, `-r` - use specified URL, instead of `rootUrl` setting from config file. | ||
@@ -37,0 +37,0 @@ * `--grid-url` - use specified URL, instead of `gridUrl` setting from config file. |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
43
9
937750
2237
1
+ Addedtar-fs@^1.16.0
- Removednode-targz@^0.2.0
- Removednode-targz@0.2.0(transitive)