From 2bb2962fb64d30e6250633f13ee6f9a9fbebb8f0 Mon Sep 17 00:00:00 2001 From: Akshita Agarwal Date: Mon, 26 Mar 2018 11:41:39 -0700 Subject: [PATCH 01/23] Creating a new eventStream --- gulpfile.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gulpfile.js b/gulpfile.js index dd2b06202..de6c6cf83 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -20,7 +20,9 @@ const util = require('./out/src/common'); const child_process = require('child_process'); const optionsSchemaGenerator = require('./out/src/tools/GenerateOptionsSchema'); const packageDependencyUpdater = require('./out/src/tools/UpdatePackageDependencies'); +const eventStream = require('./src/EventStream'); +const EventStream = eventStream.EventStream; const Logger = logger.Logger; const PackageManager = packages.PackageManager; const LinuxDistribution = platform.LinuxDistribution; @@ -51,6 +53,7 @@ gulp.task('updatePackageDependencies', () => { // Install Tasks function install(platformInfo, packageJSON) { const packageManager = new PackageManager(platformInfo, packageJSON); + let eventStream = new EventStream(); const logger = new Logger(message => process.stdout.write(message)); const debuggerUtil = new debugUtil.CoreClrDebugUtil(path.resolve('.'), logger); From e829569ba592e0e0a7e5efe031e7f261354f0758 Mon Sep 17 00:00:00 2001 From: Akshita Agarwal Date: Mon, 26 Mar 2018 12:48:03 -0700 Subject: [PATCH 02/23] fixed --- gulpfile.js | 12 ++++++++---- src/observers/BaseLoggerObserver.ts | 9 +++++++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index de6c6cf83..fa822996a 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -20,13 +20,15 @@ const util = require('./out/src/common'); const child_process = require('child_process'); const optionsSchemaGenerator = require('./out/src/tools/GenerateOptionsSchema'); const packageDependencyUpdater = require('./out/src/tools/UpdatePackageDependencies'); -const eventStream = require('./src/EventStream'); +const eventStream = require('./out/src/EventStream'); +const csharpLoggerObserver = require('./out/src/observers/CsharpLoggerObserver'); const EventStream = eventStream.EventStream; const Logger = logger.Logger; const PackageManager = packages.PackageManager; const LinuxDistribution = platform.LinuxDistribution; const PlatformInformation = platform.PlatformInformation; +const CsharpLoggerObserver = csharpLoggerObserver.CsharpLoggerObserver; function cleanSync(deleteVsix) { del.sync('install.*'); @@ -55,11 +57,13 @@ function install(platformInfo, packageJSON) { const packageManager = new PackageManager(platformInfo, packageJSON); let eventStream = new EventStream(); const logger = new Logger(message => process.stdout.write(message)); + let stdoutObserver = new CsharpLoggerObserver(logger); + eventStream.subscribe(stdoutObserver.post); const debuggerUtil = new debugUtil.CoreClrDebugUtil(path.resolve('.'), logger); - return packageManager.DownloadPackages(logger) + return packageManager.DownloadPackages(eventStream) .then(() => { - return packageManager.InstallPackages(logger); + return packageManager.InstallPackages(eventStream); }) .then(() => { return util.touchInstallFile(util.InstallFileType.Lock) @@ -98,7 +102,7 @@ function doPackageSync(packageName) { function doOfflinePackage(platformInfo, packageName, packageJSON) { if (process.platform === 'win32') { - throw new Error('Do not build offline packages on windows. Runtime executables will not be marked executable in *nix packages.'); + //throw new Error('Do not build offline packages on windows. Runtime executables will not be marked executable in *nix packages.'); } cleanSync(false); diff --git a/src/observers/BaseLoggerObserver.ts b/src/observers/BaseLoggerObserver.ts index b68614b30..d40a4c80b 100644 --- a/src/observers/BaseLoggerObserver.ts +++ b/src/observers/BaseLoggerObserver.ts @@ -9,8 +9,13 @@ import { BaseEvent } from '../omnisharp/loggingEvents'; export abstract class BaseLoggerObserver { public logger: Logger; - constructor(channel: vscode.OutputChannel) { - this.logger = new Logger((message) => channel.append(message)); + constructor(channel: vscode.OutputChannel | Logger) { + if (channel instanceof Logger) { + this.logger = channel as Logger; + } + else { + this.logger = new Logger((message) => channel.append(message)); + } } abstract post: (event: BaseEvent) => void; From a3199f595bcd8f054cb9889d120c63d831c9cded Mon Sep 17 00:00:00 2001 From: Akshita Agarwal Date: Mon, 26 Mar 2018 14:59:29 -0700 Subject: [PATCH 03/23] removeComment --- gulpfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index fa822996a..03aba1cc0 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -102,7 +102,7 @@ function doPackageSync(packageName) { function doOfflinePackage(platformInfo, packageName, packageJSON) { if (process.platform === 'win32') { - //throw new Error('Do not build offline packages on windows. Runtime executables will not be marked executable in *nix packages.'); + throw new Error('Do not build offline packages on windows. Runtime executables will not be marked executable in *nix packages.'); } cleanSync(false); From 40557400a85890ad81db484569ff1baf1b152919 Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 29 Mar 2018 11:40:56 -0700 Subject: [PATCH 04/23] Invoke the node command --- package-lock.json | 118 ++++++++++++++++----- test/releaseTests/offlinePackage.test.ts | 24 +++++ test/releaseTests/testAssets/testAssets.ts | 18 ++++ 3 files changed, 134 insertions(+), 26 deletions(-) create mode 100644 test/releaseTests/offlinePackage.test.ts create mode 100644 test/releaseTests/testAssets/testAssets.ts diff --git a/package-lock.json b/package-lock.json index 30df8c9e8..9c4a8fd1f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "csharp", - "version": "1.15.0-beta3", + "version": "1.15.0-beta4", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -238,7 +238,8 @@ "abbrev": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", - "integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU=" + "integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU=", + "dev": true }, "agent-base": { "version": "4.1.2", @@ -264,6 +265,7 @@ "version": "0.1.4", "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", + "dev": true, "requires": { "kind-of": "3.2.2", "longest": "1.0.1", @@ -273,7 +275,8 @@ "amdefine": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", - "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=" + "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", + "dev": true }, "ansi-colors": { "version": "1.1.0", @@ -349,6 +352,7 @@ "version": "1.0.9", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.9.tgz", "integrity": "sha1-c9g7wmP4bpf4zE9rrhsOkKfSLIY=", + "dev": true, "requires": { "sprintf-js": "1.0.3" } @@ -480,7 +484,8 @@ "async": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "dev": true }, "async-arrays": { "version": "1.0.1", @@ -561,7 +566,8 @@ "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true }, "base64-js": { "version": "1.2.3", @@ -622,6 +628,7 @@ "version": "1.1.8", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", + "dev": true, "requires": { "balanced-match": "1.0.0", "concat-map": "0.0.1" @@ -677,6 +684,7 @@ "version": "0.1.3", "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", + "dev": true, "optional": true, "requires": { "align-text": "0.1.4", @@ -994,7 +1002,8 @@ "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true }, "convert-source-map": { "version": "1.5.1", @@ -1221,7 +1230,8 @@ "decamelize": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true }, "deep-assign": { "version": "1.0.0", @@ -1244,7 +1254,8 @@ "deep-is": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=" + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true }, "defaults": { "version": "1.0.3", @@ -1534,6 +1545,7 @@ "version": "1.8.1", "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.8.1.tgz", "integrity": "sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg=", + "dev": true, "requires": { "esprima": "2.7.3", "estraverse": "1.9.3", @@ -1546,6 +1558,7 @@ "version": "0.2.0", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.2.0.tgz", "integrity": "sha1-2rc/vPwrqBm03gO9b26qSBZLP50=", + "dev": true, "optional": true, "requires": { "amdefine": "1.0.1" @@ -1556,17 +1569,20 @@ "esprima": { "version": "2.7.3", "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", - "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=" + "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", + "dev": true }, "estraverse": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz", - "integrity": "sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q=" + "integrity": "sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q=", + "dev": true }, "esutils": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=" + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true }, "event-stream": { "version": "3.3.4", @@ -1705,7 +1721,8 @@ "fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=" + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true }, "fd-slicer": { "version": "1.0.1", @@ -2008,6 +2025,15 @@ "is-glob": "2.0.1" } }, + "glob-promise": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/glob-promise/-/glob-promise-3.4.0.tgz", + "integrity": "sha512-q08RJ6O+eJn+dVanerAndJwIcumgbDdYiUT7zFQl3Wm1xD6fBKtah7H8ZJChj4wP+8C+QfeVy8xautR7rdmKEw==", + "dev": true, + "requires": { + "@types/glob": "5.0.35" + } + }, "glob-stream": { "version": "3.1.18", "resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-3.1.18.tgz", @@ -3158,6 +3184,7 @@ "version": "4.0.11", "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.11.tgz", "integrity": "sha1-Ywo13+ApS8KB7a5v/F0yn8eYLcw=", + "dev": true, "requires": { "async": "1.5.2", "optimist": "0.6.1", @@ -3169,6 +3196,7 @@ "version": "0.4.4", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", + "dev": true, "requires": { "amdefine": "1.0.1" } @@ -3214,7 +3242,8 @@ "has-flag": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=" + "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", + "dev": true }, "has-gulplog": { "version": "0.1.0", @@ -3359,6 +3388,7 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, "requires": { "once": "1.4.0", "wrappy": "1.0.2" @@ -3367,7 +3397,8 @@ "inherits": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true }, "ini": { "version": "1.3.5", @@ -3420,7 +3451,8 @@ "is-buffer": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true }, "is-builtin-module": { "version": "1.0.0", @@ -3653,7 +3685,8 @@ "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true }, "isobject": { "version": "2.1.0", @@ -3682,6 +3715,7 @@ "version": "0.4.5", "resolved": "https://registry.npmjs.org/istanbul/-/istanbul-0.4.5.tgz", "integrity": "sha1-ZcfXPUxNqE1POsMQuRj7C4Azczs=", + "dev": true, "requires": { "abbrev": "1.0.9", "async": "1.5.2", @@ -3703,6 +3737,7 @@ "version": "5.0.15", "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "dev": true, "requires": { "inflight": "1.0.6", "inherits": "2.0.3", @@ -3714,12 +3749,14 @@ "resolve": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", - "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=" + "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", + "dev": true }, "supports-color": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", + "dev": true, "requires": { "has-flag": "1.0.0" } @@ -3881,6 +3918,7 @@ "version": "3.11.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.11.0.tgz", "integrity": "sha512-saJstZWv7oNeOyBh3+Dx1qWzhW0+e6/8eDzo7p5rDFqxntSztloLtuKu+Ejhtq82jsilwOIZYsCz+lIjthg1Hw==", + "dev": true, "requires": { "argparse": "1.0.9", "esprima": "4.0.0" @@ -3889,7 +3927,8 @@ "esprima": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", - "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==" + "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", + "dev": true } } }, @@ -3982,6 +4021,7 @@ "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, "requires": { "is-buffer": "1.1.6" } @@ -3990,6 +4030,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", + "dev": true, "optional": true }, "lazystream": { @@ -4052,6 +4093,7 @@ "version": "0.3.0", "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, "requires": { "prelude-ls": "1.1.2", "type-check": "0.3.2" @@ -4288,7 +4330,8 @@ "longest": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", - "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=" + "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", + "dev": true }, "lru-cache": { "version": "4.1.1", @@ -4457,6 +4500,7 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, "requires": { "brace-expansion": "1.1.8" } @@ -4616,6 +4660,7 @@ "version": "3.0.6", "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "dev": true, "requires": { "abbrev": "1.0.9" } @@ -7568,6 +7613,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, "requires": { "wrappy": "1.0.2" } @@ -7581,6 +7627,7 @@ "version": "0.6.1", "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "dev": true, "requires": { "minimist": "0.0.8", "wordwrap": "0.0.3" @@ -7589,7 +7636,8 @@ "wordwrap": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", - "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=" + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", + "dev": true } } }, @@ -7597,6 +7645,7 @@ "version": "0.8.2", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "dev": true, "requires": { "deep-is": "0.1.3", "fast-levenshtein": "2.0.6", @@ -7763,7 +7812,8 @@ "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true }, "path-is-inside": { "version": "1.0.2", @@ -7899,7 +7949,8 @@ "prelude-ls": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=" + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true }, "preserve": { "version": "0.2.0", @@ -8198,7 +8249,8 @@ "repeat-string": { "version": "1.6.1", "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true }, "replace-ext": { "version": "0.0.1", @@ -8448,6 +8500,7 @@ "version": "0.1.3", "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", + "dev": true, "optional": true, "requires": { "align-text": "0.1.4" @@ -8612,7 +8665,8 @@ "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true }, "sshpk": { "version": "1.13.1", @@ -9117,6 +9171,7 @@ "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, "requires": { "prelude-ls": "1.1.2" } @@ -9153,6 +9208,7 @@ "version": "2.8.29", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", + "dev": true, "optional": true, "requires": { "source-map": "0.5.7", @@ -9164,12 +9220,14 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", + "dev": true, "optional": true }, "cliui": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", + "dev": true, "optional": true, "requires": { "center-align": "0.1.3", @@ -9181,18 +9239,21 @@ "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true, "optional": true }, "wordwrap": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", + "dev": true, "optional": true }, "yargs": { "version": "3.10.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "dev": true, "optional": true, "requires": { "camelcase": "1.2.1", @@ -9207,6 +9268,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", + "dev": true, "optional": true }, "unc-path-regex": { @@ -9568,6 +9630,7 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", + "dev": true, "requires": { "isexe": "2.0.0" } @@ -9582,6 +9645,7 @@ "version": "0.1.0", "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", + "dev": true, "optional": true }, "wolfy87-eventemitter": { @@ -9593,7 +9657,8 @@ "wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=" + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true }, "wrap-ansi": { "version": "2.1.0", @@ -9608,7 +9673,8 @@ "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true }, "xmlbuilder": { "version": "9.0.7", diff --git a/test/releaseTests/offlinePackage.test.ts b/test/releaseTests/offlinePackage.test.ts new file mode 100644 index 000000000..04991e9d6 --- /dev/null +++ b/test/releaseTests/offlinePackage.test.ts @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as chai from 'chai'; +import * as fs from 'async-file'; +import * as glob from 'glob-promise'; +import * as path from 'path'; +import { invokeCommand } from './testAssets/testAssets'; + +let vsixFiles = glob.sync(path.join(process.cwd(), '**', '*.vsix')); + +suite("Omnisharp-Vscode VSIX", async () => { + suiteSetup(async () => { + chai.should(); + invokeCommand("node node_modules/gulp/bin/gulp.js package:offline"); + }); + + test("At least one vsix file should be produced", () => { + vsixFiles.length.should.be.equal(3, "the build should produce exactly 3 vsix files"); + }); + +}); diff --git a/test/releaseTests/testAssets/testAssets.ts b/test/releaseTests/testAssets/testAssets.ts new file mode 100644 index 000000000..0b975d32a --- /dev/null +++ b/test/releaseTests/testAssets/testAssets.ts @@ -0,0 +1,18 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as cp from 'child_process'; + +export function invokeCommand(command: string): Promise<{ stdout: string, stderr: string }> { + return new Promise((resolve, reject) => { + let child = cp.exec(command, + (err, stdout, stderr) => { + return err ? reject(err) : resolve({ + stdout: stdout, + stderr: stderr + }); + }); + }); +} From 07ed7aa08419c69b74f0297bdbfbca5e0d6f0016 Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 29 Mar 2018 14:43:55 -0700 Subject: [PATCH 05/23] some tests --- gulpfile.js | 2 +- test/releaseTests/offlinePackage.test.ts | 31 +++++++++++++++++----- test/releaseTests/testAssets/testAssets.ts | 18 +++++-------- 3 files changed, 32 insertions(+), 19 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 03aba1cc0..fa822996a 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -102,7 +102,7 @@ function doPackageSync(packageName) { function doOfflinePackage(platformInfo, packageName, packageJSON) { if (process.platform === 'win32') { - throw new Error('Do not build offline packages on windows. Runtime executables will not be marked executable in *nix packages.'); + //throw new Error('Do not build offline packages on windows. Runtime executables will not be marked executable in *nix packages.'); } cleanSync(false); diff --git a/test/releaseTests/offlinePackage.test.ts b/test/releaseTests/offlinePackage.test.ts index 04991e9d6..9b2740f20 100644 --- a/test/releaseTests/offlinePackage.test.ts +++ b/test/releaseTests/offlinePackage.test.ts @@ -4,21 +4,38 @@ *--------------------------------------------------------------------------------------------*/ import * as chai from 'chai'; -import * as fs from 'async-file'; import * as glob from 'glob-promise'; import * as path from 'path'; import { invokeCommand } from './testAssets/testAssets'; +import { PlatformInformation } from '../../src/platform'; +import * as fs from 'async-file'; -let vsixFiles = glob.sync(path.join(process.cwd(), '**', '*.vsix')); - -suite("Omnisharp-Vscode VSIX", async () => { - suiteSetup(async () => { +suite("Offline packaging of VSIX", function () { + let vsixFiles: string[]; + this.timeout(200000); + //const packageJSON = JSON.parse(await fs.readFile('package.json')); + + suiteSetup(() => { chai.should(); - invokeCommand("node node_modules/gulp/bin/gulp.js package:offline"); + let args: string[] = []; + args.push(path.join("node_modules", "gulp", "bin", "gulp.js")); + args.push("package:offline"); + invokeCommand(args); + vsixFiles = glob.sync(path.join(process.cwd(), '**', '*.vsix')); }); - test("At least one vsix file should be produced", () => { + test("Exactly 3 vsix files should be produced", () => { vsixFiles.length.should.be.equal(3, "the build should produce exactly 3 vsix files"); }); + [ + new PlatformInformation('win32', 'x86_64'), + new PlatformInformation('darwin', 'x86_64'), + new PlatformInformation('linux', 'x86_64') + ].forEach(element => { + test(`Given Platform: ${element.platform} and Architecture: ${element.architecture}, the vsix file is created`, () => { + vsixFiles.findIndex(elem => elem.indexOf(element.platform) != -1).should.not.be.equal(-1); + vsixFiles.findIndex(elem => elem.indexOf(element.architecture) != -1).should.not.be.equal(-1); + }); + }) }); diff --git a/test/releaseTests/testAssets/testAssets.ts b/test/releaseTests/testAssets/testAssets.ts index 0b975d32a..6c3841fc8 100644 --- a/test/releaseTests/testAssets/testAssets.ts +++ b/test/releaseTests/testAssets/testAssets.ts @@ -4,15 +4,11 @@ *--------------------------------------------------------------------------------------------*/ import * as cp from 'child_process'; +import * as path from 'path'; -export function invokeCommand(command: string): Promise<{ stdout: string, stderr: string }> { - return new Promise((resolve, reject) => { - let child = cp.exec(command, - (err, stdout, stderr) => { - return err ? reject(err) : resolve({ - stdout: stdout, - stderr: stderr - }); - }); - }); -} +export function invokeCommand(args: string[]){ + let proc = cp.spawnSync('node', args); + if (proc.error) { + console.error(proc.error.toString()); + } +} \ No newline at end of file From 5e799099ed8bfdfed88cc7f5bcc6afbaeb533016 Mon Sep 17 00:00:00 2001 From: Akshita Agarwal Date: Thu, 29 Mar 2018 15:34:30 -0700 Subject: [PATCH 06/23] Added test for offline packaging --- package-lock.json | 116 +++++------------------ test/releaseTests/offlinePackage.test.ts | 7 +- 2 files changed, 28 insertions(+), 95 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9c4a8fd1f..d7e22fd48 100644 --- a/package-lock.json +++ b/package-lock.json @@ -238,8 +238,7 @@ "abbrev": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", - "integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU=", - "dev": true + "integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU=" }, "agent-base": { "version": "4.1.2", @@ -265,7 +264,6 @@ "version": "0.1.4", "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", - "dev": true, "requires": { "kind-of": "3.2.2", "longest": "1.0.1", @@ -275,8 +273,7 @@ "amdefine": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", - "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", - "dev": true + "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=" }, "ansi-colors": { "version": "1.1.0", @@ -352,7 +349,6 @@ "version": "1.0.9", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.9.tgz", "integrity": "sha1-c9g7wmP4bpf4zE9rrhsOkKfSLIY=", - "dev": true, "requires": { "sprintf-js": "1.0.3" } @@ -484,8 +480,7 @@ "async": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", - "dev": true + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" }, "async-arrays": { "version": "1.0.1", @@ -566,8 +561,7 @@ "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" }, "base64-js": { "version": "1.2.3", @@ -628,7 +622,6 @@ "version": "1.1.8", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", - "dev": true, "requires": { "balanced-match": "1.0.0", "concat-map": "0.0.1" @@ -684,7 +677,6 @@ "version": "0.1.3", "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", - "dev": true, "optional": true, "requires": { "align-text": "0.1.4", @@ -1002,8 +994,7 @@ "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, "convert-source-map": { "version": "1.5.1", @@ -1230,8 +1221,7 @@ "decamelize": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "dev": true + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" }, "deep-assign": { "version": "1.0.0", @@ -1254,8 +1244,7 @@ "deep-is": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", - "dev": true + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=" }, "defaults": { "version": "1.0.3", @@ -1545,7 +1534,6 @@ "version": "1.8.1", "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.8.1.tgz", "integrity": "sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg=", - "dev": true, "requires": { "esprima": "2.7.3", "estraverse": "1.9.3", @@ -1558,7 +1546,6 @@ "version": "0.2.0", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.2.0.tgz", "integrity": "sha1-2rc/vPwrqBm03gO9b26qSBZLP50=", - "dev": true, "optional": true, "requires": { "amdefine": "1.0.1" @@ -1569,20 +1556,17 @@ "esprima": { "version": "2.7.3", "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", - "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", - "dev": true + "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=" }, "estraverse": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz", - "integrity": "sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q=", - "dev": true + "integrity": "sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q=" }, "esutils": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", - "dev": true + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=" }, "event-stream": { "version": "3.3.4", @@ -1721,8 +1705,7 @@ "fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", - "dev": true + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=" }, "fd-slicer": { "version": "1.0.1", @@ -2025,15 +2008,6 @@ "is-glob": "2.0.1" } }, - "glob-promise": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/glob-promise/-/glob-promise-3.4.0.tgz", - "integrity": "sha512-q08RJ6O+eJn+dVanerAndJwIcumgbDdYiUT7zFQl3Wm1xD6fBKtah7H8ZJChj4wP+8C+QfeVy8xautR7rdmKEw==", - "dev": true, - "requires": { - "@types/glob": "5.0.35" - } - }, "glob-stream": { "version": "3.1.18", "resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-3.1.18.tgz", @@ -3184,7 +3158,6 @@ "version": "4.0.11", "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.11.tgz", "integrity": "sha1-Ywo13+ApS8KB7a5v/F0yn8eYLcw=", - "dev": true, "requires": { "async": "1.5.2", "optimist": "0.6.1", @@ -3196,7 +3169,6 @@ "version": "0.4.4", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", - "dev": true, "requires": { "amdefine": "1.0.1" } @@ -3242,8 +3214,7 @@ "has-flag": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", - "dev": true + "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=" }, "has-gulplog": { "version": "0.1.0", @@ -3388,7 +3359,6 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, "requires": { "once": "1.4.0", "wrappy": "1.0.2" @@ -3397,8 +3367,7 @@ "inherits": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" }, "ini": { "version": "1.3.5", @@ -3451,8 +3420,7 @@ "is-buffer": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" }, "is-builtin-module": { "version": "1.0.0", @@ -3685,8 +3653,7 @@ "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" }, "isobject": { "version": "2.1.0", @@ -3715,7 +3682,6 @@ "version": "0.4.5", "resolved": "https://registry.npmjs.org/istanbul/-/istanbul-0.4.5.tgz", "integrity": "sha1-ZcfXPUxNqE1POsMQuRj7C4Azczs=", - "dev": true, "requires": { "abbrev": "1.0.9", "async": "1.5.2", @@ -3737,7 +3703,6 @@ "version": "5.0.15", "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", - "dev": true, "requires": { "inflight": "1.0.6", "inherits": "2.0.3", @@ -3749,14 +3714,12 @@ "resolve": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", - "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", - "dev": true + "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=" }, "supports-color": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", - "dev": true, "requires": { "has-flag": "1.0.0" } @@ -3918,7 +3881,6 @@ "version": "3.11.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.11.0.tgz", "integrity": "sha512-saJstZWv7oNeOyBh3+Dx1qWzhW0+e6/8eDzo7p5rDFqxntSztloLtuKu+Ejhtq82jsilwOIZYsCz+lIjthg1Hw==", - "dev": true, "requires": { "argparse": "1.0.9", "esprima": "4.0.0" @@ -3927,8 +3889,7 @@ "esprima": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", - "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", - "dev": true + "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==" } } }, @@ -4021,7 +3982,6 @@ "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, "requires": { "is-buffer": "1.1.6" } @@ -4030,7 +3990,6 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", - "dev": true, "optional": true }, "lazystream": { @@ -4093,7 +4052,6 @@ "version": "0.3.0", "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", - "dev": true, "requires": { "prelude-ls": "1.1.2", "type-check": "0.3.2" @@ -4330,8 +4288,7 @@ "longest": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", - "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", - "dev": true + "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=" }, "lru-cache": { "version": "4.1.1", @@ -4500,7 +4457,6 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, "requires": { "brace-expansion": "1.1.8" } @@ -4660,7 +4616,6 @@ "version": "3.0.6", "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", - "dev": true, "requires": { "abbrev": "1.0.9" } @@ -7613,7 +7568,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, "requires": { "wrappy": "1.0.2" } @@ -7627,7 +7581,6 @@ "version": "0.6.1", "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", - "dev": true, "requires": { "minimist": "0.0.8", "wordwrap": "0.0.3" @@ -7636,8 +7589,7 @@ "wordwrap": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", - "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", - "dev": true + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=" } } }, @@ -7645,7 +7597,6 @@ "version": "0.8.2", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", - "dev": true, "requires": { "deep-is": "0.1.3", "fast-levenshtein": "2.0.6", @@ -7812,8 +7763,7 @@ "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, "path-is-inside": { "version": "1.0.2", @@ -7949,8 +7899,7 @@ "prelude-ls": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", - "dev": true + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=" }, "preserve": { "version": "0.2.0", @@ -8249,8 +8198,7 @@ "repeat-string": { "version": "1.6.1", "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", - "dev": true + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" }, "replace-ext": { "version": "0.0.1", @@ -8500,7 +8448,6 @@ "version": "0.1.3", "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", - "dev": true, "optional": true, "requires": { "align-text": "0.1.4" @@ -8665,8 +8612,7 @@ "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" }, "sshpk": { "version": "1.13.1", @@ -9171,7 +9117,6 @@ "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", - "dev": true, "requires": { "prelude-ls": "1.1.2" } @@ -9208,7 +9153,6 @@ "version": "2.8.29", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", - "dev": true, "optional": true, "requires": { "source-map": "0.5.7", @@ -9220,14 +9164,12 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", - "dev": true, "optional": true }, "cliui": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", - "dev": true, "optional": true, "requires": { "center-align": "0.1.3", @@ -9239,21 +9181,18 @@ "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true, "optional": true }, "wordwrap": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", - "dev": true, "optional": true }, "yargs": { "version": "3.10.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", - "dev": true, "optional": true, "requires": { "camelcase": "1.2.1", @@ -9268,7 +9207,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", - "dev": true, "optional": true }, "unc-path-regex": { @@ -9630,7 +9568,6 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", - "dev": true, "requires": { "isexe": "2.0.0" } @@ -9645,7 +9582,6 @@ "version": "0.1.0", "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", - "dev": true, "optional": true }, "wolfy87-eventemitter": { @@ -9657,8 +9593,7 @@ "wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", - "dev": true + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=" }, "wrap-ansi": { "version": "2.1.0", @@ -9673,8 +9608,7 @@ "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "xmlbuilder": { "version": "9.0.7", diff --git a/test/releaseTests/offlinePackage.test.ts b/test/releaseTests/offlinePackage.test.ts index 9b2740f20..90f645e77 100644 --- a/test/releaseTests/offlinePackage.test.ts +++ b/test/releaseTests/offlinePackage.test.ts @@ -12,9 +12,8 @@ import * as fs from 'async-file'; suite("Offline packaging of VSIX", function () { let vsixFiles: string[]; - this.timeout(200000); - //const packageJSON = JSON.parse(await fs.readFile('package.json')); - + this.timeout(2000000); + suiteSetup(() => { chai.should(); let args: string[] = []; @@ -37,5 +36,5 @@ suite("Offline packaging of VSIX", function () { vsixFiles.findIndex(elem => elem.indexOf(element.platform) != -1).should.not.be.equal(-1); vsixFiles.findIndex(elem => elem.indexOf(element.architecture) != -1).should.not.be.equal(-1); }); - }) + }); }); From 3ca01c61ff6adbd3290608ac9090a0fe15bdf20f Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 29 Mar 2018 15:53:45 -0700 Subject: [PATCH 07/23] remove change in gulpfile --- gulpfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index fa822996a..03aba1cc0 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -102,7 +102,7 @@ function doPackageSync(packageName) { function doOfflinePackage(platformInfo, packageName, packageJSON) { if (process.platform === 'win32') { - //throw new Error('Do not build offline packages on windows. Runtime executables will not be marked executable in *nix packages.'); + throw new Error('Do not build offline packages on windows. Runtime executables will not be marked executable in *nix packages.'); } cleanSync(false); From 761dd542567b3003ad34392d05781c22c2fd4a14 Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 29 Mar 2018 16:28:27 -0700 Subject: [PATCH 08/23] invokeNode --- test/releaseTests/offlinePackage.test.ts | 6 +++--- test/releaseTests/testAssets/testAssets.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/releaseTests/offlinePackage.test.ts b/test/releaseTests/offlinePackage.test.ts index 90f645e77..21e39df3e 100644 --- a/test/releaseTests/offlinePackage.test.ts +++ b/test/releaseTests/offlinePackage.test.ts @@ -6,20 +6,20 @@ import * as chai from 'chai'; import * as glob from 'glob-promise'; import * as path from 'path'; -import { invokeCommand } from './testAssets/testAssets'; +import { invokeNode } from './testAssets/testAssets'; import { PlatformInformation } from '../../src/platform'; import * as fs from 'async-file'; suite("Offline packaging of VSIX", function () { let vsixFiles: string[]; - this.timeout(2000000); + this.timeout(1000000); suiteSetup(() => { chai.should(); let args: string[] = []; args.push(path.join("node_modules", "gulp", "bin", "gulp.js")); args.push("package:offline"); - invokeCommand(args); + invokeNode(args); vsixFiles = glob.sync(path.join(process.cwd(), '**', '*.vsix')); }); diff --git a/test/releaseTests/testAssets/testAssets.ts b/test/releaseTests/testAssets/testAssets.ts index 6c3841fc8..26616481d 100644 --- a/test/releaseTests/testAssets/testAssets.ts +++ b/test/releaseTests/testAssets/testAssets.ts @@ -6,7 +6,7 @@ import * as cp from 'child_process'; import * as path from 'path'; -export function invokeCommand(args: string[]){ +export function invokeNode(args: string[]){ let proc = cp.spawnSync('node', args); if (proc.error) { console.error(proc.error.toString()); From de7d8dabb98df38b26cffa10d4e7afcd870a4f50 Mon Sep 17 00:00:00 2001 From: Akshita Agarwal Date: Fri, 30 Mar 2018 15:16:10 -0700 Subject: [PATCH 09/23] Artifact tests --- .travis.yml | 2 +- package-lock.json | 116 ++++++++++++++---- package.json | 1 + .../vsix.test.ts | 0 4 files changed, 93 insertions(+), 26 deletions(-) rename test/{releaseTests => artifactTests}/vsix.test.ts (100%) diff --git a/.travis.yml b/.travis.yml index a0fd4327c..16fd7fb27 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,7 +34,7 @@ script: - npm run cov:instrument - npm test --silent - npm run cov:report - - npm run test:release + - npm run test:artifacts after_failure: - ./.travis/printLogs.sh diff --git a/package-lock.json b/package-lock.json index d7e22fd48..9c4a8fd1f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -238,7 +238,8 @@ "abbrev": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", - "integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU=" + "integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU=", + "dev": true }, "agent-base": { "version": "4.1.2", @@ -264,6 +265,7 @@ "version": "0.1.4", "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", + "dev": true, "requires": { "kind-of": "3.2.2", "longest": "1.0.1", @@ -273,7 +275,8 @@ "amdefine": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", - "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=" + "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", + "dev": true }, "ansi-colors": { "version": "1.1.0", @@ -349,6 +352,7 @@ "version": "1.0.9", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.9.tgz", "integrity": "sha1-c9g7wmP4bpf4zE9rrhsOkKfSLIY=", + "dev": true, "requires": { "sprintf-js": "1.0.3" } @@ -480,7 +484,8 @@ "async": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "dev": true }, "async-arrays": { "version": "1.0.1", @@ -561,7 +566,8 @@ "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true }, "base64-js": { "version": "1.2.3", @@ -622,6 +628,7 @@ "version": "1.1.8", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", + "dev": true, "requires": { "balanced-match": "1.0.0", "concat-map": "0.0.1" @@ -677,6 +684,7 @@ "version": "0.1.3", "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", + "dev": true, "optional": true, "requires": { "align-text": "0.1.4", @@ -994,7 +1002,8 @@ "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true }, "convert-source-map": { "version": "1.5.1", @@ -1221,7 +1230,8 @@ "decamelize": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true }, "deep-assign": { "version": "1.0.0", @@ -1244,7 +1254,8 @@ "deep-is": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=" + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true }, "defaults": { "version": "1.0.3", @@ -1534,6 +1545,7 @@ "version": "1.8.1", "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.8.1.tgz", "integrity": "sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg=", + "dev": true, "requires": { "esprima": "2.7.3", "estraverse": "1.9.3", @@ -1546,6 +1558,7 @@ "version": "0.2.0", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.2.0.tgz", "integrity": "sha1-2rc/vPwrqBm03gO9b26qSBZLP50=", + "dev": true, "optional": true, "requires": { "amdefine": "1.0.1" @@ -1556,17 +1569,20 @@ "esprima": { "version": "2.7.3", "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", - "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=" + "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", + "dev": true }, "estraverse": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz", - "integrity": "sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q=" + "integrity": "sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q=", + "dev": true }, "esutils": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=" + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true }, "event-stream": { "version": "3.3.4", @@ -1705,7 +1721,8 @@ "fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=" + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true }, "fd-slicer": { "version": "1.0.1", @@ -2008,6 +2025,15 @@ "is-glob": "2.0.1" } }, + "glob-promise": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/glob-promise/-/glob-promise-3.4.0.tgz", + "integrity": "sha512-q08RJ6O+eJn+dVanerAndJwIcumgbDdYiUT7zFQl3Wm1xD6fBKtah7H8ZJChj4wP+8C+QfeVy8xautR7rdmKEw==", + "dev": true, + "requires": { + "@types/glob": "5.0.35" + } + }, "glob-stream": { "version": "3.1.18", "resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-3.1.18.tgz", @@ -3158,6 +3184,7 @@ "version": "4.0.11", "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.11.tgz", "integrity": "sha1-Ywo13+ApS8KB7a5v/F0yn8eYLcw=", + "dev": true, "requires": { "async": "1.5.2", "optimist": "0.6.1", @@ -3169,6 +3196,7 @@ "version": "0.4.4", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", + "dev": true, "requires": { "amdefine": "1.0.1" } @@ -3214,7 +3242,8 @@ "has-flag": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=" + "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", + "dev": true }, "has-gulplog": { "version": "0.1.0", @@ -3359,6 +3388,7 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, "requires": { "once": "1.4.0", "wrappy": "1.0.2" @@ -3367,7 +3397,8 @@ "inherits": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true }, "ini": { "version": "1.3.5", @@ -3420,7 +3451,8 @@ "is-buffer": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true }, "is-builtin-module": { "version": "1.0.0", @@ -3653,7 +3685,8 @@ "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true }, "isobject": { "version": "2.1.0", @@ -3682,6 +3715,7 @@ "version": "0.4.5", "resolved": "https://registry.npmjs.org/istanbul/-/istanbul-0.4.5.tgz", "integrity": "sha1-ZcfXPUxNqE1POsMQuRj7C4Azczs=", + "dev": true, "requires": { "abbrev": "1.0.9", "async": "1.5.2", @@ -3703,6 +3737,7 @@ "version": "5.0.15", "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "dev": true, "requires": { "inflight": "1.0.6", "inherits": "2.0.3", @@ -3714,12 +3749,14 @@ "resolve": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", - "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=" + "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", + "dev": true }, "supports-color": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", + "dev": true, "requires": { "has-flag": "1.0.0" } @@ -3881,6 +3918,7 @@ "version": "3.11.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.11.0.tgz", "integrity": "sha512-saJstZWv7oNeOyBh3+Dx1qWzhW0+e6/8eDzo7p5rDFqxntSztloLtuKu+Ejhtq82jsilwOIZYsCz+lIjthg1Hw==", + "dev": true, "requires": { "argparse": "1.0.9", "esprima": "4.0.0" @@ -3889,7 +3927,8 @@ "esprima": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", - "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==" + "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", + "dev": true } } }, @@ -3982,6 +4021,7 @@ "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, "requires": { "is-buffer": "1.1.6" } @@ -3990,6 +4030,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", + "dev": true, "optional": true }, "lazystream": { @@ -4052,6 +4093,7 @@ "version": "0.3.0", "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, "requires": { "prelude-ls": "1.1.2", "type-check": "0.3.2" @@ -4288,7 +4330,8 @@ "longest": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", - "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=" + "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", + "dev": true }, "lru-cache": { "version": "4.1.1", @@ -4457,6 +4500,7 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, "requires": { "brace-expansion": "1.1.8" } @@ -4616,6 +4660,7 @@ "version": "3.0.6", "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "dev": true, "requires": { "abbrev": "1.0.9" } @@ -7568,6 +7613,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, "requires": { "wrappy": "1.0.2" } @@ -7581,6 +7627,7 @@ "version": "0.6.1", "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "dev": true, "requires": { "minimist": "0.0.8", "wordwrap": "0.0.3" @@ -7589,7 +7636,8 @@ "wordwrap": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", - "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=" + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", + "dev": true } } }, @@ -7597,6 +7645,7 @@ "version": "0.8.2", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "dev": true, "requires": { "deep-is": "0.1.3", "fast-levenshtein": "2.0.6", @@ -7763,7 +7812,8 @@ "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true }, "path-is-inside": { "version": "1.0.2", @@ -7899,7 +7949,8 @@ "prelude-ls": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=" + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true }, "preserve": { "version": "0.2.0", @@ -8198,7 +8249,8 @@ "repeat-string": { "version": "1.6.1", "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true }, "replace-ext": { "version": "0.0.1", @@ -8448,6 +8500,7 @@ "version": "0.1.3", "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", + "dev": true, "optional": true, "requires": { "align-text": "0.1.4" @@ -8612,7 +8665,8 @@ "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true }, "sshpk": { "version": "1.13.1", @@ -9117,6 +9171,7 @@ "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, "requires": { "prelude-ls": "1.1.2" } @@ -9153,6 +9208,7 @@ "version": "2.8.29", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", + "dev": true, "optional": true, "requires": { "source-map": "0.5.7", @@ -9164,12 +9220,14 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", + "dev": true, "optional": true }, "cliui": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", + "dev": true, "optional": true, "requires": { "center-align": "0.1.3", @@ -9181,18 +9239,21 @@ "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true, "optional": true }, "wordwrap": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", + "dev": true, "optional": true }, "yargs": { "version": "3.10.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "dev": true, "optional": true, "requires": { "camelcase": "1.2.1", @@ -9207,6 +9268,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", + "dev": true, "optional": true }, "unc-path-regex": { @@ -9568,6 +9630,7 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", + "dev": true, "requires": { "isexe": "2.0.0" } @@ -9582,6 +9645,7 @@ "version": "0.1.0", "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", + "dev": true, "optional": true }, "wolfy87-eventemitter": { @@ -9593,7 +9657,8 @@ "wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=" + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true }, "wrap-ansi": { "version": "2.1.0", @@ -9608,7 +9673,8 @@ "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true }, "xmlbuilder": { "version": "9.0.7", diff --git a/package.json b/package.json index fb6771842..56ebadc07 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,7 @@ "test:runSuiteInVsCode": "cross-env CODE_EXTENSIONS_PATH=./ CODE_TESTS_PATH=./out/test/integrationTests CODE_TESTS_WORKSPACE=./test/integrationTests/testAssets/$OSVC_SUITE npm run test:runInVsCode", "test:runInVsCode": "node ./test/runVsCodeTestsWithAbsolutePaths.js", "test:release": "mocha --opts ./mocha.opts test/releaseTests/**/*.test.ts", + "test:artifacts": "mocha --opts ./mocha.opts test/artifactTests/**/*.test.ts", "postinstall": "node ./node_modules/vscode/bin/install", "cov:instrument": "rimraf ./coverage && rimraf ./.nyc_output && rimraf ./out && npm run compile && cd out && nyc instrument --require source-map-support/register --cwd ../ . . && cd ..", "cov:merge": "cd ./out && istanbul-combine -d ../coverage/integration -r lcovonly ../.nyc_output/integration/*.json && cd ..", diff --git a/test/releaseTests/vsix.test.ts b/test/artifactTests/vsix.test.ts similarity index 100% rename from test/releaseTests/vsix.test.ts rename to test/artifactTests/vsix.test.ts From bc789644848560c71f5666b615bba2fc6c55ab98 Mon Sep 17 00:00:00 2001 From: Akshita Agarwal Date: Mon, 2 Apr 2018 11:47:53 -0700 Subject: [PATCH 10/23] Directing the vsix files to a temp folder --- gulpfile.js | 34 +++++++++++++++++++----- package-lock.json | 22 ++++++++++++--- package.json | 1 + test/releaseTests/offlinePackage.test.ts | 23 +++++++++++++--- 4 files changed, 65 insertions(+), 15 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 03aba1cc0..75d85fb43 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -83,7 +83,7 @@ gulp.task('install', ['clean'], () => { }); /// Packaging (VSIX) Tasks -function doPackageSync(packageName) { +function doPackageSync(packageName, outputFolder) { var vsceArgs = []; vsceArgs.push(path.join(__dirname, 'node_modules', 'vsce', 'out', 'vsce')) @@ -91,7 +91,13 @@ function doPackageSync(packageName) { if (packageName !== undefined) { vsceArgs.push('-o'); - vsceArgs.push(packageName); + if (outputFolder) { + //if we have specified an output folder then put the files in that output folder + vsceArgs.push(path.join(outputFolder, packageName)); + } + else { + vsceArgs.push(packageName); + } } var proc = child_process.spawnSync('node', vsceArgs); @@ -100,7 +106,7 @@ function doPackageSync(packageName) { } } -function doOfflinePackage(platformInfo, packageName, packageJSON) { +function doOfflinePackage(platformInfo, packageName, packageJSON, outputFolder) { if (process.platform === 'win32') { throw new Error('Do not build offline packages on windows. Runtime executables will not be marked executable in *nix packages.'); } @@ -108,7 +114,7 @@ function doOfflinePackage(platformInfo, packageName, packageJSON) { cleanSync(false); return install(platformInfo, packageJSON) .then(() => { - doPackageSync(packageName + '-' + platformInfo.platform + '-' + platformInfo.architecture + '.vsix'); + doPackageSync(packageName + '-' + platformInfo.platform + '-' + platformInfo.architecture + '.vsix', outputFolder); }); } @@ -124,14 +130,28 @@ gulp.task('package:online', ['clean'], () => { doPackageSync(); }); -gulp.task('package:offline', ['clean'], () => { +gulp.task('package:offline', () => { util.setExtensionPath(__dirname); + var argv = require('minimist')(process.argv.slice(2), { boolean: ['retainVsix'] }); + if (argv['retainVsix']) { + //if user doesnot want to clean up the existing vsix packages + cleanSync(false); + } + else { + cleanSync(true); + } + + var outputFolder; + if (argv['o']) { + outputFolder = argv['o']; + } + var packageJSON = getPackageJSON(); var name = packageJSON.name; var version = packageJSON.version; var packageName = name + '.' + version; - + var packages = []; packages.push(new PlatformInformation('win32', 'x86_64')); packages.push(new PlatformInformation('darwin', 'x86_64')); @@ -142,7 +162,7 @@ gulp.task('package:offline', ['clean'], () => { packages.forEach(platformInfo => { promise = promise .then(() => { - return doOfflinePackage(platformInfo, packageName, packageJSON); + return doOfflinePackage(platformInfo, packageName, packageJSON, outputFolder); }); }); diff --git a/package-lock.json b/package-lock.json index 9c4a8fd1f..1d31d2691 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4506,9 +4506,10 @@ } }, "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true }, "mkdirp": { "version": "0.5.1", @@ -4516,6 +4517,13 @@ "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "requires": { "minimist": "0.0.8" + }, + "dependencies": { + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + } } }, "mocha": { @@ -7629,10 +7637,16 @@ "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", "dev": true, "requires": { - "minimist": "0.0.8", + "minimist": "0.0.10", "wordwrap": "0.0.3" }, "dependencies": { + "minimist": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", + "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", + "dev": true + }, "wordwrap": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", diff --git a/package.json b/package.json index 56ebadc07..486fae364 100644 --- a/package.json +++ b/package.json @@ -110,6 +110,7 @@ "istanbul": "^0.4.5", "istanbul-combine": "^0.3.0", "ltcdr": "^2.2.1", + "minimist": "^1.2.0", "mocha": "^5.0.4", "mocha-typescript": "^1.1.12", "npm-run-all": "^4.1.2", diff --git a/test/releaseTests/offlinePackage.test.ts b/test/releaseTests/offlinePackage.test.ts index 21e39df3e..fbfca08db 100644 --- a/test/releaseTests/offlinePackage.test.ts +++ b/test/releaseTests/offlinePackage.test.ts @@ -8,22 +8,29 @@ import * as glob from 'glob-promise'; import * as path from 'path'; import { invokeNode } from './testAssets/testAssets'; import { PlatformInformation } from '../../src/platform'; -import * as fs from 'async-file'; +import { rimraf } from 'async-file'; + +let tmp = require('tmp'); suite("Offline packaging of VSIX", function () { let vsixFiles: string[]; this.timeout(1000000); - + let tmpDir = null; + suiteSetup(() => { chai.should(); + tmpDir = tmp.dirSync(); let args: string[] = []; args.push(path.join("node_modules", "gulp", "bin", "gulp.js")); args.push("package:offline"); + args.push("--retainVsix");// do not delete the existing vsix in the repo + args.push(`-o`); + args.push(tmpDir.name); invokeNode(args); - vsixFiles = glob.sync(path.join(process.cwd(), '**', '*.vsix')); + vsixFiles = glob.sync(path.join(tmpDir.name, '*.vsix')); }); - test("Exactly 3 vsix files should be produced", () => { + test("Exactly 3 vsix files should be produced", () => { vsixFiles.length.should.be.equal(3, "the build should produce exactly 3 vsix files"); }); @@ -37,4 +44,12 @@ suite("Offline packaging of VSIX", function () { vsixFiles.findIndex(elem => elem.indexOf(element.architecture) != -1).should.not.be.equal(-1); }); }); + + suiteTeardown(async () => { + if (tmpDir) { + await rimraf(tmpDir.name); + } + + tmpDir = null; + }); }); From 0966fc1cb53951292101b9f9e85a3909807522d3 Mon Sep 17 00:00:00 2001 From: Akshita Agarwal Date: Mon, 2 Apr 2018 12:17:01 -0700 Subject: [PATCH 11/23] Changes to travis to run release tests on release only --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 16fd7fb27..1d55f87f8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,6 +35,8 @@ script: - npm test --silent - npm run cov:report - npm run test:artifacts + - if [ $TRAVIS_PULL_REQUEST_BRANCH == "" ]; then + npm run test:release after_failure: - ./.travis/printLogs.sh From fcbdc5e9a3ccb2979ae9ed8c87819a410d38d6b6 Mon Sep 17 00:00:00 2001 From: Akshita Agarwal Date: Mon, 2 Apr 2018 12:28:28 -0700 Subject: [PATCH 12/23] if statement --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 1d55f87f8..92508b9a9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,6 +37,7 @@ script: - npm run test:artifacts - if [ $TRAVIS_PULL_REQUEST_BRANCH == "" ]; then npm run test:release + fi after_failure: - ./.travis/printLogs.sh From 2e8e64738e4b7a71236a78621bf1e07870a87e97 Mon Sep 17 00:00:00 2001 From: Piotr Puszkiewicz Date: Mon, 2 Apr 2018 12:57:53 -0700 Subject: [PATCH 13/23] Convert gulpfile to ts --- gulpfile.js => gulpfile.ts | 83 +++++++++++++++++++------------------- 1 file changed, 41 insertions(+), 42 deletions(-) rename gulpfile.js => gulpfile.ts (72%) diff --git a/gulpfile.js b/gulpfile.ts similarity index 72% rename from gulpfile.js rename to gulpfile.ts index 75d85fb43..fa6b04e1d 100644 --- a/gulpfile.js +++ b/gulpfile.ts @@ -5,30 +5,29 @@ 'use strict'; -const fs = require('fs'); -const path = require('path'); -const del = require('del'); -const gulp = require('gulp'); -const mocha = require('gulp-mocha'); -const tslint = require('gulp-tslint'); -const vsce = require('vsce'); -const debugUtil = require('./out/src/coreclr-debug/util'); -const packages = require('./out/src/packages'); -const logger = require('./out/src/logger'); -const platform = require('./out/src/platform'); -const util = require('./out/src/common'); -const child_process = require('child_process'); -const optionsSchemaGenerator = require('./out/src/tools/GenerateOptionsSchema'); -const packageDependencyUpdater = require('./out/src/tools/UpdatePackageDependencies'); -const eventStream = require('./out/src/EventStream'); -const csharpLoggerObserver = require('./out/src/observers/CsharpLoggerObserver'); - -const EventStream = eventStream.EventStream; +import * as child_process from 'child_process'; +import * as debugUtil from './src/coreclr-debug/util'; +import * as del from 'del'; +import * as fs from 'fs'; +import * as gulp from 'gulp'; +import * as logger from './src/logger'; +import * as mocha from 'gulp-mocha'; +import * as optionsSchemaGenerator from './src/tools/GenerateOptionsSchema'; +import * as packageDependencyUpdater from './src/tools/UpdatePackageDependencies'; +import * as packages from './src/packages'; +import * as path from 'path'; +import * as platform from './src/platform'; +import * as util from './src/common'; +import * as vsce from 'vsce'; + +import { CsharpLoggerObserver } from './src/observers/CsharpLoggerObserver'; +import { EventStream } from './src/EventStream'; +import tslint from 'gulp-tslint'; + const Logger = logger.Logger; const PackageManager = packages.PackageManager; const LinuxDistribution = platform.LinuxDistribution; const PlatformInformation = platform.PlatformInformation; -const CsharpLoggerObserver = csharpLoggerObserver.CsharpLoggerObserver; function cleanSync(deleteVsix) { del.sync('install.*'); @@ -58,15 +57,15 @@ function install(platformInfo, packageJSON) { let eventStream = new EventStream(); const logger = new Logger(message => process.stdout.write(message)); let stdoutObserver = new CsharpLoggerObserver(logger); - eventStream.subscribe(stdoutObserver.post); - const debuggerUtil = new debugUtil.CoreClrDebugUtil(path.resolve('.'), logger); + eventStream.subscribe(stdoutObserver.post); + const debuggerUtil = new debugUtil.CoreClrDebugUtil(path.resolve('.')); - return packageManager.DownloadPackages(eventStream) + return packageManager.DownloadPackages(eventStream, undefined, undefined, undefined) .then(() => { - return packageManager.InstallPackages(eventStream); + return packageManager.InstallPackages(eventStream, undefined); }) .then(() => { - return util.touchInstallFile(util.InstallFileType.Lock) + return util.touchInstallFile(util.InstallFileType.Lock); }) .then(() => { return debugUtil.CoreClrDebugUtil.writeEmptyFile(debuggerUtil.installCompleteFilePath()); @@ -85,8 +84,8 @@ gulp.task('install', ['clean'], () => { /// Packaging (VSIX) Tasks function doPackageSync(packageName, outputFolder) { - var vsceArgs = []; - vsceArgs.push(path.join(__dirname, 'node_modules', 'vsce', 'out', 'vsce')) + let vsceArgs = []; + vsceArgs.push(path.join(__dirname, 'node_modules', 'vsce', 'out', 'vsce')); vsceArgs.push('package'); // package command if (packageName !== undefined) { @@ -100,7 +99,7 @@ function doPackageSync(packageName, outputFolder) { } } - var proc = child_process.spawnSync('node', vsceArgs); + let proc = child_process.spawnSync('node', vsceArgs); if (proc.error) { console.error(proc.error.toString()); } @@ -119,7 +118,7 @@ function doOfflinePackage(platformInfo, packageName, packageJSON, outputFolder) } function getPackageJSON() { - return JSON.parse(fs.readFileSync('package.json')); + return JSON.parse(fs.readFileSync('package.json').toString()); } gulp.task('package:clean', () => { @@ -127,13 +126,13 @@ gulp.task('package:clean', () => { }); gulp.task('package:online', ['clean'], () => { - doPackageSync(); + doPackageSync(undefined, undefined); }); gulp.task('package:offline', () => { util.setExtensionPath(__dirname); - var argv = require('minimist')(process.argv.slice(2), { boolean: ['retainVsix'] }); + let argv = require('minimist')(process.argv.slice(2), { boolean: ['retainVsix'] }); if (argv['retainVsix']) { //if user doesnot want to clean up the existing vsix packages cleanSync(false); @@ -142,22 +141,22 @@ gulp.task('package:offline', () => { cleanSync(true); } - var outputFolder; + let outputFolder; if (argv['o']) { outputFolder = argv['o']; } - var packageJSON = getPackageJSON(); - var name = packageJSON.name; - var version = packageJSON.version; - var packageName = name + '.' + version; + const packageJSON = getPackageJSON(); + const name = packageJSON.name; + const version = packageJSON.version; + const packageName = name + '.' + version; - var packages = []; + const packages = []; packages.push(new PlatformInformation('win32', 'x86_64')); packages.push(new PlatformInformation('darwin', 'x86_64')); packages.push(new PlatformInformation('linux', 'x86_64')); - var promise = Promise.resolve(); + let promise = Promise.resolve(); packages.forEach(platformInfo => { promise = promise @@ -178,9 +177,9 @@ const allTypeScript = [ const lintReporter = (output, file, options) => { //emits: src/helloWorld.c:5:3: warning: implicit declaration of function ‘prinft’ - var relativeBase = file.base.substring(file.cwd.length + 1).replace('\\', '/'); + let relativeBase = file.base.substring(file.cwd.length + 1).replace('\\', '/'); output.forEach(e => { - var message = relativeBase + e.name + ':' + (e.startPosition.line + 1) + ':' + (e.startPosition.character + 1) + ': ' + e.failure; + let message = relativeBase + e.name + ':' + (e.startPosition.line + 1) + ':' + (e.startPosition.character + 1) + ': ' + e.failure; console.log('[tslint] ' + message); }); }; @@ -191,8 +190,8 @@ gulp.task('tslint', () => { program: require('tslint').Linter.createProgram("./tsconfig.json"), configuration: "./tslint.json" })) - .pipe(tslint.report(lintReporter, { + .pipe(tslint.report({ summarizeFailureOutput: false, emitError: false - })) + })); }); From 9aee396ad3290452ab3b1619bc2633cbe0f00b60 Mon Sep 17 00:00:00 2001 From: Akshita Agarwal Date: Mon, 2 Apr 2018 13:27:21 -0700 Subject: [PATCH 14/23] check travis tag --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 92508b9a9..3a9e9023b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,7 +35,7 @@ script: - npm test --silent - npm run cov:report - npm run test:artifacts - - if [ $TRAVIS_PULL_REQUEST_BRANCH == "" ]; then + - if [ TRAVIS_TAG != "master" ]; then npm run test:release fi From 649cb4587e5614aaca94e008b5828a8e6a8981aa Mon Sep 17 00:00:00 2001 From: Akshita Agarwal Date: Mon, 2 Apr 2018 14:28:49 -0700 Subject: [PATCH 15/23] Test trial --- .travis.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3a9e9023b..ccc622fc9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,9 +35,8 @@ script: - npm test --silent - npm run cov:report - npm run test:artifacts - - if [ TRAVIS_TAG != "master" ]; then - npm run test:release - fi + - test $TRAVIS_TAG != "master" \ + && npm run test:release after_failure: - ./.travis/printLogs.sh From fb3ae4cf2d7672cd2b8f37b3da30a8dd8986d8c9 Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 2 Apr 2018 16:05:54 -0700 Subject: [PATCH 16/23] C'mon travis! --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index ccc622fc9..dfb0682b6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,8 +35,7 @@ script: - npm test --silent - npm run cov:report - npm run test:artifacts - - test $TRAVIS_TAG != "master" \ - && npm run test:release + - test $TRAVIS_TAG != "master" && npm run test:release after_failure: - ./.travis/printLogs.sh From 4abeebafbcbf658b66c15d1e255c09f3a27aa1a3 Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 2 Apr 2018 16:20:03 -0700 Subject: [PATCH 17/23] Try try! --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index dfb0682b6..5a24417cc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,7 +35,7 @@ script: - npm test --silent - npm run cov:report - npm run test:artifacts - - test $TRAVIS_TAG != "master" && npm run test:release + - test $TRAVIS_TAG != ""master"" && test $TRAVIS_PULL_REQUEST_BRANCH = """" && npm run test:release after_failure: - ./.travis/printLogs.sh From ce7d68ee09063c3fbdbc36b125467b74676122ff Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 2 Apr 2018 16:34:31 -0700 Subject: [PATCH 18/23] Using bash ne --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5a24417cc..e5ef284cf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,7 +35,9 @@ script: - npm test --silent - npm run cov:report - npm run test:artifacts - - test $TRAVIS_TAG != ""master"" && test $TRAVIS_PULL_REQUEST_BRANCH = """" && npm run test:release + - if [ "$TRAVIS_TAG" -ne "master" && test -z "$TRAVIS_PULL_REQUEST_BRANCH" ]; then + npm run test:release + fi after_failure: - ./.travis/printLogs.sh From cfbf862ee89bdfc49a1c2cf1fd233c8693e2fbb0 Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 2 Apr 2018 16:46:47 -0700 Subject: [PATCH 19/23] Add newline --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index e5ef284cf..bdf90104c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,8 +35,8 @@ script: - npm test --silent - npm run cov:report - npm run test:artifacts - - if [ "$TRAVIS_TAG" -ne "master" && test -z "$TRAVIS_PULL_REQUEST_BRANCH" ]; then - npm run test:release + - if [ "$TRAVIS_TAG" -ne "master" && -z "$TRAVIS_PULL_REQUEST_BRANCH" ]; then \ + npm run test:release \ fi after_failure: From 197fc856dc055fa7cc7845865fe8e5a3527ec8cc Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 2 Apr 2018 17:24:52 -0700 Subject: [PATCH 20/23] Enclosed in quotes --- .travis.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index bdf90104c..24a616647 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,9 +35,7 @@ script: - npm test --silent - npm run cov:report - npm run test:artifacts - - if [ "$TRAVIS_TAG" -ne "master" && -z "$TRAVIS_PULL_REQUEST_BRANCH" ]; then \ - npm run test:release \ - fi + - 'if [ "$TRAVIS_TAG" != "master" && -z "$TRAVIS_PULL_REQUEST_BRANCH" ]; then npm run test:release; fi' after_failure: - ./.travis/printLogs.sh From e206c9bc1b8942482094c22c07ea4057da005999 Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 2 Apr 2018 18:19:13 -0700 Subject: [PATCH 21/23] Try travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 24a616647..49b3cf69d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,7 +35,7 @@ script: - npm test --silent - npm run cov:report - npm run test:artifacts - - 'if [ "$TRAVIS_TAG" != "master" && -z "$TRAVIS_PULL_REQUEST_BRANCH" ]; then npm run test:release; fi' + - 'if [ "$TRAVIS_TAG" != "master" && "$TRAVIS_PULL_REQUEST" != "false" ]; then npm run test:release; fi' after_failure: - ./.travis/printLogs.sh From 10068770bd04581e45f10c03c5276d7ea72e3424 Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 2 Apr 2018 18:22:35 -0700 Subject: [PATCH 22/23] Do on false --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 49b3cf69d..f0296f772 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,7 +35,7 @@ script: - npm test --silent - npm run cov:report - npm run test:artifacts - - 'if [ "$TRAVIS_TAG" != "master" && "$TRAVIS_PULL_REQUEST" != "false" ]; then npm run test:release; fi' + - 'if [ "$TRAVIS_TAG" != "master" && "$TRAVIS_PULL_REQUEST" = "false" ]; then npm run test:release; fi' after_failure: - ./.travis/printLogs.sh From ef8c30c63721c54fcd57f96d1159772c84829a37 Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 2 Apr 2018 19:22:59 -0700 Subject: [PATCH 23/23] Add bracket --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f0296f772..a33f15001 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,7 +35,7 @@ script: - npm test --silent - npm run cov:report - npm run test:artifacts - - 'if [ "$TRAVIS_TAG" != "master" && "$TRAVIS_PULL_REQUEST" = "false" ]; then npm run test:release; fi' + - 'if [[ "$TRAVIS_TAG" != "master" && "$TRAVIS_PULL_REQUEST" = "false" ]]; then npm run test:release; fi' after_failure: - ./.travis/printLogs.sh