s3p 3.4.7 → 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.
Files changed (33) hide show
  1. package/package.json +1 -1
  2. package/build/test/Lib/FsEasy.test.js +0 -4
  3. package/build/test/Lib/FsEasy.test.js.map +0 -10
  4. package/build/test/Lib/LibMisc.test.js +0 -4
  5. package/build/test/Lib/LibMisc.test.js.map +0 -10
  6. package/build/test/Lib/PromiseWorkerPool.test.js +0 -4
  7. package/build/test/Lib/PromiseWorkerPool.test.js.map +0 -10
  8. package/build/test/Lib/S3Keys.test.js +0 -4
  9. package/build/test/Lib/S3Keys.test.js.map +0 -10
  10. package/build/test/Lib/index.js +0 -11
  11. package/build/test/Lib/namespace.js +0 -7
  12. package/build/test/S3Comprehensions.test.js +0 -4
  13. package/build/test/S3Comprehensions.test.js.map +0 -10
  14. package/build/test/S3P.test.js +0 -4
  15. package/build/test/S3P.test.js.map +0 -10
  16. package/build/test/S3PCli.js +0 -13
  17. package/build/test/S3PCli.test.js +0 -4
  18. package/build/test/S3PCli.test.js.map +0 -10
  19. package/build/test/StandardImport.js +0 -4
  20. package/build/test/StandardImport.js.map +0 -10
  21. package/build/test/TestLib.js +0 -4
  22. package/build/test/TestLib.js.map +0 -10
  23. package/build/test/index.js +0 -14
  24. package/build/test/namespace.js +0 -9
  25. package/source/test/Lib/FsEasy.test.caf +0 -69
  26. package/source/test/Lib/LibMisc.test.caf +0 -40
  27. package/source/test/Lib/PromiseWorkerPool.test.caf +0 -26
  28. package/source/test/Lib/S3Keys.test.caf +0 -170
  29. package/source/test/S3Comprehensions.test.caf +0 -118
  30. package/source/test/S3P.test.caf +0 -109
  31. package/source/test/S3PCli.test.caf +0 -23
  32. package/source/test/StandardImport.caf +0 -6
  33. package/source/test/TestLib.caf +0 -59
package/package.json CHANGED
@@ -50,7 +50,7 @@
50
50
  "test": "npm run nn\njest",
51
51
  "watch": "npm-watch"
52
52
  },
