Skip to content

Commit

Permalink
Drop shelljs since it has a security issue (and no update for 6 month…
Browse files Browse the repository at this point in the history
…s). (#264)

* Drop shelljs since it has a security issue (and no update for 6 months).

#1691

* Ignore tensorboard tests (for now) on win32.

* tensorboard and tensorBoard

* Windows cleanup message

* Add issue for reference.
  • Loading branch information
nkreeger authored Jun 25, 2019
1 parent b70ff75 commit 0dd8192
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 30 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
"jasmine": "~3.1.0",
"node-fetch": "^2.3.0",
"nyc": "^13.3.0",
"shelljs": "^0.8.3",
"tmp": "^0.0.33",
"ts-node": "^5.0.1",
"tslint": "~5.9.1",
Expand Down
9 changes: 7 additions & 2 deletions src/run_tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,14 @@ const IGNORE_LIST: string[] = [
'Reduction: argmax test-tensorflow {} 6D, axis=0'
];

// Windows has two failing tests:
// https://github.com/tensorflow/tfjs/issues/598
if (process.platform === 'win32') {
// Ignore tensorboard on windows because tmp folder cleanup used in tests
// fails with tmp folder cleanup:
// https://github.com/tensorflow/tfjs/issues/1692
IGNORE_LIST.push('tensorboard');
IGNORE_LIST.push('tensorBoard');
// Windows has two failing tests:
// https://github.com/tensorflow/tfjs/issues/598
IGNORE_LIST.push('clip test-tensorflow {} propagates NaNs');
IGNORE_LIST.push(
'maxPool test-tensorflow {} [x=[3,3,1] f=[2,2] s=1 ignores NaNs');
Expand Down
16 changes: 10 additions & 6 deletions src/tensorboard_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,27 @@
import {scalar} from '@tensorflow/tfjs';
import * as fs from 'fs';
import * as path from 'path';
import {promisify} from 'util';

import * as tfn from './index';

// tslint:disable-next-line:no-require-imports
const shelljs = require('shelljs');
const rimraf = require('rimraf');
// tslint:disable-next-line:no-require-imports
const tmp = require('tmp');

const rimrafPromise = promisify(rimraf);

describe('tensorboard', () => {
let tmpLogDir: string;

beforeEach(() => {
tmpLogDir = tmp.dirSync().name;
});

afterEach(() => {
afterEach(async () => {
if (tmpLogDir != null) {
shelljs.rm('-rf', tmpLogDir);
await rimrafPromise(tmpLogDir);
}
});

Expand Down Expand Up @@ -130,7 +134,7 @@ describe('tensorboard', () => {
});

it('Writing into existing directory works', () => {
shelljs.mkdir('-p', tmpLogDir);
fs.mkdirSync(tmpLogDir, {recursive: true});
const writer = tfn.node.summaryFileWriter(path.join(tmpLogDir, '22'));
writer.scalar('foo', 42, 0);
writer.flush();
Expand All @@ -151,9 +155,9 @@ describe('tensorBoard callback', () => {
tmpLogDir = tmp.dirSync().name;
});

afterEach(() => {
afterEach(async () => {
if (tmpLogDir != null) {
shelljs.rm('-rf', tmpLogDir);
await rimrafPromise(tmpLogDir);
}
});

Expand Down
21 changes: 0 additions & 21 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -687,11 +687,6 @@ inherits@2:
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=

interpret@^1.0.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.2.0.tgz#d5061a6224be58e8083985f5014d844359576296"
integrity sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw==

invert-kv@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6"
Expand Down Expand Up @@ -1318,13 +1313,6 @@ read-pkg@^3.0.0:
normalize-package-data "^2.3.2"
path-type "^3.0.0"

rechoir@^0.6.2:
version "0.6.2"
resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384"
integrity sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=
dependencies:
resolve "^1.1.6"

release-zalgo@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/release-zalgo/-/release-zalgo-1.0.0.tgz#09700b7e5074329739330e535c5a90fb67851730"
Expand Down Expand Up @@ -1413,15 +1401,6 @@ shebang-regex@^1.0.0:
resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3"
integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=

shelljs@^0.8.3:
version "0.8.3"
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.3.tgz#a7f3319520ebf09ee81275b2368adb286659b097"
integrity sha512-fc0BKlAWiLpwZljmOvAOTE/gXawtCoNrP5oaY7KIaQbbyHeQVg01pSEuEGvGh3HEdBU4baCD7wQBwADmM/7f7A==
dependencies:
glob "^7.0.0"
interpret "^1.0.0"
rechoir "^0.6.2"

signal-exit@^3.0.0, signal-exit@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d"
Expand Down

0 comments on commit 0dd8192

Please sign in to comment.