s3p 3.4.6 → 3.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/S3Parallel/Lib/S3Keys.js +1 -1
- package/build/S3Parallel/Lib/S3Keys.js.map +1 -1
- package/package.json +1 -1
- package/source/S3Parallel/Lib/S3Keys.caf +30 -3
- package/build/test/Lib/FsEasy.test.js +0 -4
- package/build/test/Lib/FsEasy.test.js.map +0 -10
- package/build/test/Lib/LibMisc.test.js +0 -4
- package/build/test/Lib/LibMisc.test.js.map +0 -10
- package/build/test/Lib/PromiseWorkerPool.test.js +0 -4
- package/build/test/Lib/PromiseWorkerPool.test.js.map +0 -10
- package/build/test/Lib/S3Keys.test.js +0 -4
- package/build/test/Lib/S3Keys.test.js.map +0 -10
- package/build/test/Lib/index.js +0 -11
- package/build/test/Lib/namespace.js +0 -7
- package/build/test/S3Comprehensions.test.js +0 -4
- package/build/test/S3Comprehensions.test.js.map +0 -10
- package/build/test/S3P.test.js +0 -4
- package/build/test/S3P.test.js.map +0 -10
- package/build/test/S3PCli.js +0 -13
- package/build/test/S3PCli.test.js +0 -4
- package/build/test/S3PCli.test.js.map +0 -10
- package/build/test/StandardImport.js +0 -4
- package/build/test/StandardImport.js.map +0 -10
- package/build/test/TestLib.js +0 -4
- package/build/test/TestLib.js.map +0 -10
- package/build/test/index.js +0 -14
- package/build/test/namespace.js +0 -9
- package/source/test/Lib/FsEasy.test.caf +0 -69
- package/source/test/Lib/LibMisc.test.caf +0 -40
- package/source/test/Lib/PromiseWorkerPool.test.caf +0 -26
- package/source/test/Lib/S3Keys.test.caf +0 -129
- package/source/test/S3Comprehensions.test.caf +0 -118
- package/source/test/S3P.test.caf +0 -109
- package/source/test/S3PCli.test.caf +0 -23
- package/source/test/StandardImport.caf +0 -6
- package/source/test/TestLib.caf +0 -59
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict"
|
|
2
2
|
let Caf = require('caffeine-script-runtime');
|
|
3
|
-
Caf.defMod(module, () => {return Caf.importInvoke(["peek", "Error", "formattedInspect", "pad", "Math"], [global, require('../StandardImport')], (peek, Error, formattedInspect, pad, Math) => {let supportedKeyChars, maxKeyLength, lastKeyChar, middleKeyChar, getKeyCharIndex, getUpToNextSlash, getBisectKey, escapeKey, padKey, getLastKeyWithPrefix, debugKey; return {supportedKeyChars: supportedKeyChars = ' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~', maxKeyLength: maxKeyLength = 1024, lastKeyChar: lastKeyChar = peek(supportedKeyChars), middleKeyChar: middleKeyChar = supportedKeyChars[supportedKeyChars.length / 2 | 0], getKeyCharIndex: getKeyCharIndex = function(character) {return character ? supportedKeyChars.indexOf(character) : 0;}, getUpToNextSlash: getUpToNextSlash = function(key, i) {let m, found; m = key.slice(i, key.length).match(/(^[^\/]*)\//); return (found = Caf.exists(m) && m[0]) ? key.slice(0, i + found.length) : undefined;}, getBisectKey: getBisectKey = function(startAfter, stopAt, bisectPrefix) {let i, lastCommonSlash, charIndex1, charIndex2, bisectKey, prefixBisectI, key; return (startAfter < stopAt) ? (i = 0, lastCommonSlash = null, (() => {while (startAfter[i] === stopAt[i]) {if (startAfter[i] === "/") {lastCommonSlash = i;}; i++;};})(), charIndex1 = (i === startAfter.length) ? 0 : getKeyCharIndex(startAfter[i]), charIndex2 = getKeyCharIndex(stopAt[i]), (charIndex1 < 0 || charIndex2 < 0) ? (() => {throw new Error("Invalid character found in inputs:\n" + formattedInspect({startAfter, stopAt, i, charIndex1, charIndex2, supportedKeyChars}));})() : undefined, bisectKey = (() => {switch (false) {case !(bisectPrefix && (i < (prefixBisectI = (i + startAfter.length) / 2 | 0) && (key = getUpToNextSlash(startAfter, (lastCommonSlash != null) ? lastCommonSlash + 1 : 0)))): return getLastKeyWithPrefix(key); case !(charIndex1 + 1 === charIndex2): return startAfter.slice(0, i + 1) + supportedKeyChars[(supportedKeyChars.length - 1 + getKeyCharIndex(startAfter[i + 1])) / 2 | 0]; default: return startAfter.slice(0, i) + supportedKeyChars[(charIndex1 + charIndex2) / 2 | 0];};})(), !(startAfter <= bisectKey && bisectKey <= stopAt) ? (() => {throw new Error(`Whoops! ${Caf.toString(startAfter)} <= ${Caf.toString(bisectKey)} <= ${Caf.toString(stopAt)} -- something's not right`);})() : undefined, bisectKey) : undefined;}, escapeKey: escapeKey = function(key) {return /[\s()]/.test(key) ? `"${Caf.toString(key)}"` : key;}, padKey: padKey = function(key) {return pad(key, 20 * Math.ceil(key.length / 20));}, getLastKeyWithPrefix: getLastKeyWithPrefix = function(prefix) {return (prefix.length < maxKeyLength) ? prefix + lastKeyChar.repeat(maxKeyLength - prefix.length) : undefined;}, debugKey: debugKey = function(key, shouldPad = true) {let tail, i, lastIndex; return (key != null) ? (tail = 0, i = lastIndex = key.length - 1, (() => {while (key[i] === lastKeyChar) {i--;};})(), key = (() => {switch (false) {case !(key === ""): return "''"; case !(i < lastIndex): return escapeKey(key.slice(0, i + 1)) + `(${Caf.toString(lastKeyChar)}*${Caf.toString(lastIndex - i)})`; default: return escapeKey(key);};})(), shouldPad ? padKey(key) : key) : `(${Caf.toString("" + key)})`;}};});});
|
|
3
|
+
Caf.defMod(module, () => {return Caf.importInvoke(["peek", "Error", "formattedInspect", "pad", "Math"], [global, require('../StandardImport')], (peek, Error, formattedInspect, pad, Math) => {let supportedKeyChars, maxKeyLength, lastKeyChar, middleKeyChar, getKeyCharIndex, getUpToNextSlash, getBisectKey, isLastKey, getNextKey, escapeKey, padKey, getLastKeyWithPrefix, debugKey; return {supportedKeyChars: supportedKeyChars = ' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~', maxKeyLength: maxKeyLength = 1024, lastKeyChar: lastKeyChar = peek(supportedKeyChars), middleKeyChar: middleKeyChar = supportedKeyChars[supportedKeyChars.length / 2 | 0], getKeyCharIndex: getKeyCharIndex = function(character) {return character ? supportedKeyChars.indexOf(character) : 0;}, getUpToNextSlash: getUpToNextSlash = function(key, i) {let m, found; m = key.slice(i, key.length).match(/(^[^\/]*)\//); return (found = Caf.exists(m) && m[0]) ? key.slice(0, i + found.length) : undefined;}, getBisectKey: getBisectKey = function(startAfter, stopAt, bisectPrefix) {let i, lastCommonSlash, charIndex1, charIndex2, bisectKey, prefixBisectI, key; return (startAfter < stopAt) ? (i = 0, lastCommonSlash = null, (() => {while (startAfter[i] === stopAt[i]) {if (startAfter[i] === "/") {lastCommonSlash = i;}; i++;};})(), charIndex1 = (i === startAfter.length) ? 0 : getKeyCharIndex(startAfter[i]), charIndex2 = getKeyCharIndex(stopAt[i]), (charIndex1 < 0 || charIndex2 < 0) ? (() => {throw new Error("Invalid character found in inputs:\n" + formattedInspect({startAfter, stopAt, i, charIndex1, charIndex2, supportedKeyChars}));})() : undefined, bisectKey = (() => {switch (false) {case !(bisectPrefix && (i < (prefixBisectI = (i + startAfter.length) / 2 | 0) && (key = getUpToNextSlash(startAfter, (lastCommonSlash != null) ? lastCommonSlash + 1 : 0)))): return getLastKeyWithPrefix(key); case !(charIndex1 + 1 === charIndex2): return (startAfter[i + 1] === lastKeyChar) ? getNextKey(startAfter) : startAfter.slice(0, i + 1) + supportedKeyChars[(supportedKeyChars.length - 1 + getKeyCharIndex(startAfter[i + 1])) / 2 | 0]; default: return startAfter.slice(0, i) + supportedKeyChars[(charIndex1 + charIndex2) / 2 | 0];};})(), !(bisectKey.length <= maxKeyLength) ? (() => {throw new Error(`Whoops! bisectKey too long ${Caf.toString(formattedInspect({startAfter, stopAt, bisectPrefix, bisectKey, maxKeyLength, bisectKeyLength: bisectKey.length}))}`);})() : undefined, !(startAfter <= bisectKey && bisectKey <= stopAt) ? (() => {throw new Error(`Whoops! ${Caf.toString(formattedInspect(startAfter))} <=(${Caf.toString(startAfter <= bisectKey)}) ${Caf.toString(formattedInspect(bisectKey))} <=(${Caf.toString(bisectKey <= stopAt)}) ${Caf.toString(formattedInspect(stopAt))} (bisectPrefix=${Caf.toString(formattedInspect(bisectPrefix))})-- something's not right`);})() : undefined, bisectKey) : undefined;}, isLastKey: isLastKey = function(key) {return RegExp(`^[${Caf.toString(lastKeyChar)}]+\$`).test(key);}, getNextKey: getNextKey = function(key) {let i, temp; return (key.length < maxKeyLength) ? key + lastKeyChar : (i = maxKeyLength - 1, isLastKey(key) ? (() => {throw new Error(`getNextKey error: key is aleady the very last key possible: ${Caf.toString(formattedInspect(key))}`);})() : undefined, (() => {while (i > -1) {if (key[i] !== lastKeyChar) {return key.slice(0, i) + supportedKeyChars[getKeyCharIndex(key[i]) + 1];}; temp = i--;}; return temp;})());}, escapeKey: escapeKey = function(key) {return /[\s()]/.test(key) ? `"${Caf.toString(key)}"` : key;}, padKey: padKey = function(key) {return pad(key, 20 * Math.ceil(key.length / 20));}, getLastKeyWithPrefix: getLastKeyWithPrefix = function(prefix) {return (prefix.length < maxKeyLength) ? prefix + lastKeyChar.repeat(maxKeyLength - prefix.length) : undefined;}, debugKey: debugKey = function(key, shouldPad = true) {let tail, i, lastIndex; return (key != null) ? (tail = 0, i = lastIndex = key.length - 1, (() => {while (key[i] === lastKeyChar) {i--;};})(), key = (() => {switch (false) {case !(key === ""): return "''"; case !(i < lastIndex): return escapeKey(key.slice(0, i + 1)) + `(${Caf.toString(lastKeyChar)}*${Caf.toString(lastIndex - i)})`; default: return escapeKey(key);};})(), shouldPad ? padKey(key) : key) : `(${Caf.toString("" + key)})`;}};});});
|
|
4
4
|
//# sourceMappingURL=S3Keys.js.map
|
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
"source/S3Parallel/Lib/S3Keys.caf"
|
|
7
7
|
],
|
|
8
8
|
"names": [],
|
|
9
|
-
"mappings": "AAAA;;AAAA,iHAAO,
|
|
9
|
+
"mappings": "AAAA;;AAAA,iHAAO,0QAEP,QACE,uCACI,qGAEJ,6BAAe,MACf,2BAAc,KAAK,oBACnB,+BAAgB,kBAA0C,2BAAG,IAAI,IAEjE,mCAAe,QAAG,CAAC,YAAc,OAAG,YAAe,0BAA0B,aAAe,KAE5F,qCAAgB,QAAG,CAAC,KAAK,kBACvB,IACE,UAAU,GAAG,kBACN,uBACN,oBAAQ,QAAG,MAAQ,UAAU,GAAG,IAAI,6BA6BzC,6BAAY,QAAG,CAAC,YAAY,QAAQ,8FAAiB,OAAG,cAAa,UAAM,CACzE,IAAI,GACJ,kBAAkB,MAClB,eAAM,WAAW,OAAM,OAAO,KAC5B,IAAG,WAAW,OAAM,MAClB,kBAAkB,KACpB,YAEF,aAAgB,OAAM,qBAAuB,IAAO,gBAAgB,WAAW,KAC/E,aAAa,gBAAgB,OAAO,KAEjC,CAAU,aAAG,KAAK,aAAa,KAChC,cAAM,IAAI,MAAM,yCAAyC,kBAAoB,YAAY,QAAQ,GAAG,YAAY,YAAY,uCAE9H,YACE,wBAAM,MACD,iBACD,KAAI,iBAAuC,0BAAG,IAAI,MAC/C,OAAM,iBAAiB,YAAY,CAAG,2BAAsB,kBAAkB,IAAO,OAAC,OAE3F,qBAAqB,MAAG,MAGrB,CAAU,aAAG,MAAK,aAAU,OAC5B,YAAW,IAAI,OAAM,eAItB,WAAW,cAIX,iBAAiB,GAAG,IAAI,KACtB,kBAAqF,sEAAG,IAAI,aAE9F,OACF,iBAAiB,GAAG,KAClB,kBAA2C,4BAAG,IAAI,WAExD,CAAO,qBAAoB,gBACzB,cAAM,IAAI,MAAK,2CAAmC,iBAAgB,CAAI,YAAY,QAAQ,cAAc,WAAW,cAAc,iBAAiB,yCACpJ,CAAO,CAAU,cAAI,aAAa,aAAa,UAC7C,cAAM,IAAI,MAAK,wBAAY,iBAAiB,gCAAiB,cAAc,4BAAc,iBAAiB,+BAAgB,aAAa,yBAAW,iBAAiB,uCAAwB,iBAAiB,6DAE9M,0BAEF,uBAAS,QAAG,CAAC,MAAO,OAClB,yBAAQ,yBACF,QAER,yBAAU,QAAG,CAAC,mBAAO,OAChB,cAAa,gBACd,MAAM,cACJ,CACF,IAAI,eAAe,GAChB,UAAU,OACX,cAAM,IAAI,MAAK,4EAAgE,iBAAiB,2BAElG,eAAM,IAAI,KACR,IAAG,IAAI,OAAM,cACX,OAAO,UAAU,GAAG,KAAK,kBAAkB,gBAAgB,IAAI,MAAM,aACvE,4BAEN,uBAAS,QAAG,CAAC,MAAO,OACf,cAAc,OAAG,iBACZ,UAEH,OAEP,iBAAM,QAAG,CAAC,MAAO,OACf,IAAI,KAAK,KAAK,UAAU,aAAa,QASvC,6CAAoB,QAAG,CAAC,SAAU,OAC7B,iBAAgB,gBACjB,SAAS,mBAAmB,eAAe,8BAE/C,qBAAQ,QAAG,CAAC,KAAK,YAAY,+BAAQ,OACnC,CAAG,eAAI,CACL,OAAO,GACP,IAAI,YAAY,aAAa,GAC7B,eAAM,IAAI,OAAM,cAAe,YAE/B,MACE,wBAAM,MACD,SAAO,KAAE,OACZ,MAAI,MAED,KAAI,YAAS,OAChB,UAAU,UAAU,GAAG,IAAI,uBACrB,6BAAe,YAAY,gBAE/B,OACF,UAAU,aAEX,YACD,OAAO,OAEJ,OAEF,iBAAI,KAAK"
|
|
10
10
|
}
|
package/package.json
CHANGED
|
@@ -65,19 +65,46 @@ import &StandardImport
|
|
|
65
65
|
|
|
66
66
|
getLastKeyWithPrefix key
|
|
67
67
|
|
|
68
|
+
# no gap between the first non-matching character
|
|
68
69
|
when charIndex1 + 1 == charIndex2
|
|
69
|
-
startAfter
|
|
70
|
-
|
|
70
|
+
if startAfter[i + 1] == lastKeyChar
|
|
71
|
+
# just increment startAfter
|
|
72
|
+
# technically, a slightly better pick might be to find the first non lastKeyChar after (i + 1)
|
|
73
|
+
# and then bisect between that character and lastKeyChar
|
|
74
|
+
getNextKey startAfter
|
|
75
|
+
|
|
76
|
+
else
|
|
77
|
+
# bisect between the lastKeyChar and startAfter[i + 1]
|
|
78
|
+
startAfter.slice 0, i + 1
|
|
79
|
+
+ supportedKeyChars[(supportedKeyChars.length - 1 + getKeyCharIndex startAfter[i + 1]) / 2 | 0]
|
|
71
80
|
|
|
72
81
|
else
|
|
73
82
|
startAfter.slice 0, i
|
|
74
83
|
+ supportedKeyChars[(charIndex1 + charIndex2) / 2 | 0]
|
|
75
84
|
|
|
85
|
+
unless bisectKey.length <= maxKeyLength
|
|
86
|
+
throw new Error "" Whoops! bisectKey too long #{} formattedInspect {} startAfter, stopAt, bisectPrefix, bisectKey, maxKeyLength, bisectKeyLength: bisectKey.length
|
|
76
87
|
unless startAfter <= bisectKey && bisectKey <= stopAt
|
|
77
|
-
throw new Error "Whoops! #{startAfter} <= #{bisectKey} <= #{stopAt} -- something's not right"
|
|
88
|
+
throw new Error "Whoops! #{formattedInspect startAfter} <=(#{startAfter <= bisectKey}) #{formattedInspect bisectKey} <=(#{bisectKey <= stopAt}) #{formattedInspect stopAt} (bisectPrefix=#{formattedInspect bisectPrefix})-- something's not right"
|
|
78
89
|
|
|
79
90
|
bisectKey
|
|
80
91
|
|
|
92
|
+
isLastKey = (key) ->
|
|
93
|
+
/// ^[#{lastKeyChar}]+$
|
|
94
|
+
.test key
|
|
95
|
+
|
|
96
|
+
getNextKey = (key) ->
|
|
97
|
+
if key.length < maxKeyLength
|
|
98
|
+
key + lastKeyChar
|
|
99
|
+
else
|
|
100
|
+
i = maxKeyLength - 1
|
|
101
|
+
if isLastKey key
|
|
102
|
+
throw new Error "getNextKey error: key is aleady the very last key possible: #{formattedInspect key}"
|
|
103
|
+
|
|
104
|
+
while i > -1
|
|
105
|
+
if key[i] != lastKeyChar
|
|
106
|
+
return key.slice(0, i) + supportedKeyChars[getKeyCharIndex(key[i]) + 1]
|
|
107
|
+
i--
|
|
81
108
|
|
|
82
109
|
escapeKey = (key) ->
|
|
83
110
|
if /[\s()]/.test key
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
"use strict"
|
|
2
|
-
let Caf = require('caffeine-script-runtime');
|
|
3
|
-
Caf.defMod(module, () => {return Caf.importInvoke(["describe", "test"], [global, require('../StandardImport'), {mockFs: require('mock-fs')}], (describe, test) => {return describe({createParentDirs: function() {return test("no-op", () => {});}});});});
|
|
4
|
-
//# sourceMappingURL=FsEasy.test.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
"use strict"
|
|
2
|
-
let Caf = require('caffeine-script-runtime');
|
|
3
|
-
Caf.defMod(module, () => {return Caf.importInvoke(["test", "assert", "humanByteSize", "createS3Url", "shellExec"], [global, require('../StandardImport')], (test, assert, humanByteSize, createS3Url, shellExec) => {Caf.each2([[0, "0_B"], [10, "10_B"], [1023, "1023_B"], [10240, "10.00kB"], [Caf.pow(1024, 1), "1.00kB"], [Caf.pow(1024, 2), "1.00mB"], [Caf.pow(1024, 3), "1.00gB"], [Caf.pow(1024, 4), "1.00tB"], [Caf.pow(1024, 5), "1.00pB"], [Caf.pow(1024, 6), "1.00eB"], [Caf.pow(1024, 1) - 1, "1023_B"], [Caf.pow(1024, 2) - 1, "1024.00kB"], [Caf.pow(1024, 3) - 1, "1024.00mB"], [Caf.pow(1024, 4) - 1, "1024.00gB"], [Caf.pow(1024, 5) - 1, "1024.00tB"], [Caf.pow(1024, 6) - 100, "1024.00pB"]], ([input, output]) => test(`humanByteSize ${Caf.toString(input)} >> ${Caf.toString(output)}`, function() {return assert.eq(humanByteSize(input), output);})); Caf.each2([["s3://my-bucket/my-key", "my-bucket", null, "my-key"], ["my-folder/my-key", "my-bucket", "my-folder", "my-key"], ["my-folder/my-key", null, "my-folder", "my-key"]], ([output, ...args]) => test(`createS3Url ${Caf.toString(args.join(", "))} >> ${Caf.toString(output)}`, function() {return assert.eq(createS3Url(...args), output);})); return test("shellExec pwd", function() {return shellExec("pwd").then((out) => assert.match(out, "\/s3p"));});});});
|
|
4
|
-
//# sourceMappingURL=LibMisc.test.js.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"file": "LibMisc.test.js",
|
|
4
|
-
"sourceRoot": "../../..",
|
|
5
|
-
"sources": [
|
|
6
|
-
"source/test/Lib/LibMisc.test.caf"
|
|
7
|
-
],
|
|
8
|
-
"names": [],
|
|
9
|
-
"mappings": "AAAA;;AAAA,4HAAO,yFAEP,UAAwB,EACpB,GAAM,SACN,IAAM,UACN,MAAM,YACN,OAAQ,aACR,cAAM,IAAE,YACR,cAAM,IAAE,YACR,cAAM,IAAE,YACR,cAAM,IAAE,YACR,cAAM,IAAE,YACR,cAAM,IAAE,YAEJ,cAAE,KAAI,GAAI,YACV,cAAE,KAAI,GAAI,eACV,cAAE,KAAI,GAAI,eACV,cAAE,KAAI,GAAI,eACV,cAAE,KAAI,GAAI,eACV,cAAE,KAAI,KAAI,oCAEhB,mCAAsB,0BAAY,uBAAW,OAC3C,UACE,cAAc,QACd,uBAEoB,EACnB,yBAAuB,aAAW,MAAK,YACvC,oBAAkB,aAAW,aAAW,YACxC,oBAAkB,MAAK,aAAW,mCAEvC,KAAI,4BAAgB,UAAU,0BAAW,uBAAW,OAClD,UACE,YAAY,UACZ,oBAEN,KAAK,6BAAkB,OACrB,UAAU,YACJ,CAAC,QACL,aAAa,KAAK"
|
|
10
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
"use strict"
|
|
2
|
-
let Caf = require('caffeine-script-runtime');
|
|
3
|
-
Caf.defMod(module, () => {return Caf.importInvoke(["test", "PromiseWorkerPool", "Promise", "max", "timeout", "log", "assert"], [global, require('../StandardImport')], (test, PromiseWorkerPool, Promise, max, timeout, log, assert) => {return test("pwp", function() {let currentlyActive, maxActive, totalDone, doWork, pwp, poolSize, numQueued, into, to, i, by; currentlyActive = 0; maxActive = 0; totalDone = 0; doWork = () => {currentlyActive++; maxActive = max(currentlyActive, maxActive); return timeout(1).then(() => {totalDone++; return currentlyActive--;});}; pwp = new PromiseWorkerPool(poolSize = 10); return Promise.all((into = [], to = numQueued = 100, i = 0, by = (i < to) ? 1 : -1, (() => {while (by > 0 && i < to || by < 0 && i > to) {let v; v = i; into.push(pwp.queue(doWork)); i += by;};})(), into)).then(() => {log({currentlyActive, maxActive, poolSize, numQueued}); assert.eq(maxActive, poolSize); return assert.eq(totalDone, numQueued);});});});});
|
|
4
|
-
//# sourceMappingURL=PromiseWorkerPool.test.js.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"file": "PromiseWorkerPool.test.js",
|
|
4
|
-
"sourceRoot": "../../..",
|
|
5
|
-
"sources": [
|
|
6
|
-
"source/test/Lib/PromiseWorkerPool.test.caf"
|
|
7
|
-
],
|
|
8
|
-
"names": [],
|
|
9
|
-
"mappings": "AAAA;;AAAA,wIAAO,iGAEP,YAAK,iHACH,kBAAkB,GAClB,YAAY,GACZ,YAAY,GAEZ,SAAM,OACJ,mBAEA,YAAY,IAAI,iBAAiB,mBACjC,QAAQ,eAEN,oBAEA,wBAEJ,MAAM,IAAI,kBAAkB,WAAW,YAEvC,6BAAsB,YAAY,kHAChC,UAAU,sCAEP,OACH,KAAO,iBAAiB,WAAW,UAAU,aAC7C,UAAU,WAAW,kBACrB,UAAU,WAAW"
|
|
10
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
"use strict"
|
|
2
|
-
let Caf = require('caffeine-script-runtime');
|
|
3
|
-
Caf.defMod(module, () => {return Caf.importInvoke(["describe", "test", "assert", "getUpToNextSlash", "debugKey", "repeat", "lastKeyChar", "getBisectKey", "middleKeyChar", "getLastKeyWithPrefix"], [global, require('../StandardImport')], (describe, test, assert, getUpToNextSlash, debugKey, repeat, lastKeyChar, getBisectKey, middleKeyChar, getLastKeyWithPrefix) => {return describe({getUpToNextSlash: function() {test(":this/is/ok 0 -> :this/ ", () => assert.eq("this/", getUpToNextSlash("this/is/ok", 0))); test(":this/is/ok 4 -> :this/ ", () => assert.eq("this/", getUpToNextSlash("this/is/ok", 4))); test(":this/is/ok 5 -> :this/is/", () => assert.eq("this/is/", getUpToNextSlash("this/is/ok", 5))); test(":this/is/ok 6 -> :this/is/", () => assert.eq("this/is/", getUpToNextSlash("this/is/ok", 6))); test(":this/is/ok 7 -> :this/is/", () => assert.eq("this/is/", getUpToNextSlash("this/is/ok", 7))); test("undefined if no /", () => assert.eq(undefined, getUpToNextSlash("this", 0))); test("undefined if > last /", () => assert.eq(undefined, getUpToNextSlash("this/is/okthere", 10))); return test("undefined if > length", () => assert.eq(undefined, getUpToNextSlash("this/is/ok", 100)));}, debugKey: function() {test("debugKey :a", () => assert.match(debugKey("a"), /^a +$/)); test("debugKey ''", () => assert.match(debugKey(""), "'' ")); return test("debugKey :ab~~~~~~~~~~~", () => assert.eq(debugKey("ab" + repeat(lastKeyChar, 10)), "ab(~*10) "));}, getBisectKey: {nulls_and_errors: function() {test("matching returns null", () => assert.notPresent(getBisectKey("a", "a"))); test("invalid char in first param", () => assert.rejects(() => getBisectKey("\n", "a"))); test("invalid char in second param", () => assert.rejects(() => getBisectKey("b", "😀"))); return test("reverse-order returns null", () => assert.notPresent(getBisectKey("b", "a")));}, basic: function() {test(":alpha :alphadude -> :b", () => assert.eq("alphaB", getBisectKey("alpha", "alphadude"))); test('"alpha" "alpha me" -> "alpha "', () => assert.eq("alpha ", getBisectKey("alpha", "alpha me"))); test('"alpha" "alpha " -> "alpha "', () => assert.eq("alpha ", getBisectKey("alpha", "alpha "))); test(":a :c -> :b", () => assert.eq("b", getBisectKey("a", "c"))); test(":alphabet :c -> :b", () => assert.eq("b", getBisectKey("alphabet", "c"))); test(":aa :ac -> :ab", () => assert.eq(`aa${Caf.toString(middleKeyChar)}`, getBisectKey("aa", "ab"))); return test("with spaces", () => assert.eq("My `", getBisectKey("My Other thing.bar", "My report.foo")));}, bisectPrefix: {dirAware: function() {return Caf.each2([["alpha/beta", "z", getLastKeyWithPrefix("alpha/")], ["alpha/beta/gamma", "alpha/boomTown", getLastKeyWithPrefix("alpha/beta/")], ["alpha/beta", "alpha/foo", "alpha/d"], ["run2/bcl-sync-status/39e8278706c47520c03865b84b06921a", "u", getLastKeyWithPrefix("run2/")]], ([a, b, out]) => test(`${Caf.toString(a)} ${Caf.toString(b)} -> ${Caf.toString(out.slice(0, 25))}${Caf.toString((out.length > 25) ? "..." : undefined)}`, () => assert.eq(out, getBisectKey(a, b, true))));}, basic: function() {test(":a :c -> :b~...", () => assert.eq("b", getBisectKey("a", "c", true))); test('"alpha" "alpha me" -> "alpha "', () => assert.eq("alpha ", getBisectKey("alpha", "alpha me", true))); test(":alpha :alphadude -> :alphaB", () => assert.eq("alphaB", getBisectKey("alpha", "alphadude", true))); test(":alphabet :c -> :alph~...", () => assert.eq("b", getBisectKey("alphabet", "c", true))); return test(":alphabet :alpi -> :alpha~...", () => assert.eq("alpho", getBisectKey("alphabet", "alpi", true)));}}, regressions: function() {test(":alpha :T -> notPresent", () => assert.notPresent(getBisectKey("alpha", "T"))); test(`:alpha :alphb -> :alpha${Caf.toString(middleKeyChar)}`, () => assert.eq(`alpha${Caf.toString(middleKeyChar)}`, getBisectKey("alpha", "alphb"))); return test(":./.git/objects/17/3d216b08fff7c71eeb7bf1c7d5e8aef789461e :./.git/obk -> :./.git/objq", () => assert.eq("./.git/objq", getBisectKey("./.git/objects/17/3d216b08fff7c71eeb7bf1c7d5e8aef789461e", "./.git/obk")));}}});});});
|
|
4
|
-
//# sourceMappingURL=S3Keys.test.js.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"file": "S3Keys.test.js",
|
|
4
|
-
"sourceRoot": "../../..",
|
|
5
|
-
"sources": [
|
|
6
|
-
"source/test/Lib/S3Keys.test.caf"
|
|
7
|
-
],
|
|
8
|
-
"names": [],
|
|
9
|
-
"mappings": "AAAA;;AAAA,6MAAO,gKAEP,gBAAQ,CACN,8BACE,KAAK,oCAAgC,UAAU,SAAW,iBAAiB,cAAY,MACvF,KAAK,oCAAgC,UAAU,SAAW,iBAAiB,cAAY,MACvF,KAAK,oCAAgC,UAAU,YAAW,iBAAiB,cAAY,MACvF,KAAK,oCAAgC,UAAU,YAAW,iBAAiB,cAAY,MACvF,KAAK,oCAAgC,UAAU,YAAW,iBAAiB,cAAY,MACvF,KAAK,2BAAuB,UAAU,WAAW,iBAAiB,QAAQ,MAC1E,KAAK,+BAA2B,UAAU,WAAW,iBAAiB,mBAAmB,cACzF,KAAK,+BAA2B,UAAU,WAAW,iBAAiB,cAAc,UAEtF,sBACE,KAAK,qBACH,aACE,SAAS,MACT,WAEJ,KAAK,qBACH,aACE,SAAS,KACT,iCAEJ,KAAK,iCACH,UACE,SAAS,OAAM,OAAO,aAAa,MACnC,4BAEN,eAEE,8BACE,KACI,+BACC,kBAAkB,aAAa,KAAG,QAEvC,KACI,qCACC,eAAc,MAAI,aAAa,MAAK,QAEzC,KACI,sCACC,eAAc,MAAI,aAAa,KAAG,gBAEvC,KACI,oCACC,kBAAkB,aAAa,KAAG,UAEzC,mBACE,KACI,iCACC,UAAU,UAAQ,aAAa,SAAO,gBAE3C,KACI,wCACC,UAAU,UAAS,aAAa,SAAO,eAE5C,KACI,sCACC,UAAU,UAAS,aAAa,SAAO,aAE5C,KACI,qBACC,UAAU,KAAG,aAAa,KAAG,QAElC,KACI,4BACC,UAAU,KAAG,aAAa,YAAU,QAEzC,KACI,wBACC,4BAAe,kBAAgB,aAAa,MAAI,gBAErD,KACI,qBACC,UACC,QACF,aACE,sBACA,sBAER,eACE,sBAAY,iBAEU,EACZ,cAAY,KAAG,qBAAqB,aACpC,oBAAkB,kBAAgB,qBAAqB,kBACvD,cAAY,aAAW,aACvB,yDAAuD,KAAG,qBAAqB,6BACrF,KAAI,gBAAI,mBAAK,sBAAQ,UAAU,GAAG,oBAAe,cAAa,kCAC5D,UAAU,KAAK,aAAa,GAAG,GAAG,YAExC,mBACE,KACI,yBACC,UAAU,KAAG,aAAa,KAAG,KAAG,SAErC,KACI,wCACC,UAAU,UAAS,aAAa,SAAO,YAAW,SAEvD,KACI,sCACC,UAAU,UAAQ,aAAa,SAAO,aAAW,SAEtD,KACI,mCACC,UACD,KACA,aAAa,YAAU,KAAG,gBAE9B,KACI,uCACC,UACD,SACA,aAAa,YAAU,QAAM,YAErC,yBACE,KACI,iCACC,kBAAkB,aAAa,SAAO,QAE3C,4CAC8B,wBACzB,+BAAkB,kBAAgB,aAAa,SAAO,mBAE3D,KACI,+FACC,UAAU,eAAa,aAAa,4DAA0D"
|
|
10
|
-
}
|
package/build/test/Lib/index.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// generated by Neptune Namespaces v4.x.x
|
|
2
|
-
// file: test/Lib/index.js
|
|
3
|
-
|
|
4
|
-
(module.exports = require('./namespace'))
|
|
5
|
-
|
|
6
|
-
.addModules({
|
|
7
|
-
FsEasyTest: require('./FsEasy.test'),
|
|
8
|
-
LibMiscTest: require('./LibMisc.test'),
|
|
9
|
-
PromiseWorkerPoolTest: require('./PromiseWorkerPool.test'),
|
|
10
|
-
S3KeysTest: require('./S3Keys.test')
|
|
11
|
-
});
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
"use strict"
|
|
2
|
-
let Caf = require('caffeine-script-runtime');
|
|
3
|
-
Caf.defMod(module, () => {return Caf.importInvoke(["mockS3", "describe", "test", "S3Comprehensions", "assert", "S3P", "getLargeFileList"], [global, require('./StandardImport'), require('./TestLib')], (mockS3, describe, test, S3Comprehensions, assert, S3P, getLargeFileList) => {let smallMockFs; smallMockFs = mockS3("alpha", "beta", "gamma"); return describe({map: function() {test("no map or reduce", () => S3Comprehensions.map({quiet: true, limit: 2, s3: smallMockFs}).then((result) => assert.eq(result.length, 3))); test("custom map", () => S3Comprehensions.map({quiet: true, limit: 2, s3: smallMockFs, map: ({Size}) => Size}).then((result) => assert.eq(result, [5, 4, 5]))); test("example: total-size", () => S3Comprehensions.map({quiet: true, s3: smallMockFs, map: ({Size}) => Size, reduce: (a, b) => a + b}).then((result) => assert.eq(result, 14))); test("example: smallest", () => S3Comprehensions.map({quiet: true, s3: smallMockFs, reduce: (a, b) => (a.Size < b.Size) ? a : b}).then((result) => assert.eq(result.Key, "beta"))); return test("example: newest", () => S3Comprehensions.map({quiet: true, s3: smallMockFs, reduce: (a, b) => (a != null) ? (a.LastModified < b.LastModified) ? b : a : b, finally: ({Key}) => `KEY: ${Caf.toString(Key)}`}).then((result) => {assert.isString(result); assert.match(result, /^KEY/); return assert.present(result);}));}, each: function() {test("3-items", () => S3Comprehensions.each({quiet: true, limit: 2, s3: smallMockFs}).then((result) => assert.eq(result.items, 3))); return test("10-items", () => {let items10, into, i1; items10 = (into = [], i1 = 0, (() => {while (i1 < 10) {let i; i = i1; into.push(`a${Caf.toString(i)}`); i1++;};})(), into); return S3Comprehensions.each({quiet: true, limit: 2, s3: mockS3(...items10)}).then((result) => assert.eq(result.items, 10));});}, summarize: function() {test("3-items", () => S3P.summarize({quiet: true, limit: 2, s3: smallMockFs}).then((result) => assert.selectedEq({items: 3, size: 14}, result))); return test("largeList", () => getLargeFileList().then((files) => S3P.summarize({quiet: true, s3: mockS3(files)}).then((result) => assert.selectedEq({items: files.length, size: files.join("").length}, result))));}});});});
|
|
4
|
-
//# sourceMappingURL=S3Comprehensions.test.js.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"file": "S3Comprehensions.test.js",
|
|
4
|
-
"sourceRoot": "../..",
|
|
5
|
-
"sources": [
|
|
6
|
-
"source/test/S3Comprehensions.test.caf"
|
|
7
|
-
],
|
|
8
|
-
"names": [],
|
|
9
|
-
"mappings": "AAAA;;AAAA,oJAAO,6BAAiB,sHAExB,cAAc,OACZ,SACA,QACA,iBAEF,SAAQ,CACN,iBACE,KAAK,0BACH,sBACE,OAAO,MACP,OAAO,GACP,IAAI,mBAEA,CAAC,WACL,UACE,eACA,MAEN,KAAK,oBACH,sBACE,OAAO,MACP,OAAO,GACP,IAAI,aACJ,KAAK,CAAC,CAAC,UAAU,YAEb,CAAC,WACL,UACE,SACA,GAAE,GAAE,OAEV,KAAK,6BACH,sBACE,OAAO,MACP,IAAI,aACJ,KAAK,CAAC,CAAC,UAAU,MACjB,QAAQ,CAAC,GAAG,MAAM,IAAI,SAElB,CAAC,WACL,UACE,QACA,OAEN,KAAK,2BACH,qBAAoB,CAClB,OAAO,MACP,IAAI,aACJ,QAAQ,CAAC,GAAG,MAAS,UAAS,UAAY,IAAO,SAE7C,CAAC,WACL,UACE,YACA,kBAEN,KAAK,yBACH,qBAAoB,CAClB,OAAO,MACP,IAAI,aACJ,QAAQ,CAAC,GAAG,MACV,CAAG,aACE,kBAAiB,kBAAoB,IAAO,IAC5C,GACP,SAAS,CAAC,CAAC,8BAAmB,cAE1B,CAAC,YACL,gBAAgB,SAChB,aAAa,QAAQ,gBACrB,eAAe,eAErB,kBACE,KAAK,iBACH,uBACE,OAAO,MACP,OAAO,GACP,IAAI,mBAEA,CAAC,WACL,UACE,cACA,aAEN,KAAK,0CACH,gFAA8B,iBAAI,kCAClC,sBAAqB,CACnB,OAAO,MACP,OAAO,GACP,IAAI,OAAO,mBAEP,CAAC,WACL,UACE,cACA,WAER,uBACE,KAAK,iBACH,eACE,OAAO,MACP,OAAO,GACP,IAAI,mBACA,CAAC,WACL,mBACE,OAAO,GACP,MAAM,KACN,kBAEN,KAAK,mBACH,wBACM,CAAC,UACL,cAAa,CACX,OAAO,MACP,IAAI,OAAO,cAEP,CAAC,WACL,kBAAiB,CACf,OAAQ,cACR,MAAQ,WAAW,aACnB"
|
|
10
|
-
}
|
package/build/test/S3P.test.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
"use strict"
|
|
2
|
-
let Caf = require('caffeine-script-runtime');
|
|
3
|
-
Caf.defMod(module, () => {return Caf.importInvoke(["describe", "test", "S3Comprehensions", "mockS3", "assert", "getLargeFileList"], [global, require('./StandardImport'), require('./TestLib')], (describe, test, S3Comprehensions, mockS3, assert, getLargeFileList) => {return describe({each: function() {test("3-items", () => S3Comprehensions.each({limit: 2, quiet: true, s3: mockS3("alpha", "beta", "gamma")}).then((out) => assert.selectedEq({items: 3}, out))); test("limit:3", () => S3Comprehensions.each({quiet: true, limit: 3, s3: mockS3("alpha", "beta", "gamma")}).then((out) => assert.selectedEq({items: 3}, out))); test("limit:4", () => S3Comprehensions.each({quiet: true, limit: 4, s3: mockS3("alpha", "beta", "gamma")}).then((out) => assert.selectedEq({items: 3}, out))); test("limit:2 large common prefix", () => S3Comprehensions.each({quiet: true, limit: 2, s3: mockS3("some/path/to/my/files/alpha", "some/path/to/my/files/beta", "some/path/to/my/files/gamma")}).then((out) => assert.selectedEq({items: 3}, out))); test("each_custom_count_3", () => {let count, files; count = 0; return S3Comprehensions.each({quiet: true, limit: 2, map: () => count++, s3: mockS3(files = ["alpha", "beta", "gamma"])}).then((out) => {assert.eq(files.length, count); return assert.eq(out.items, count);});}); test("each_custom_count_10", () => {let count, files; count = 0; return S3Comprehensions.each({quiet: true, limit: 2, map: () => count++, s3: mockS3(files = ["059", "0934t09g", "alpha", "alpha123", "alpha9", "as09df", "asd", "asdf", "beta", "gamma"])}).then((out) => {assert.eq(files.length, count); return assert.eq(out.items, count);});}); return test("largeList", () => getLargeFileList().then((files) => S3Comprehensions.each({quiet: true, s3: mockS3(files)}).then((result) => assert.selectedEq({items: files.length}, result))));}});});});
|
|
4
|
-
//# sourceMappingURL=S3P.test.js.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"file": "S3P.test.js",
|
|
4
|
-
"sourceRoot": "../..",
|
|
5
|
-
"sources": [
|
|
6
|
-
"source/test/S3P.test.caf"
|
|
7
|
-
],
|
|
8
|
-
"names": [],
|
|
9
|
-
"mappings": "AAAA;;AAAA,6IAAO,6BAAiB,gGAExB,gBAAQ,CACN,kBACE,KAAK,iBACH,sBAAqB,CACnB,OAAO,GACP,OAAO,MACP,IAAI,OACF,SACA,QACA,gBAEE,CAAC,QACL,mBACE,OAAO,IACP,QAEN,KAAK,iBACH,sBAAqB,CACnB,OAAO,MACP,OAAO,GACP,IAAI,OACF,SACA,QACA,gBAEE,CAAC,QACL,mBACE,OAAO,IACP,QAGN,KAAK,iBACH,sBAAqB,CACnB,OAAO,MACP,OAAO,GACP,IAAI,OACF,SACA,QACA,gBAEE,CAAC,QACL,mBACE,OAAO,IACP,QAEN,KAAK,qCACH,sBAAqB,CACnB,OAAO,MACP,OAAO,GACP,IAAI,OACF,+BACA,8BACA,sCAEE,CAAC,QACL,mBACE,OAAO,IACP,QAEN,KAAK,gDACH,QAAQ,UACR,sBAAqB,CACnB,OAAO,MACP,OAAO,GACP,WAAQ,SACR,IAAI,OAAO,SACT,SACA,QACA,iBAEE,CAAC,SACL,UAAU,cAAc,eACxB,UAAU,WAAW,cAEzB,KAAK,iDACH,QAAQ,UACR,sBAAqB,CACnB,OAAO,MACP,OAAO,GACP,WAAQ,SACR,IAAI,OAAO,SACT,OACA,YACA,SACA,YACA,UACA,UACA,OACA,QACA,QACA,iBAEE,CAAC,SACL,UAAU,cAAc,eACxB,UAAU,WAAW,qBAEzB,KAAK,mBACH,wBACM,CAAC,UACL,sBAAqB,CACnB,OAAO,MACP,IAAI,OAAO,cAEP,CAAC,WACL,kBAAiB,CACf,OAAQ,eACR"
|
|
10
|
-
}
|
package/build/test/S3PCli.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
let Caf = require("caffeine-script-runtime");
|
|
3
|
-
Caf.defMod(module, () => {
|
|
4
|
-
return Caf.importInvoke(
|
|
5
|
-
["test", "assert", "S3PCli"],
|
|
6
|
-
[global, require("./StandardImport")],
|
|
7
|
-
(test, assert, S3PCli) => {
|
|
8
|
-
return test("S3PCli", function () {
|
|
9
|
-
return assert.match(S3PCli.main({ argv: ["version"] }), /foo/);
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
);
|
|
13
|
-
});
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
"use strict"
|
|
2
|
-
let Caf = require('caffeine-script-runtime');
|
|
3
|
-
Caf.defMod(module, () => {return Caf.importInvoke(["test", "S3PCli", "assert"], [global, require('./StandardImport')], (test, S3PCli, assert) => {return test("S3PCli", function() {let output; output = []; return S3PCli.main({output: (out) => output.push(out), argv: ["nodeJs", "s3p", "version"]}).then((version) => {assert.match(version, /^\d+\.\d+\.\d+$/); return assert.eq(output, [version]);});});});});
|
|
4
|
-
//# sourceMappingURL=S3PCli.test.js.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"file": "S3PCli.test.js",
|
|
4
|
-
"sourceRoot": "../..",
|
|
5
|
-
"sources": [
|
|
6
|
-
"source/test/S3PCli.test.caf"
|
|
7
|
-
],
|
|
8
|
-
"names": [],
|
|
9
|
-
"mappings": "AAAA;;AAAA,yFAAO,yDAEP,YAAK,kCACH,oBACA,YAAW,CACT,QAAQ,CAAC,QAAQ,YAAY,MAC7B,OAAS,UAAQ,OAAK,kBAClB,CAAC,aACL,aACE,SACA,2BAUF,UACE,SACG"
|
|
10
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
"use strict"
|
|
2
|
-
let Caf = require('caffeine-script-runtime');
|
|
3
|
-
Caf.defMod(module, () => {return require('art-standard-lib').mergeWithSelf(require('art-testbench'), require('../S3Parallel'), require('../S3Parallel').Lib, require('../S3Parallel').S3P, require('../S3Parallel').S3Comprehensions);});
|
|
4
|
-
//# sourceMappingURL=StandardImport.js.map
|
package/build/test/TestLib.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
"use strict"
|
|
2
|
-
let Caf = require('caffeine-script-runtime');
|
|
3
|
-
Caf.defMod(module, () => {return Caf.importInvoke(["compactFlatten", "Promise", "Date", "randomString"], [global, require('./StandardImport')], (compactFlatten, Promise, Date, randomString) => {let _largeListP, mockS3, generateLargeFileList, getLargeFileList; _largeListP = null; return {mockS3: mockS3 = function(...keys) {keys = compactFlatten(keys).sort(); return {list: ({limit = 1000, startAfter}) => {let count; count = 0; return Promise.then(() => Caf.array(keys, (file) => {count++; return {Key: file, Size: file.length, LastModified: new Date, ETag: "abc123", StorageClass: "STANDARD", Owner: {DisplayName: "john", ID: "abc123"}};}, (file) => file > startAfter && count < limit));}};}, generateLargeFileList: generateLargeFileList = function() {let paths, out; paths = ["run1/job-status//", "run2/job-status/", "run2/sync-status/", "run2/fluffy/", "run2/upload-status/", "run2/output/"]; return Caf.each2(paths, (path) => {let into, i1; return (into = out, i1 = 0, (() => {while (i1 < 10000) {let i; i = i1; into.push(`${Caf.toString(path)}${Caf.toString(randomString())}`); i1++;};})(), into);}, null, out = []).sort();}, getLargeFileList: getLargeFileList = function() {return _largeListP != null ? _largeListP : _largeListP = Promise.then(generateLargeFileList);}};});});
|
|
4
|
-
//# sourceMappingURL=TestLib.js.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"file": "TestLib.js",
|
|
4
|
-
"sourceRoot": "../..",
|
|
5
|
-
"sources": [
|
|
6
|
-
"source/test/TestLib.caf"
|
|
7
|
-
],
|
|
8
|
-
"names": [],
|
|
9
|
-
"mappings": "AAAA;;AAAA,kHAAO,kJAEP,cAAc,cAoBZ,iBAAM,QAAG,CAAC,UACR,OACE,eAAe,sBAGjB,MAAM,CAAC,CAAC,cAAY,4BAClB,QAAQ,UACR,aAAY,gBACI,iBACZ,iBACA,KAAgB,MAChB,MAAgB,aAChB,cAAgB,IAAI,MACpB,MAAgB,UAChB,cAAgB,YAChB,QACE,aAAc,QACd,IAAc,mEAGxB,+CAAqB,4BACnB,SACE,qBACA,oBACA,qBACA,gBACA,uBACA,wBAEF,UAAa,gCAAmB,eACP,kEAAG,gBACnB,qBAAO,oEAIlB,qCAAgB,YAAK,OACnB,oCAAW,cAAI,aAAa"
|
|
10
|
-
}
|
package/build/test/index.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// generated by Neptune Namespaces v4.x.x
|
|
2
|
-
// file: test/index.js
|
|
3
|
-
|
|
4
|
-
(module.exports = require('./namespace'))
|
|
5
|
-
|
|
6
|
-
.addModules({
|
|
7
|
-
S3ComprehensionsTest: require('./S3Comprehensions.test'),
|
|
8
|
-
S3PTest: require('./S3P.test'),
|
|
9
|
-
S3PCli: require('./S3PCli'),
|
|
10
|
-
S3PCliTest: require('./S3PCli.test'),
|
|
11
|
-
StandardImport: require('./StandardImport'),
|
|
12
|
-
TestLib: require('./TestLib')
|
|
13
|
-
});
|
|
14
|
-
require('./Lib');
|
package/build/test/namespace.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// generated by Neptune Namespaces v4.x.x
|
|
2
|
-
// file: test/namespace.js
|
|
3
|
-
|
|
4
|
-
module.exports = require('neptune-namespaces-runtime').addNamespace(
|
|
5
|
-
'Test',
|
|
6
|
-
(class Test extends Neptune.PackageNamespace {})
|
|
7
|
-
._configureNamespace(require('../../package.json'))
|
|
8
|
-
);
|
|
9
|
-
require('./Lib/namespace');
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import &StandardImport, {} &mockFs
|
|
2
|
-
|
|
3
|
-
describe
|
|
4
|
-
createParentDirs: ->
|
|
5
|
-
test "no-op" -> # just hates mockFs
|
|
6
|
-
##
|
|
7
|
-
beforeAll ->
|
|
8
|
-
mockFs {}
|
|
9
|
-
|
|
10
|
-
afterAll ->
|
|
11
|
-
mockFs.restore()
|
|
12
|
-
|
|
13
|
-
chainedTest "createParentDirs foo/bar.txt" ->
|
|
14
|
-
createParentDirs :foo/bar.txt
|
|
15
|
-
.then (numCreated) ->
|
|
16
|
-
assert.eq numCreated, 1
|
|
17
|
-
|
|
18
|
-
.thenTest "called twice" ->
|
|
19
|
-
createParentDirs :foo/bar.txt
|
|
20
|
-
.then (numCreated) ->
|
|
21
|
-
assert.eq numCreated, 0
|
|
22
|
-
|
|
23
|
-
.thenTest "many subdirs" ->
|
|
24
|
-
createParentDirs :foo/baz/bud/bob/bar.txt
|
|
25
|
-
.then (numCreated) ->
|
|
26
|
-
assert.eq numCreated, 3
|
|
27
|
-
|
|
28
|
-
test "race condidtion" ->
|
|
29
|
-
Promise.all []
|
|
30
|
-
createParentDirs :race/bar.txt
|
|
31
|
-
createParentDirs :race/bar.txt
|
|
32
|
-
.then ([a, b]) ->
|
|
33
|
-
assert.eq a + b, 1
|
|
34
|
-
assert.ok a == 0 || b == 0
|
|
35
|
-
|
|
36
|
-
test "scratchState" ->
|
|
37
|
-
createParentDirs :withss/bar.text, scratchState = {}
|
|
38
|
-
.then ->
|
|
39
|
-
assert.eq 1, objectKeyCount scratchState
|
|
40
|
-
each entry in scratchState
|
|
41
|
-
assert.isPromise entry
|
|
42
|
-
|
|
43
|
-
Promise.all Object.values scratchState
|
|
44
|
-
|
|
45
|
-
test "createWriteStreamSafe :food/baz" ->
|
|
46
|
-
createWriteStreamSafe :food/baz
|
|
47
|
-
.then (writeStream) ->
|
|
48
|
-
writeStream.close()
|
|
49
|
-
|
|
50
|
-
# findAllFiles: ->
|
|
51
|
-
# mockedFs =
|
|
52
|
-
# folderA: object i til 10 with-key "" file#{i}.txt
|
|
53
|
-
# "" contents
|
|
54
|
-
# folderB: folderC: object i til 3 with-key "" image0#{i}.png
|
|
55
|
-
# "" contents
|
|
56
|
-
# README.md: "" Read it!
|
|
57
|
-
|
|
58
|
-
# beforeAll ->
|
|
59
|
-
# mockFs mockedFs
|
|
60
|
-
|
|
61
|
-
# afterAll ->
|
|
62
|
-
# mockFs.restore()
|
|
63
|
-
|
|
64
|
-
# each expected, path in
|
|
65
|
-
# folderA: mockedFs.folderA
|
|
66
|
-
# test "findAllFiles '#{path}'" ->
|
|
67
|
-
# findAllFiles path
|
|
68
|
-
# .then (result) ->
|
|
69
|
-
# assert.eq result, expected
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import &StandardImport
|
|
2
|
-
|
|
3
|
-
each [input, output] in []
|
|
4
|
-
0 0_B
|
|
5
|
-
10 10_B
|
|
6
|
-
1023 1023_B
|
|
7
|
-
10240 10.00kB
|
|
8
|
-
1024**1 1.00kB
|
|
9
|
-
1024**2 1.00mB
|
|
10
|
-
1024**3 1.00gB
|
|
11
|
-
1024**4 1.00tB
|
|
12
|
-
1024**5 1.00pB
|
|
13
|
-
1024**6 1.00eB
|
|
14
|
-
|
|
15
|
-
1024**1 - 1 1023_B
|
|
16
|
-
1024**2 - 1 1024.00kB
|
|
17
|
-
1024**3 - 1 1024.00mB
|
|
18
|
-
1024**4 - 1 1024.00gB
|
|
19
|
-
1024**5 - 1 1024.00tB
|
|
20
|
-
1024**6 - 100 1024.00pB
|
|
21
|
-
|
|
22
|
-
test "humanByteSize #{input} >> #{output}" ->
|
|
23
|
-
assert.eq
|
|
24
|
-
humanByteSize input
|
|
25
|
-
output
|
|
26
|
-
|
|
27
|
-
each [output, args...] in []
|
|
28
|
-
[] :s3://my-bucket/my-key :my-bucket null :my-key
|
|
29
|
-
[] :my-folder/my-key :my-bucket :my-folder :my-key
|
|
30
|
-
[] :my-folder/my-key null :my-folder :my-key
|
|
31
|
-
|
|
32
|
-
test "createS3Url #{args.join ', '} >> #{output}" ->
|
|
33
|
-
assert.eq
|
|
34
|
-
createS3Url args...
|
|
35
|
-
output
|
|
36
|
-
|
|
37
|
-
test "shellExec pwd" ->
|
|
38
|
-
shellExec "pwd"
|
|
39
|
-
.then (out) ->
|
|
40
|
-
assert.match out, "\/s3p"
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import &StandardImport
|
|
2
|
-
|
|
3
|
-
test :pwp ->
|
|
4
|
-
currentlyActive = 0
|
|
5
|
-
maxActive = 0
|
|
6
|
-
totalDone = 0
|
|
7
|
-
|
|
8
|
-
doWork = ->
|
|
9
|
-
currentlyActive++
|
|
10
|
-
# log "" work-start #{currentlyActive}/#{maxActive}
|
|
11
|
-
maxActive = max currentlyActive, maxActive
|
|
12
|
-
timeout 1
|
|
13
|
-
.then ->
|
|
14
|
-
totalDone++
|
|
15
|
-
# log "" work-end #{currentlyActive}/#{maxActive}
|
|
16
|
-
currentlyActive--
|
|
17
|
-
|
|
18
|
-
pwp = new PromiseWorkerPool poolSize = 10
|
|
19
|
-
|
|
20
|
-
Promise.all array til numQueued = 100
|
|
21
|
-
pwp.queue doWork
|
|
22
|
-
|
|
23
|
-
.then ->
|
|
24
|
-
log {} currentlyActive, maxActive, poolSize, numQueued
|
|
25
|
-
assert.eq maxActive, poolSize
|
|
26
|
-
assert.eq totalDone, numQueued
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
import &StandardImport
|
|
2
|
-
|
|
3
|
-
describe
|
|
4
|
-
getUpToNextSlash: ->
|
|
5
|
-
test ":this/is/ok 0 -> :this/ " -> assert.eq :this/ getUpToNextSlash :this/is/ok 0
|
|
6
|
-
test ":this/is/ok 4 -> :this/ " -> assert.eq :this/ getUpToNextSlash :this/is/ok 4
|
|
7
|
-
test ":this/is/ok 5 -> :this/is/" -> assert.eq :this/is/ getUpToNextSlash :this/is/ok 5
|
|
8
|
-
test ":this/is/ok 6 -> :this/is/" -> assert.eq :this/is/ getUpToNextSlash :this/is/ok 6
|
|
9
|
-
test ":this/is/ok 7 -> :this/is/" -> assert.eq :this/is/ getUpToNextSlash :this/is/ok 7
|
|
10
|
-
test "undefined if no /" -> assert.eq undefined, getUpToNextSlash "this", 0
|
|
11
|
-
test "undefined if > last /" -> assert.eq undefined, getUpToNextSlash "this/is/okthere", 10
|
|
12
|
-
test "undefined if > length" -> assert.eq undefined, getUpToNextSlash "this/is/ok", 100
|
|
13
|
-
|
|
14
|
-
debugKey: ->
|
|
15
|
-
test "debugKey :a" ->
|
|
16
|
-
assert.match
|
|
17
|
-
debugKey :a
|
|
18
|
-
/^a +$/
|
|
19
|
-
|
|
20
|
-
test "debugKey ''" ->
|
|
21
|
-
assert.match
|
|
22
|
-
debugKey ''
|
|
23
|
-
"'' "
|
|
24
|
-
|
|
25
|
-
test "debugKey :ab~~~~~~~~~~~" ->
|
|
26
|
-
assert.eq
|
|
27
|
-
debugKey :ab + repeat lastKeyChar, 10
|
|
28
|
-
"ab(~*10) "
|
|
29
|
-
|
|
30
|
-
getBisectKey:
|
|
31
|
-
|
|
32
|
-
nulls_and_errors: ->
|
|
33
|
-
test
|
|
34
|
-
"" matching returns null
|
|
35
|
-
-> assert.notPresent getBisectKey :a :a
|
|
36
|
-
|
|
37
|
-
test
|
|
38
|
-
"" invalid char in first param
|
|
39
|
-
-> assert.rejects -> getBisectKey "\n" :a
|
|
40
|
-
|
|
41
|
-
test
|
|
42
|
-
"" invalid char in second param
|
|
43
|
-
-> assert.rejects -> getBisectKey :b :😀
|
|
44
|
-
|
|
45
|
-
test
|
|
46
|
-
"" reverse-order returns null
|
|
47
|
-
-> assert.notPresent getBisectKey :b :a
|
|
48
|
-
|
|
49
|
-
basic: ->
|
|
50
|
-
test
|
|
51
|
-
"" :alpha :alphadude -> :b
|
|
52
|
-
-> assert.eq :alphaB getBisectKey :alpha :alphadude
|
|
53
|
-
|
|
54
|
-
test
|
|
55
|
-
"" "alpha" "alpha me" -> "alpha "
|
|
56
|
-
-> assert.eq "alpha " getBisectKey :alpha "alpha me"
|
|
57
|
-
|
|
58
|
-
test
|
|
59
|
-
"" "alpha" "alpha " -> "alpha "
|
|
60
|
-
-> assert.eq "alpha " getBisectKey :alpha "alpha "
|
|
61
|
-
|
|
62
|
-
test
|
|
63
|
-
"" :a :c -> :b
|
|
64
|
-
-> assert.eq :b getBisectKey :a :c
|
|
65
|
-
|
|
66
|
-
test
|
|
67
|
-
"" :alphabet :c -> :b
|
|
68
|
-
-> assert.eq :b getBisectKey :alphabet :c
|
|
69
|
-
|
|
70
|
-
test
|
|
71
|
-
"" :aa :ac -> :ab
|
|
72
|
-
-> assert.eq "aa#{middleKeyChar}" getBisectKey :aa :ab
|
|
73
|
-
|
|
74
|
-
test
|
|
75
|
-
"" with spaces
|
|
76
|
-
-> assert.eq
|
|
77
|
-
"" My `
|
|
78
|
-
getBisectKey
|
|
79
|
-
"My Other thing.bar"
|
|
80
|
-
"My report.foo"
|
|
81
|
-
|
|
82
|
-
bisectPrefix:
|
|
83
|
-
dirAware: ->
|
|
84
|
-
|
|
85
|
-
each [a, b, out] in []
|
|
86
|
-
[] :alpha/beta :z getLastKeyWithPrefix :alpha/
|
|
87
|
-
[] :alpha/beta/gamma :alpha/boomTown getLastKeyWithPrefix :alpha/beta/
|
|
88
|
-
[] :alpha/beta :alpha/foo :alpha/d
|
|
89
|
-
[] :run2/bcl-sync-status/39e8278706c47520c03865b84b06921a :u getLastKeyWithPrefix :run2/
|
|
90
|
-
test "#{a} #{b} -> #{out.slice(0, 25)}#{"..." if out.length > 25}" ->
|
|
91
|
-
assert.eq out, getBisectKey a, b, true
|
|
92
|
-
|
|
93
|
-
basic: ->
|
|
94
|
-
test
|
|
95
|
-
"" :a :c -> :b~...
|
|
96
|
-
-> assert.eq :b getBisectKey :a :c true
|
|
97
|
-
|
|
98
|
-
test
|
|
99
|
-
"" "alpha" "alpha me" -> "alpha "
|
|
100
|
-
-> assert.eq "alpha " getBisectKey :alpha "alpha me" true
|
|
101
|
-
|
|
102
|
-
test
|
|
103
|
-
"" :alpha :alphadude -> :alphaB
|
|
104
|
-
-> assert.eq :alphaB getBisectKey :alpha :alphadude true
|
|
105
|
-
|
|
106
|
-
test
|
|
107
|
-
"" :alphabet :c -> :alph~...
|
|
108
|
-
-> assert.eq
|
|
109
|
-
:b
|
|
110
|
-
getBisectKey :alphabet :c true
|
|
111
|
-
|
|
112
|
-
test
|
|
113
|
-
"" :alphabet :alpi -> :alpha~...
|
|
114
|
-
-> assert.eq
|
|
115
|
-
:alpho
|
|
116
|
-
getBisectKey :alphabet :alpi true
|
|
117
|
-
|
|
118
|
-
regressions: ->
|
|
119
|
-
test
|
|
120
|
-
"" :alpha :T -> notPresent
|
|
121
|
-
-> assert.notPresent getBisectKey :alpha :T
|
|
122
|
-
|
|
123
|
-
test
|
|
124
|
-
"" :alpha :alphb -> :alpha#{middleKeyChar}
|
|
125
|
-
-> assert.eq "alpha#{middleKeyChar}" getBisectKey :alpha :alphb
|
|
126
|
-
|
|
127
|
-
test
|
|
128
|
-
"" :./.git/objects/17/3d216b08fff7c71eeb7bf1c7d5e8aef789461e :./.git/obk -> :./.git/objq
|
|
129
|
-
-> assert.eq :./.git/objq getBisectKey :./.git/objects/17/3d216b08fff7c71eeb7bf1c7d5e8aef789461e :./.git/obk
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import &StandardImport, &TestLib
|
|
2
|
-
|
|
3
|
-
smallMockFs = mockS3
|
|
4
|
-
:alpha
|
|
5
|
-
:beta
|
|
6
|
-
:gamma
|
|
7
|
-
|
|
8
|
-
describe
|
|
9
|
-
map: ->
|
|
10
|
-
test "no map or reduce" ->
|
|
11
|
-
S3Comprehensions.map
|
|
12
|
-
quiet: true
|
|
13
|
-
limit: 2
|
|
14
|
-
s3: smallMockFs
|
|
15
|
-
|
|
16
|
-
.then (result) ->
|
|
17
|
-
assert.eq
|
|
18
|
-
result.length
|
|
19
|
-
3
|
|
20
|
-
|
|
21
|
-
test "custom map" ->
|
|
22
|
-
S3Comprehensions.map
|
|
23
|
-
quiet: true
|
|
24
|
-
limit: 2
|
|
25
|
-
s3: smallMockFs
|
|
26
|
-
map: ({Size}) -> Size
|
|
27
|
-
|
|
28
|
-
.then (result) ->
|
|
29
|
-
assert.eq
|
|
30
|
-
result
|
|
31
|
-
5 4 5
|
|
32
|
-
|
|
33
|
-
test "example: total-size" ->
|
|
34
|
-
S3Comprehensions.map
|
|
35
|
-
quiet: true
|
|
36
|
-
s3: smallMockFs
|
|
37
|
-
map: ({Size}) -> Size
|
|
38
|
-
reduce: (a, b) -> a + b
|
|
39
|
-
|
|
40
|
-
.then (result) ->
|
|
41
|
-
assert.eq
|
|
42
|
-
result
|
|
43
|
-
14
|
|
44
|
-
|
|
45
|
-
test "example: smallest" ->
|
|
46
|
-
S3Comprehensions.map
|
|
47
|
-
quiet: true
|
|
48
|
-
s3: smallMockFs
|
|
49
|
-
reduce: (a, b) -> if a.Size < b.Size then a else b
|
|
50
|
-
|
|
51
|
-
.then (result) ->
|
|
52
|
-
assert.eq
|
|
53
|
-
result.Key
|
|
54
|
-
:beta
|
|
55
|
-
|
|
56
|
-
test "example: newest" ->
|
|
57
|
-
S3Comprehensions.map
|
|
58
|
-
quiet: true
|
|
59
|
-
s3: smallMockFs
|
|
60
|
-
reduce: (a, b) ->
|
|
61
|
-
if a?
|
|
62
|
-
if a.LastModified < b.LastModified then b else a
|
|
63
|
-
else b
|
|
64
|
-
finally: ({Key}) => "" KEY: #{Key}
|
|
65
|
-
|
|
66
|
-
.then (result) ->
|
|
67
|
-
assert.isString result
|
|
68
|
-
assert.match result, /^KEY/
|
|
69
|
-
assert.present result
|
|
70
|
-
|
|
71
|
-
each: ->
|
|
72
|
-
test :3-items ->
|
|
73
|
-
S3Comprehensions.each
|
|
74
|
-
quiet: true
|
|
75
|
-
limit: 2
|
|
76
|
-
s3: smallMockFs
|
|
77
|
-
|
|
78
|
-
.then (result) ->
|
|
79
|
-
assert.eq
|
|
80
|
-
result.items
|
|
81
|
-
3
|
|
82
|
-
|
|
83
|
-
test :10-items ->
|
|
84
|
-
items10 = array i til 10 with "a#{i}"
|
|
85
|
-
S3Comprehensions.each
|
|
86
|
-
quiet: true
|
|
87
|
-
limit: 2
|
|
88
|
-
s3: mockS3 items10...
|
|
89
|
-
|
|
90
|
-
.then (result) ->
|
|
91
|
-
assert.eq
|
|
92
|
-
result.items
|
|
93
|
-
10
|
|
94
|
-
|
|
95
|
-
summarize: ->
|
|
96
|
-
test :3-items ->
|
|
97
|
-
S3P.summarize
|
|
98
|
-
quiet: true
|
|
99
|
-
limit: 2
|
|
100
|
-
s3: smallMockFs
|
|
101
|
-
.then (result) ->
|
|
102
|
-
assert.selectedEq
|
|
103
|
-
items: 3
|
|
104
|
-
size: 14
|
|
105
|
-
result
|
|
106
|
-
|
|
107
|
-
test :largeList ->
|
|
108
|
-
getLargeFileList()
|
|
109
|
-
.then (files) ->
|
|
110
|
-
S3P.summarize
|
|
111
|
-
quiet: true
|
|
112
|
-
s3: mockS3 files
|
|
113
|
-
|
|
114
|
-
.then (result) ->
|
|
115
|
-
assert.selectedEq
|
|
116
|
-
items: files.length
|
|
117
|
-
size: files.join('').length
|
|
118
|
-
result
|
package/source/test/S3P.test.caf
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import &StandardImport, &TestLib
|
|
2
|
-
|
|
3
|
-
describe
|
|
4
|
-
each: ->
|
|
5
|
-
test :3-items ->
|
|
6
|
-
S3Comprehensions.each
|
|
7
|
-
limit: 2
|
|
8
|
-
quiet: true
|
|
9
|
-
s3: mockS3
|
|
10
|
-
:alpha
|
|
11
|
-
:beta
|
|
12
|
-
:gamma
|
|
13
|
-
|
|
14
|
-
.then (out) ->
|
|
15
|
-
assert.selectedEq
|
|
16
|
-
items: 3
|
|
17
|
-
out
|
|
18
|
-
|
|
19
|
-
test "limit:3" ->
|
|
20
|
-
S3Comprehensions.each
|
|
21
|
-
quiet: true
|
|
22
|
-
limit: 3
|
|
23
|
-
s3: mockS3
|
|
24
|
-
:alpha
|
|
25
|
-
:beta
|
|
26
|
-
:gamma
|
|
27
|
-
|
|
28
|
-
.then (out) ->
|
|
29
|
-
assert.selectedEq
|
|
30
|
-
items: 3
|
|
31
|
-
out
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
test "limit:4" ->
|
|
35
|
-
S3Comprehensions.each
|
|
36
|
-
quiet: true
|
|
37
|
-
limit: 4
|
|
38
|
-
s3: mockS3
|
|
39
|
-
:alpha
|
|
40
|
-
:beta
|
|
41
|
-
:gamma
|
|
42
|
-
|
|
43
|
-
.then (out) ->
|
|
44
|
-
assert.selectedEq
|
|
45
|
-
items: 3
|
|
46
|
-
out
|
|
47
|
-
|
|
48
|
-
test "limit:2 large common prefix" ->
|
|
49
|
-
S3Comprehensions.each
|
|
50
|
-
quiet: true
|
|
51
|
-
limit: 2
|
|
52
|
-
s3: mockS3
|
|
53
|
-
:some/path/to/my/files/alpha
|
|
54
|
-
:some/path/to/my/files/beta
|
|
55
|
-
:some/path/to/my/files/gamma
|
|
56
|
-
|
|
57
|
-
.then (out) ->
|
|
58
|
-
assert.selectedEq
|
|
59
|
-
items: 3
|
|
60
|
-
out
|
|
61
|
-
|
|
62
|
-
test :each_custom_count_3 ->
|
|
63
|
-
count = 0
|
|
64
|
-
S3Comprehensions.each
|
|
65
|
-
quiet: true
|
|
66
|
-
limit: 2
|
|
67
|
-
map: -> count++
|
|
68
|
-
s3: mockS3 files =
|
|
69
|
-
:alpha
|
|
70
|
-
:beta
|
|
71
|
-
:gamma
|
|
72
|
-
|
|
73
|
-
.then (out) ->
|
|
74
|
-
assert.eq files.length, count
|
|
75
|
-
assert.eq out.items, count
|
|
76
|
-
|
|
77
|
-
test :each_custom_count_10 ->
|
|
78
|
-
count = 0
|
|
79
|
-
S3Comprehensions.each
|
|
80
|
-
quiet: true
|
|
81
|
-
limit: 2
|
|
82
|
-
map: -> count++
|
|
83
|
-
s3: mockS3 files =
|
|
84
|
-
:059
|
|
85
|
-
:0934t09g
|
|
86
|
-
:alpha
|
|
87
|
-
:alpha123
|
|
88
|
-
:alpha9
|
|
89
|
-
:as09df
|
|
90
|
-
:asd
|
|
91
|
-
:asdf
|
|
92
|
-
:beta
|
|
93
|
-
:gamma
|
|
94
|
-
|
|
95
|
-
.then (out) ->
|
|
96
|
-
assert.eq files.length, count
|
|
97
|
-
assert.eq out.items, count
|
|
98
|
-
|
|
99
|
-
test :largeList ->
|
|
100
|
-
getLargeFileList()
|
|
101
|
-
.then (files) ->
|
|
102
|
-
S3Comprehensions.each
|
|
103
|
-
quiet: true
|
|
104
|
-
s3: mockS3 files
|
|
105
|
-
|
|
106
|
-
.then (result) ->
|
|
107
|
-
assert.selectedEq
|
|
108
|
-
items: files.length
|
|
109
|
-
result
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import &StandardImport
|
|
2
|
-
|
|
3
|
-
test "S3PCli" ->
|
|
4
|
-
output = []
|
|
5
|
-
S3PCli.main
|
|
6
|
-
output: (out) => output.push out
|
|
7
|
-
argv: [] :nodeJs :s3p :version
|
|
8
|
-
.then (version) ->
|
|
9
|
-
assert.match
|
|
10
|
-
version
|
|
11
|
-
///
|
|
12
|
-
^
|
|
13
|
-
\d+
|
|
14
|
-
\.
|
|
15
|
-
\d+
|
|
16
|
-
\.
|
|
17
|
-
\d+
|
|
18
|
-
$
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
assert.eq
|
|
22
|
-
output
|
|
23
|
-
[] version
|
package/source/test/TestLib.caf
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import &StandardImport
|
|
2
|
-
|
|
3
|
-
_largeListP = null
|
|
4
|
-
|
|
5
|
-
{}
|
|
6
|
-
|
|
7
|
-
##
|
|
8
|
-
IN: keys: strings to use as Keys
|
|
9
|
-
OUT:
|
|
10
|
-
mocked AWS S3 sdk implementing minimal api:"
|
|
11
|
-
|
|
12
|
-
##
|
|
13
|
-
IN: only limit and startAfter are supported (all S3P needs)
|
|
14
|
-
OUT:
|
|
15
|
-
list of objects with these keys:
|
|
16
|
-
Key: one of the passed in key-strings
|
|
17
|
-
Size: Key.length:
|
|
18
|
-
for easy testing, the size of simulated keys are the length of their keys
|
|
19
|
-
list: ({limit, startAfter}) ->
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#listObjectsV2-property
|
|
23
|
-
mockS3 = (keys...) ->
|
|
24
|
-
keys =
|
|
25
|
-
compactFlatten keys
|
|
26
|
-
.sort()
|
|
27
|
-
|
|
28
|
-
list: ({limit=1000, startAfter}) ->
|
|
29
|
-
count = 0
|
|
30
|
-
Promise.then ->
|
|
31
|
-
array file in keys when file > startAfter && count < limit
|
|
32
|
-
count++
|
|
33
|
-
Key: file
|
|
34
|
-
Size: file.length
|
|
35
|
-
LastModified: new Date
|
|
36
|
-
ETag: :abc123
|
|
37
|
-
StorageClass: :STANDARD
|
|
38
|
-
Owner:
|
|
39
|
-
DisplayName: :john
|
|
40
|
-
ID: :abc123
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
generateLargeFileList = ->
|
|
44
|
-
paths =
|
|
45
|
-
:run1/job-status//
|
|
46
|
-
:run2/job-status/
|
|
47
|
-
:run2/sync-status/
|
|
48
|
-
:run2/fluffy/
|
|
49
|
-
:run2/upload-status/
|
|
50
|
-
:run2/output/
|
|
51
|
-
|
|
52
|
-
each path in paths into out = []
|
|
53
|
-
array i til 10000 into out
|
|
54
|
-
"" #{path}#{randomString()}
|
|
55
|
-
|
|
56
|
-
.sort()
|
|
57
|
-
|
|
58
|
-
getLargeFileList = ->
|
|
59
|
-
_largeListP ?= Promise.then generateLargeFileList
|