53
- "version": "3.4.7",
53
+ "version": "3.4.8",
54
54
  "watch": {
55
55
  "build": {
56
56
  "extensions": [
@@ -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,10 +0,0 @@
1
- {
2
- "version": 3,
3
- "file": "FsEasy.test.js",
4
- "sourceRoot": "../../..",
5
- "sources": [
6
- "source/test/Lib/FsEasy.test.caf"
7
- ],
8
- "names": [],
9
- "mappings": "AAAA;;AAAA,iFAAO,+BAAoB,mDAE3B,gBAAQ,CACN,8BAAoB,OAClB,KAAK"
10
- }
@@ -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", "pad", "getNextKey", "isLastKey", "getBisectKey", "middleKeyChar", "getLastKeyWithPrefix"], [global, require('../StandardImport')], (describe, test, assert, getUpToNextSlash, debugKey, repeat, lastKeyChar, pad, getNextKey, isLastKey, 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) "));}, getNextKey: function() {let nextKeyMap; nextKeyMap = {a: "a~", "~": "~~", [pad("b", 1023, "~")]: pad("b", 1024, "~"), [pad("b", 1024, "~")]: "c", [pad("bc", 1024, "~")]: "bd", [pad("b~c", 1024, "~")]: "b~d"}; Caf.each2(nextKeyMap, (nextKey, key) => test(`getNextKey ${Caf.toString(key)} >>> ${Caf.toString(nextKey)}`, () => assert.eq(nextKey, getNextKey(key)))); test("isLastKey (the very last key) >>> error", () => assert.true(isLastKey(pad("", 1024, "~")))); return test("getNextKey (the very last key) >>> error", () => {let lastKey; lastKey = pad("", 1024, "~"); return assert.throws(() => getNextKey(lastKey));});}, 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"))); test(":./.git/objects/17/3d216b08fff7c71eeb7bf1c7d5e8aef789461e :./.git/obk -> :./.git/objq", () => assert.eq("./.git/objq", getBisectKey("./.git/objects/17/3d216b08fff7c71eeb7bf1c7d5e8aef789461e", "./.git/obk"))); test("tildeSpecial: :2/~~ :20 -> :2/~~~", () => assert.eq("2/~~~", getBisectKey("2/~~", "20"))); test("tildeSpecial: :2/~~(+1020 more) :20999 -> :20", () => assert.eq("20", getBisectKey(pad("2/", 1024, "~"), "20999"))); test("tildeSpecial: :2/~~(+1020 more) :20 -> :20", () => assert.eq("20", getBisectKey(pad("2/", 1024, "~"), "20"))); return test("tildeSpecial: original regression", () => assert.eq("filestores/kss/20", getBisectKey("filestores/kss/2/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", "filestores/kss/20/2001-page798-2.v0.7")));}}});});});
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,+OAAO,4LAEP,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,wCACE,aAAU,CACR,GAAI,MACJ,KAAI,MACJ,CAAC,IAAI,KAAI,MAAM,OAAO,IAAI,KAAI,MAAM,MACpC,CAAC,IAAI,KAAI,MAAM,OAAO,KACtB,CAAC,IAAI,MAAK,MAAM,OAAM,MACtB,CAAC,IAAI,OAAM,MAAM,OAAK,kBAEH,8BACnB,gCAAmB,yBAAW,kBAC5B,UAAU,SAAS,WAAW,SAElC,KAAK,iDACH,YAAY,UAAU,IAAI,IAAI,MAAM,gBAEtC,KAAK,gEACH,UAAU,IAAI,IAAI,MAAM,aACxB,cAAa,MAAI,WAAW,gBAEhC,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,YAE3D,KACI,+FACC,UAAU,eAAa,aAAa,4DAA0D,iBAEnG,KACI,2CACC,UAAU,SAAO,aAAa,QAAM,SAEzC,KACI,uDACC,UAAU,MAAI,aAAa,IAAI,MAAM,MAAM,MAAM,YAEtD,KACI,oDACC,UAAU,MAAI,aAAa,IAAI,MAAM,MAAM,MAAM,gBAEtD,KACI,2CAEA,UACE,qBACA,aACE,ogCACA"
10
- }
@@ -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,7 +0,0 @@
1
- // generated by Neptune Namespaces v4.x.x
2
- // file: test/Lib/namespace.js
3
-
4
- module.exports = require('../namespace').addNamespace(
5
- 'Lib',
6
- class Lib extends Neptune.PackageNamespace {}
7
- );
@@ -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
- }
@@ -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
- }
@@ -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
@@ -1,10 +0,0 @@
1
- {
2
- "version": 3,
3
- "file": "StandardImport.js",
4
- "sourceRoot": "../..",
5
- "sources": [
6
- "source/test/StandardImport.caf"
7
- ],
8
- "names": [],
9
- "mappings": "AAAA;;AAAA,2EACE,0BACA,0BACA,8BACA,8BACA"
10
- }
@@ -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
- }
@@ -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');
@@ -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,170 +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
- getNextKey: ->
31
- nextKeyMap =
32
- a: :a~
33
- ~: :~~
34
- [pad :b, 1023, :~]: pad :b, 1024, :~
35
- [pad :b, 1024, :~]: :c
36
- [pad :bc, 1024, :~]: :bd
37
- [pad :b~c, 1024, :~]: :b~d
38
-
39
- each nextKey, key in nextKeyMap
40
- test "getNextKey #{key} >>> #{nextKey}" ->
41
- assert.eq nextKey, getNextKey key
42
-
43
- test "isLastKey (the very last key) >>> error" ->
44
- assert.true isLastKey pad '', 1024, '~'
45
-
46
- test "getNextKey (the very last key) >>> error" ->
47
- lastKey = pad '', 1024, '~'
48
- assert.throws -> getNextKey lastKey
49
-
50
- getBisectKey:
51
-
52
- nulls_and_errors: ->
53
- test
54
- "" matching returns null
55
- -> assert.notPresent getBisectKey :a :a
56
-
57
- test
58
- "" invalid char in first param
59
- -> assert.rejects -> getBisectKey "\n" :a
60
-
61
- test
62
- "" invalid char in second param
63
- -> assert.rejects -> getBisectKey :b :😀
64
-
65
- test
66
- "" reverse-order returns null
67
- -> assert.notPresent getBisectKey :b :a
68
-
69
- basic: ->
70
- test
71
- "" :alpha :alphadude -> :b
72
- -> assert.eq :alphaB getBisectKey :alpha :alphadude
73
-
74
- test
75
- "" "alpha" "alpha me" -> "alpha "
76
- -> assert.eq "alpha " getBisectKey :alpha "alpha me"
77
-
78
- test
79
- "" "alpha" "alpha " -> "alpha "
80
- -> assert.eq "alpha " getBisectKey :alpha "alpha "
81
-
82
- test
83
- "" :a :c -> :b
84
- -> assert.eq :b getBisectKey :a :c
85
-
86
- test
87
- "" :alphabet :c -> :b
88
- -> assert.eq :b getBisectKey :alphabet :c
89
-
90
- test
91
- "" :aa :ac -> :ab
92
- -> assert.eq "aa#{middleKeyChar}" getBisectKey :aa :ab
93
-
94
- test
95
- "" with spaces
96
- -> assert.eq
97
- "" My `
98
- getBisectKey
99
- "My Other thing.bar"
100
- "My report.foo"
101
-
102
- bisectPrefix:
103
- dirAware: ->
104
-
105
- each [a, b, out] in []
106
- [] :alpha/beta :z getLastKeyWithPrefix :alpha/
107
- [] :alpha/beta/gamma :alpha/boomTown getLastKeyWithPrefix :alpha/beta/
108
- [] :alpha/beta :alpha/foo :alpha/d
109
- [] :run2/bcl-sync-status/39e8278706c47520c03865b84b06921a :u getLastKeyWithPrefix :run2/
110
- test "#{a} #{b} -> #{out.slice(0, 25)}#{"..." if out.length > 25}" ->
111
- assert.eq out, getBisectKey a, b, true
112
-
113
- basic: ->
114
- test
115
- "" :a :c -> :b~...
116
- -> assert.eq :b getBisectKey :a :c true
117
-
118
- test
119
- "" "alpha" "alpha me" -> "alpha "
120
- -> assert.eq "alpha " getBisectKey :alpha "alpha me" true
121
-
122
- test
123
- "" :alpha :alphadude -> :alphaB
124
- -> assert.eq :alphaB getBisectKey :alpha :alphadude true
125
-
126
- test
127
- "" :alphabet :c -> :alph~...
128
- -> assert.eq
129
- :b
130
- getBisectKey :alphabet :c true
131
-
132
- test
133
- "" :alphabet :alpi -> :alpha~...
134
- -> assert.eq
135
- :alpho
136
- getBisectKey :alphabet :alpi true
137
-
138
- regressions: ->
139
- test
140
- "" :alpha :T -> notPresent
141
- -> assert.notPresent getBisectKey :alpha :T
142
-
143
- test
144
- "" :alpha :alphb -> :alpha#{middleKeyChar}
145
- -> assert.eq "alpha#{middleKeyChar}" getBisectKey :alpha :alphb
146
-
147
- test
148
- "" :./.git/objects/17/3d216b08fff7c71eeb7bf1c7d5e8aef789461e :./.git/obk -> :./.git/objq
149
- -> assert.eq :./.git/objq getBisectKey :./.git/objects/17/3d216b08fff7c71eeb7bf1c7d5e8aef789461e :./.git/obk
150
-
151
- test
152
- "" tildeSpecial: :2/~~ :20 -> :2/~~~
153
- -> assert.eq :2/~~~ getBisectKey :2/~~ :20
154
-
155
- test
156
- "" tildeSpecial: :2/~~(+1020 more) :20999 -> :20
157
- -> assert.eq :20 getBisectKey pad("2/", 1024, "~"), :20999
158
-
159
- test
160
- "" tildeSpecial: :2/~~(+1020 more) :20 -> :20
161
- -> assert.eq :20 getBisectKey pad("2/", 1024, "~"), :20
162
-
163
- test
164
- "" tildeSpecial: original regression
165
- ->
166
- assert.eq
167
- :filestores/kss/20
168
- getBisectKey
169
- :filestores/kss/2/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
170
- :filestores/kss/20/2001-page798-2.v0.7
@@ -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
@@ -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
@@ -1,6 +0,0 @@
1
- &ArtStandardLib.mergeWithSelf
2
- &ArtTestbench
3
- &S3Parallel
4
- &S3Parallel.Lib
5
- &S3Parallel.S3P
6
- &S3Parallel.S3Comprehensions
@@ -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