From 7787c611787463c7d68e1400b98bfe5e88fe4d44 Mon Sep 17 00:00:00 2001 From: Maxim Zaytsev Date: Wed, 16 Dec 2020 06:08:30 -0800 Subject: [PATCH 1/9] migrate to node10 --- Tasks/FtpUploadV1/package-lock.json | 372 ++++++++++++++++++++++++++-- Tasks/FtpUploadV1/package.json | 8 +- Tasks/FtpUploadV1/task.json | 6 +- Tasks/FtpUploadV1/task.loc.json | 6 +- 4 files changed, 363 insertions(+), 29 deletions(-) diff --git a/Tasks/FtpUploadV1/package-lock.json b/Tasks/FtpUploadV1/package-lock.json index c3c4810ae9e0..61ea1fa5ed9e 100644 --- a/Tasks/FtpUploadV1/package-lock.json +++ b/Tasks/FtpUploadV1/package-lock.json @@ -4,34 +4,64 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@types/concat-stream": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@types/concat-stream/-/concat-stream-1.6.0.tgz", + "integrity": "sha1-OU2+C7X+5Gs42JZzXoto7yOQ0A0=", + "requires": { + "@types/node": "*" + } + }, + "@types/form-data": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/@types/form-data/-/form-data-0.0.33.tgz", + "integrity": "sha1-yayFsqX9GENbjIXZ7LUObWyJP/g=", + "requires": { + "@types/node": "*" + } + }, + "@types/mocha": { + "version": "5.2.7", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.7.tgz", + "integrity": "sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ==" + }, "@types/node": { - "version": "6.0.117", - "resolved": "https://registry.npmjs.org/@types/node/-/node-6.0.117.tgz", - "integrity": "sha512-sihk0SnN8PpiS5ihu5xJQ5ddnURNq4P+XPmW+nORlKkHy21CoZO/IVHK/Wq/l3G8fFW06Fkltgnqx229uPlnRg==" + "version": "10.17.49", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.49.tgz", + "integrity": "sha512-PGaJNs5IZz5XgzwJvL/1zRfZB7iaJ5BydZ8/Picm+lUNYoNO9iVTQkVy5eUh0dZDrx3rBOIs3GCbCRmMuYyqwg==" }, "@types/q": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.1.tgz", "integrity": "sha512-eqz8c/0kwNi/OEHQfvIuJVLTst3in0e7uTKeuY+WL/zfKn0xVujOTp42bS/vUUokhK5P2BppLd9JXMOMHcgbjA==" }, + "@types/qs": { + "version": "6.9.5", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.5.tgz", + "integrity": "sha512-/JHkVHtx/REVG0VVToGRGH2+23hsYLHdyG+GrvoUGlGAd0ErauXDyvHtRI/7H7mzLm+tBCKA7pfcpkQ1lf58iQ==" + }, + "asap": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=" + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, "azure-pipelines-task-lib": { - "version": "2.9.3", - "resolved": "https://registry.npmjs.org/azure-pipelines-task-lib/-/azure-pipelines-task-lib-2.9.3.tgz", - "integrity": "sha512-SPWKSfgmjyBDVIMzXnnPH0Gv7YXZ+AQ3SyIhNNALAmQpOltqJhgslvzrOClR5rKuoOyJlG0AWZILbZIXCkztAA==", + "version": "3.0.6-preview.0", + "resolved": "https://registry.npmjs.org/azure-pipelines-task-lib/-/azure-pipelines-task-lib-3.0.6-preview.0.tgz", + "integrity": "sha512-Fx+7p5GzvYqVXOQI+LhPk56Pio9yBeEyypKZoPI9cQyti8WTVkmJ7YZwn9HRXurftcLumi2Xq+TC3PwnDq5U5Q==", "requires": { "minimatch": "3.0.4", "mockery": "^1.7.0", - "q": "^1.1.2", + "q": "^1.5.1", "semver": "^5.1.0", - "shelljs": "^0.3.0", + "shelljs": "^0.8.4", + "sync-request": "6.1.0", "uuid": "^3.0.1" - }, - "dependencies": { - "uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" - } } }, "balanced-match": { @@ -48,16 +78,94 @@ "concat-map": "0.0.1" } }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==" + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "requires": { + "delayed-stream": "~1.0.0" + } + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + }, + "form-data": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz", + "integrity": "sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + }, "ftp": { "version": "0.3.10", "resolved": "https://registry.npmjs.org/ftp/-/ftp-0.3.10.tgz", @@ -67,16 +175,101 @@ "xregexp": "2.0.0" } }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "get-port": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/get-port/-/get-port-3.2.0.tgz", + "integrity": "sha1-3Xzn3hh8Bsi/NTeWrHHgmfCYDrw=" + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "requires": { + "function-bind": "^1.1.1" + } + }, + "http-basic": { + "version": "8.1.3", + "resolved": "https://registry.npmjs.org/http-basic/-/http-basic-8.1.3.tgz", + "integrity": "sha512-/EcDMwJZh3mABI2NhGfHOGOeOZITqfkEO4p/xK+l3NpyncIHUQBoMvCSF/b5GqvKtySC2srL/GGG3+EtlqlmCw==", + "requires": { + "caseless": "^0.12.0", + "concat-stream": "^1.6.2", + "http-response-object": "^3.0.1", + "parse-cache-control": "^1.0.1" + } + }, + "http-response-object": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/http-response-object/-/http-response-object-3.0.2.tgz", + "integrity": "sha512-bqX0XTF6fnXSQcEJ2Iuyr75yVakyjIDCqroJQ/aHfSdlM743Cwqoi2nDYMzLGWUcuTWGWy8AAvOKXTfiv6q9RA==", + "requires": { + "@types/node": "^10.0.3" + } + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, "inherits": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" }, + "interpret": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", + "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==" + }, + "is-core-module": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz", + "integrity": "sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==", + "requires": { + "has": "^1.0.3" + } + }, "isarray": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" }, + "mime-db": { + "version": "1.44.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", + "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==" + }, + "mime-types": { + "version": "2.1.27", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", + "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", + "requires": { + "mime-db": "1.44.0" + } + }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", @@ -90,11 +283,52 @@ "resolved": "https://registry.npmjs.org/mockery/-/mockery-1.7.0.tgz", "integrity": "sha1-9O3g2HUMHJcnwnLqLGBiniyaHE8=" }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1" + } + }, + "parse-cache-control": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parse-cache-control/-/parse-cache-control-1.0.1.tgz", + "integrity": "sha1-juqz5U+laSD+Fro493+iGqzC104=" + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + }, + "promise": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/promise/-/promise-8.1.0.tgz", + "integrity": "sha512-W04AqnILOL/sPRXziNicCjSNRruLAuIHEOVBazepu0545DDNGYHz7ar9ZgZ1fMU8/MA4mVxp5rkBWRi6OXIy3Q==", + "requires": { + "asap": "~2.0.6" + } + }, "q": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=" }, + "qs": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.4.tgz", + "integrity": "sha512-A1kFqHekCTM7cz0udomYUoYNWjBebHm/5wzU/XqrBRBNWectVH0QIiN+NEcZ0Dte5hvzHwbr8+XQmguPhJ6WdQ==" + }, "readable-stream": { "version": "1.1.14", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", @@ -106,21 +340,117 @@ "string_decoder": "~0.10.x" } }, + "rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", + "requires": { + "resolve": "^1.1.6" + } + }, + "resolve": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", + "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", + "requires": { + "is-core-module": "^2.1.0", + "path-parse": "^1.0.6" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, "semver": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", - "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==" + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" }, "shelljs": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.3.0.tgz", - "integrity": "sha1-NZbmMHp4FUT1kfN9phg2DzHbV7E=" + "version": "0.8.4", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.4.tgz", + "integrity": "sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==", + "requires": { + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" + } }, "string_decoder": { "version": "0.10.31", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" }, + "sync-request": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/sync-request/-/sync-request-6.1.0.tgz", + "integrity": "sha512-8fjNkrNlNCrVc/av+Jn+xxqfCjYaBoHqCsDz6mt030UMxJGr+GSfCV1dQt2gRtlL63+VPidwDVLr7V2OcTSdRw==", + "requires": { + "http-response-object": "^3.0.1", + "sync-rpc": "^1.2.1", + "then-request": "^6.0.0" + } + }, + "sync-rpc": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/sync-rpc/-/sync-rpc-1.3.6.tgz", + "integrity": "sha512-J8jTXuZzRlvU7HemDgHi3pGnh/rkoqR/OZSjhTyyZrEkkYQbk7Z33AXp37mkPfPpfdOuj7Ex3H/TJM1z48uPQw==", + "requires": { + "get-port": "^3.1.0" + } + }, + "then-request": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/then-request/-/then-request-6.0.2.tgz", + "integrity": "sha512-3ZBiG7JvP3wbDzA9iNY5zJQcHL4jn/0BWtXIkagfz7QgOL/LqjCEOBQuJNZfu0XYnv5JhKh+cDxCPM4ILrqruA==", + "requires": { + "@types/concat-stream": "^1.6.0", + "@types/form-data": "0.0.33", + "@types/node": "^8.0.0", + "@types/qs": "^6.2.31", + "caseless": "~0.12.0", + "concat-stream": "^1.6.0", + "form-data": "^2.2.0", + "http-basic": "^8.1.1", + "http-response-object": "^3.0.1", + "promise": "^8.0.0", + "qs": "^6.4.0" + }, + "dependencies": { + "@types/node": { + "version": "8.10.66", + "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.66.tgz", + "integrity": "sha512-tktOkFUA4kXx2hhhrB8bIFb5TbwzS4uOhKEmwiD+NoiL0qtP2OQ9mFldbgD4dV1djrlBYP6eBuQZiWjuHUpqFw==" + } + } + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" + }, + "typescript": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.2.tgz", + "integrity": "sha512-e4ERvRV2wb+rRZ/IQeb3jm2VxBsirQLpQhdxplZ2MEzGvDkkMmPglecnNDfSUBivMjP93vRbngYYDQqQ/78bcQ==", + "dev": true + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, "xregexp": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/xregexp/-/xregexp-2.0.0.tgz", diff --git a/Tasks/FtpUploadV1/package.json b/Tasks/FtpUploadV1/package.json index 8ab21a96f1b5..afddb7d5c303 100644 --- a/Tasks/FtpUploadV1/package.json +++ b/Tasks/FtpUploadV1/package.json @@ -14,10 +14,14 @@ }, "homepage": "https://github.com/Microsoft/azure-pipelines-tasks#readme", "dependencies": { - "@types/node": "^6.0.101", + "@types/node": "^10.17.0", + "@types/mocha": "^5.2.7", "@types/q": "^1.0.7", - "azure-pipelines-task-lib": "^2.9.3", + "azure-pipelines-task-lib": "^3.0.6-preview.0", "ftp": "0.3.10", "minimatch": "^3.0.4" + }, + "devDependencies": { + "typescript": "4.0.2" } } diff --git a/Tasks/FtpUploadV1/task.json b/Tasks/FtpUploadV1/task.json index d9b2fe8e0a51..48b27fcc7c71 100644 --- a/Tasks/FtpUploadV1/task.json +++ b/Tasks/FtpUploadV1/task.json @@ -18,8 +18,8 @@ "demands": [], "version": { "Major": 1, - "Minor": 165, - "Patch": 2 + "Minor": 181, + "Patch": 0 }, "instanceNameFormat": "FTP Upload: $(rootFolder)", "groups": [ @@ -160,7 +160,7 @@ } ], "execution": { - "Node": { + "Node10": { "target": "ftpuploadtask.js", "argumentFormat": "" } diff --git a/Tasks/FtpUploadV1/task.loc.json b/Tasks/FtpUploadV1/task.loc.json index e2bd667562df..4206779ffab9 100644 --- a/Tasks/FtpUploadV1/task.loc.json +++ b/Tasks/FtpUploadV1/task.loc.json @@ -18,8 +18,8 @@ "demands": [], "version": { "Major": 1, - "Minor": 165, - "Patch": 2 + "Minor": 181, + "Patch": 0 }, "instanceNameFormat": "ms-resource:loc.instanceNameFormat", "groups": [ @@ -160,7 +160,7 @@ } ], "execution": { - "Node": { + "Node10": { "target": "ftpuploadtask.js", "argumentFormat": "" } From ca951f42f7f1f3be950ca309e65ecb03c84b09cd Mon Sep 17 00:00:00 2001 From: Maxim Zaytsev Date: Mon, 21 Dec 2020 06:44:17 -0800 Subject: [PATCH 2/9] Add L0 tests for ftpuploadtask (migrate from legacy) --- Tasks/FtpUploadV1/Tests/L0.ts | 139 +++++++++++++++++- Tasks/FtpUploadV1/Tests/L0NoClean.ts | 43 ++++++ Tasks/FtpUploadV1/Tests/L0NoFilePatterns.ts | 41 ++++++ Tasks/FtpUploadV1/Tests/L0NoHostName.ts | 50 +++++++ Tasks/FtpUploadV1/Tests/L0NoOverwrite.ts | 44 ++++++ Tasks/FtpUploadV1/Tests/L0NoPreservePaths.ts | 45 ++++++ Tasks/FtpUploadV1/Tests/L0NoProtocol.ts | 50 +++++++ Tasks/FtpUploadV1/Tests/L0NoRemotePath.ts | 42 ++++++ Tasks/FtpUploadV1/Tests/L0NoRootFolder.ts | 40 +++++ Tasks/FtpUploadV1/Tests/L0NoServerEndpoint.ts | 40 +++++ Tasks/FtpUploadV1/Tests/L0NoTrustSSL.ts | 46 ++++++ 11 files changed, 576 insertions(+), 4 deletions(-) create mode 100644 Tasks/FtpUploadV1/Tests/L0NoClean.ts create mode 100644 Tasks/FtpUploadV1/Tests/L0NoFilePatterns.ts create mode 100644 Tasks/FtpUploadV1/Tests/L0NoHostName.ts create mode 100644 Tasks/FtpUploadV1/Tests/L0NoOverwrite.ts create mode 100644 Tasks/FtpUploadV1/Tests/L0NoPreservePaths.ts create mode 100644 Tasks/FtpUploadV1/Tests/L0NoProtocol.ts create mode 100644 Tasks/FtpUploadV1/Tests/L0NoRemotePath.ts create mode 100644 Tasks/FtpUploadV1/Tests/L0NoRootFolder.ts create mode 100644 Tasks/FtpUploadV1/Tests/L0NoServerEndpoint.ts create mode 100644 Tasks/FtpUploadV1/Tests/L0NoTrustSSL.ts diff --git a/Tasks/FtpUploadV1/Tests/L0.ts b/Tasks/FtpUploadV1/Tests/L0.ts index cd6e81b4ddf3..93babdbe3082 100644 --- a/Tasks/FtpUploadV1/Tests/L0.ts +++ b/Tasks/FtpUploadV1/Tests/L0.ts @@ -1,16 +1,147 @@ import fs = require('fs'); import assert = require('assert'); import path = require('path'); +import * as ttm from 'azure-pipelines-task-lib/mock-test'; describe('FtpUploadV1 Suite', function () { - before(() => { + it('check args: no serverEndpoint', (done: Mocha.Done) => { + this.timeout(parseInt(process.env.TASK_TEST_TIMEOUT || '') || 20000); + + const tp = path.join(__dirname, 'L0NoServerEndpoint.js'); + const tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); + + tr.run(); + + assert(tr.stdOutContained('Input required: serverEndpoint'), 'Should have printed: Input required: serverEndpoint'); + assert(tr.failed, 'task should have failed'); + + done(); + }); + + it('check args: no rootFolder', (done: Mocha.Done) => { + this.timeout(parseInt(process.env.TASK_TEST_TIMEOUT || '') || 20000); + + const tp = path.join(__dirname, 'L0NoRootFolder.js'); + const tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); + + tr.run(); + + assert(tr.stdOutContained('Input required: rootFolder'), 'Should have printed: Input required: rootFolder'); + assert(tr.failed, 'task should have failed'); + + done(); + }); + + it('check args: no filePatterns', (done: Mocha.Done) => { + this.timeout(parseInt(process.env.TASK_TEST_TIMEOUT || '') || 20000); + + const tp = path.join(__dirname, 'L0NoFilePatterns.js'); + const tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); + + tr.run(); + + assert(tr.stdOutContained('Input required: filePatterns'), 'Should have printed: Input required: filePatterns'); + assert(tr.failed, 'task should have failed'); + + done(); + }); + + it('check args: no remotePath', (done: Mocha.Done) => { + this.timeout(parseInt(process.env.TASK_TEST_TIMEOUT || '') || 20000); + + const tp = path.join(__dirname, 'L0NoRemotePath.js'); + const tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); + + tr.run(); + + assert(tr.stdOutContained('Input required: remotePath'), 'Should have printed: Input required: remotePath'); + assert(tr.failed, 'task should have failed'); + + done(); }); - after(() => { + it('check args: no clean', (done: Mocha.Done) => { + this.timeout(parseInt(process.env.TASK_TEST_TIMEOUT || '') || 20000); + + const tp = path.join(__dirname, 'L0NoClean.js'); + const tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); + + tr.run(); + + assert(tr.stdOutContained('Input required: clean'), 'Should have printed: Input required: clean'); + assert(tr.failed, 'task should have failed'); + + done(); }); - it('Does a basic hello world test', function(done: MochaDone) { - // TODO - add real tests + it('check args: no overwrite', (done: Mocha.Done) => { + this.timeout(parseInt(process.env.TASK_TEST_TIMEOUT || '') || 20000); + + const tp = path.join(__dirname, 'L0NoOverwrite.js'); + const tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); + + tr.run(); + + assert(tr.stdOutContained('Input required: overwrite'), 'Should have printed: Input required: overwrite'); + assert(tr.failed, 'task should have failed'); + + done(); + }); + + it('check args: no preservePaths', (done: Mocha.Done) => { + this.timeout(parseInt(process.env.TASK_TEST_TIMEOUT || '') || 20000); + + const tp = path.join(__dirname, 'L0NoPreservePaths.js'); + const tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); + + tr.run(); + + assert(tr.stdOutContained('Input required: preservePaths'), 'Should have printed: Input required: preservePaths'); + assert(tr.failed, 'task should have failed'); + + done(); + }); + + it('check args: no trustSSL', (done: Mocha.Done) => { + this.timeout(parseInt(process.env.TASK_TEST_TIMEOUT || '') || 20000); + + const tp = path.join(__dirname, 'L0NoTrustSSL.js'); + const tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); + + tr.run(); + + assert(tr.invokedToolCount === 0, 'should not run anything'); + assert(tr.stdOutContained('Input required: trustSSL'), 'Should have printed: Input required: trustSSL'); + assert(tr.failed, 'task should have failed'); + + done(); + }); + + it('check args: no protocol on server URL (ftp:// or ftps://)', (done: Mocha.Done) => { + this.timeout(parseInt(process.env.TASK_TEST_TIMEOUT || '') || 20000); + + const tp = path.join(__dirname, 'L0NoProtocol.js'); + const tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); + + tr.run(); + + assert(tr.stdOutContained('loc_mock_FTPNoProtocolSpecified'), 'Should have printed: loc_mock_FTPNoProtocolSpecified'); + assert(tr.failed, 'task should have failed'); + + done(); + }); + + it('check args: no host name on server URL', (done: Mocha.Done) => { + this.timeout(parseInt(process.env.TASK_TEST_TIMEOUT || '') || 20000); + + const tp = path.join(__dirname, 'L0NoHostName.js'); + const tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); + + tr.run(); + + assert(tr.stdOutContained('loc_mock_FTPNoHostSpecified'), 'Should have printed: loc_mock_FTPNoHostSpecified'); + assert(tr.failed, 'task should have failed'); + done(); }); }); diff --git a/Tasks/FtpUploadV1/Tests/L0NoClean.ts b/Tasks/FtpUploadV1/Tests/L0NoClean.ts new file mode 100644 index 000000000000..48fa61287d4a --- /dev/null +++ b/Tasks/FtpUploadV1/Tests/L0NoClean.ts @@ -0,0 +1,43 @@ +import ma = require('azure-pipelines-task-lib/mock-answer'); +import tmrm = require('azure-pipelines-task-lib/mock-run'); +import path = require('path'); + +let taskPath = path.join(__dirname, '..', 'ftpuploadtask.js'); +let tr: tmrm.TaskMockRunner = new tmrm.TaskMockRunner(taskPath); + +tr.setInput('serverEndpoint', 'ID1'); +tr.setInput('rootFolder', 'rootFolder'); +tr.setInput('filePatterns', '**'); +tr.setInput('remotePath', '/upload/'); + +// provide answers for task mock +let a: ma.TaskLibAnswers = { + "osType" : { + "osType" : "Windows" + }, + "getVariable": { + "ENDPOINT_URL_ID1": "ftp://valid.microsoft.com", + "ENDPOINT_AUTH_ID1": "{\"scheme\":\"UsernamePassword\", \"parameters\": {\"username\": \"uname\", \"password\": \"pword\"}}", + "build.sourcesDirectory": "/" + }, + "exist" : { + "rootFolder": true + }, + "find": { + "rootFolder": [ + "rootFolder/a", + "rootFolder/b", + "rootFolder/c" + ] + }, + "match": { + "*": [ + "rootFolder/a", + "rootFolder/b", + "rootFolder/c" + ] + } +}; +tr.setAnswers(a); + +tr.run(); \ No newline at end of file diff --git a/Tasks/FtpUploadV1/Tests/L0NoFilePatterns.ts b/Tasks/FtpUploadV1/Tests/L0NoFilePatterns.ts new file mode 100644 index 000000000000..a50d0ddf3e3b --- /dev/null +++ b/Tasks/FtpUploadV1/Tests/L0NoFilePatterns.ts @@ -0,0 +1,41 @@ +import ma = require('azure-pipelines-task-lib/mock-answer'); +import tmrm = require('azure-pipelines-task-lib/mock-run'); +import path = require('path'); + +let taskPath = path.join(__dirname, '..', 'ftpuploadtask.js'); +let tr: tmrm.TaskMockRunner = new tmrm.TaskMockRunner(taskPath); + +tr.setInput('serverEndpoint', 'ID1'); +tr.setInput('rootFolder', 'rootFolder'); + +// provide answers for task mock +let a: ma.TaskLibAnswers = { + "osType" : { + "osType" : "Windows" + }, + "getVariable": { + "ENDPOINT_URL_ID1": "ftp://valid.microsoft.com", + "ENDPOINT_AUTH_ID1": "{\"scheme\":\"UsernamePassword\", \"parameters\": {\"username\": \"uname\", \"password\": \"pword\"}}", + "build.sourcesDirectory": "/" + }, + "exist" : { + "rootFolder": true + }, + "find": { + "rootFolder": [ + "rootFolder/a", + "rootFolder/b", + "rootFolder/c" + ] + }, + "match": { + "*": [ + "rootFolder/a", + "rootFolder/b", + "rootFolder/c" + ] + } +}; +tr.setAnswers(a); + +tr.run(); \ No newline at end of file diff --git a/Tasks/FtpUploadV1/Tests/L0NoHostName.ts b/Tasks/FtpUploadV1/Tests/L0NoHostName.ts new file mode 100644 index 000000000000..8c35ec733c0c --- /dev/null +++ b/Tasks/FtpUploadV1/Tests/L0NoHostName.ts @@ -0,0 +1,50 @@ +import ma = require('azure-pipelines-task-lib/mock-answer'); +import tmrm = require('azure-pipelines-task-lib/mock-run'); +import path = require('path'); + +let taskPath = path.join(__dirname, '..', 'ftpuploadtask.js'); +let tr: tmrm.TaskMockRunner = new tmrm.TaskMockRunner(taskPath); + +tr.setInput('credsType', 'inputs'); +tr.setInput('serverUrl', 'ftps://'); +tr.setInput('username', 'username'); +tr.setInput('password', 'password'); +tr.setInput('rootFolder', 'rootFolder'); +tr.setInput('filePatterns', '**'); +tr.setInput('remotePath', '/upload/'); +tr.setInput('clean', 'true'); +tr.setInput('overwrite', 'true'); +tr.setInput('preservePaths', 'true'); +tr.setInput('trustSSL', 'true'); + +// provide answers for task mock +let a: ma.TaskLibAnswers = { + "osType" : { + "osType" : "Windows" + }, + "getVariable": { + "ENDPOINT_URL_ID1": "ftp://valid.microsoft.com", + "ENDPOINT_AUTH_ID1": "{\"scheme\":\"UsernamePassword\", \"parameters\": {\"username\": \"uname\", \"password\": \"pword\"}}", + "build.sourcesDirectory": "/" + }, + "exist" : { + "rootFolder": true + }, + "find": { + "rootFolder": [ + "rootFolder/a", + "rootFolder/b", + "rootFolder/c" + ] + }, + "match": { + "*": [ + "rootFolder/a", + "rootFolder/b", + "rootFolder/c" + ] + } +}; +tr.setAnswers(a); + +tr.run(); \ No newline at end of file diff --git a/Tasks/FtpUploadV1/Tests/L0NoOverwrite.ts b/Tasks/FtpUploadV1/Tests/L0NoOverwrite.ts new file mode 100644 index 000000000000..5851c1ab6cee --- /dev/null +++ b/Tasks/FtpUploadV1/Tests/L0NoOverwrite.ts @@ -0,0 +1,44 @@ +import ma = require('azure-pipelines-task-lib/mock-answer'); +import tmrm = require('azure-pipelines-task-lib/mock-run'); +import path = require('path'); + +let taskPath = path.join(__dirname, '..', 'ftpuploadtask.js'); +let tr: tmrm.TaskMockRunner = new tmrm.TaskMockRunner(taskPath); + +tr.setInput('serverEndpoint', 'ID1'); +tr.setInput('rootFolder', 'rootFolder'); +tr.setInput('filePatterns', '**'); +tr.setInput('remotePath', '/upload/'); +tr.setInput('clean', 'true'); + +// provide answers for task mock +let a: ma.TaskLibAnswers = { + "osType" : { + "osType" : "Windows" + }, + "getVariable": { + "ENDPOINT_URL_ID1": "ftp://valid.microsoft.com", + "ENDPOINT_AUTH_ID1": "{\"scheme\":\"UsernamePassword\", \"parameters\": {\"username\": \"uname\", \"password\": \"pword\"}}", + "build.sourcesDirectory": "/" + }, + "exist" : { + "rootFolder": true + }, + "find": { + "rootFolder": [ + "rootFolder/a", + "rootFolder/b", + "rootFolder/c" + ] + }, + "match": { + "*": [ + "rootFolder/a", + "rootFolder/b", + "rootFolder/c" + ] + } +}; +tr.setAnswers(a); + +tr.run(); \ No newline at end of file diff --git a/Tasks/FtpUploadV1/Tests/L0NoPreservePaths.ts b/Tasks/FtpUploadV1/Tests/L0NoPreservePaths.ts new file mode 100644 index 000000000000..48ba38f43b40 --- /dev/null +++ b/Tasks/FtpUploadV1/Tests/L0NoPreservePaths.ts @@ -0,0 +1,45 @@ +import ma = require('azure-pipelines-task-lib/mock-answer'); +import tmrm = require('azure-pipelines-task-lib/mock-run'); +import path = require('path'); + +let taskPath = path.join(__dirname, '..', 'ftpuploadtask.js'); +let tr: tmrm.TaskMockRunner = new tmrm.TaskMockRunner(taskPath); + +tr.setInput('serverEndpoint', 'ID1'); +tr.setInput('rootFolder', 'rootFolder'); +tr.setInput('filePatterns', '**'); +tr.setInput('remotePath', '/upload/'); +tr.setInput('clean', 'true'); +tr.setInput('overwrite', 'true'); + +// provide answers for task mock +let a: ma.TaskLibAnswers = { + "osType" : { + "osType" : "Windows" + }, + "getVariable": { + "ENDPOINT_URL_ID1": "ftp://valid.microsoft.com", + "ENDPOINT_AUTH_ID1": "{\"scheme\":\"UsernamePassword\", \"parameters\": {\"username\": \"uname\", \"password\": \"pword\"}}", + "build.sourcesDirectory": "/" + }, + "exist" : { + "rootFolder": true + }, + "find": { + "rootFolder": [ + "rootFolder/a", + "rootFolder/b", + "rootFolder/c" + ] + }, + "match": { + "*": [ + "rootFolder/a", + "rootFolder/b", + "rootFolder/c" + ] + } +}; +tr.setAnswers(a); + +tr.run(); \ No newline at end of file diff --git a/Tasks/FtpUploadV1/Tests/L0NoProtocol.ts b/Tasks/FtpUploadV1/Tests/L0NoProtocol.ts new file mode 100644 index 000000000000..c52e63bde5d7 --- /dev/null +++ b/Tasks/FtpUploadV1/Tests/L0NoProtocol.ts @@ -0,0 +1,50 @@ +import ma = require('azure-pipelines-task-lib/mock-answer'); +import tmrm = require('azure-pipelines-task-lib/mock-run'); +import path = require('path'); + +let taskPath = path.join(__dirname, '..', 'ftpuploadtask.js'); +let tr: tmrm.TaskMockRunner = new tmrm.TaskMockRunner(taskPath); + +tr.setInput('credsType', 'inputs'); +tr.setInput('serverUrl', 'noprotocol.microsoft.com'); +tr.setInput('username', 'myUsername'); +tr.setInput('password', 'myPassword'); +tr.setInput('rootFolder', 'rootFolder'); +tr.setInput('filePatterns', '**'); +tr.setInput('remotePath', '/upload/'); +tr.setInput('clean', 'true'); +tr.setInput('overwrite', 'true'); +tr.setInput('preservePaths', 'true'); +tr.setInput('trustSSL', 'true'); + +// provide answers for task mock +let a: ma.TaskLibAnswers = { + "osType" : { + "osType" : "Windows" + }, + "getVariable": { + "ENDPOINT_URL_ID1": "ftp://valid.microsoft.com", + "ENDPOINT_AUTH_ID1": "{\"scheme\":\"UsernamePassword\", \"parameters\": {\"username\": \"uname\", \"password\": \"pword\"}}", + "build.sourcesDirectory": "/" + }, + "exist" : { + "rootFolder": true + }, + "find": { + "rootFolder": [ + "rootFolder/a", + "rootFolder/b", + "rootFolder/c" + ] + }, + "match": { + "*": [ + "rootFolder/a", + "rootFolder/b", + "rootFolder/c" + ] + } +}; +tr.setAnswers(a); + +tr.run(); \ No newline at end of file diff --git a/Tasks/FtpUploadV1/Tests/L0NoRemotePath.ts b/Tasks/FtpUploadV1/Tests/L0NoRemotePath.ts new file mode 100644 index 000000000000..7fa1ef619831 --- /dev/null +++ b/Tasks/FtpUploadV1/Tests/L0NoRemotePath.ts @@ -0,0 +1,42 @@ +import ma = require('azure-pipelines-task-lib/mock-answer'); +import tmrm = require('azure-pipelines-task-lib/mock-run'); +import path = require('path'); + +let taskPath = path.join(__dirname, '..', 'ftpuploadtask.js'); +let tr: tmrm.TaskMockRunner = new tmrm.TaskMockRunner(taskPath); + +tr.setInput('serverEndpoint', 'ID1'); +tr.setInput('rootFolder', 'rootFolder'); +tr.setInput('filePatterns', '**'); + +// provide answers for task mock +let a: ma.TaskLibAnswers = { + "osType" : { + "osType" : "Windows" + }, + "getVariable": { + "ENDPOINT_URL_ID1": "ftp://valid.microsoft.com", + "ENDPOINT_AUTH_ID1": "{\"scheme\":\"UsernamePassword\", \"parameters\": {\"username\": \"uname\", \"password\": \"pword\"}}", + "build.sourcesDirectory": "/" + }, + "exist" : { + "rootFolder": true + }, + "find": { + "rootFolder": [ + "rootFolder/a", + "rootFolder/b", + "rootFolder/c" + ] + }, + "match": { + "*": [ + "rootFolder/a", + "rootFolder/b", + "rootFolder/c" + ] + } +}; +tr.setAnswers(a); + +tr.run(); \ No newline at end of file diff --git a/Tasks/FtpUploadV1/Tests/L0NoRootFolder.ts b/Tasks/FtpUploadV1/Tests/L0NoRootFolder.ts new file mode 100644 index 000000000000..7f5cb15a19ce --- /dev/null +++ b/Tasks/FtpUploadV1/Tests/L0NoRootFolder.ts @@ -0,0 +1,40 @@ +import ma = require('azure-pipelines-task-lib/mock-answer'); +import tmrm = require('azure-pipelines-task-lib/mock-run'); +import path = require('path'); + +let taskPath = path.join(__dirname, '..', 'ftpuploadtask.js'); +let tr: tmrm.TaskMockRunner = new tmrm.TaskMockRunner(taskPath); + +tr.setInput('serverEndpoint', 'ID1'); + +// provide answers for task mock +let a: ma.TaskLibAnswers = { + "osType" : { + "osType" : "Windows" + }, + "getVariable": { + "ENDPOINT_URL_ID1": "ftp://valid.microsoft.com", + "ENDPOINT_AUTH_ID1": "{\"scheme\":\"UsernamePassword\", \"parameters\": {\"username\": \"uname\", \"password\": \"pword\"}}", + "build.sourcesDirectory": "/" + }, + "exist" : { + "rootFolder": true + }, + "find": { + "rootFolder": [ + "rootFolder/a", + "rootFolder/b", + "rootFolder/c" + ] + }, + "match": { + "*": [ + "rootFolder/a", + "rootFolder/b", + "rootFolder/c" + ] + } +}; +tr.setAnswers(a); + +tr.run(); \ No newline at end of file diff --git a/Tasks/FtpUploadV1/Tests/L0NoServerEndpoint.ts b/Tasks/FtpUploadV1/Tests/L0NoServerEndpoint.ts new file mode 100644 index 000000000000..757028e5d2fe --- /dev/null +++ b/Tasks/FtpUploadV1/Tests/L0NoServerEndpoint.ts @@ -0,0 +1,40 @@ +import ma = require('azure-pipelines-task-lib/mock-answer'); +import tmrm = require('azure-pipelines-task-lib/mock-run'); +import path = require('path'); + +let taskPath = path.join(__dirname, '..', 'ftpuploadtask.js'); +let tr: tmrm.TaskMockRunner = new tmrm.TaskMockRunner(taskPath); + +tr.setInput('credsType', 'serviceEndpoint'); + +// provide answers for task mock +let a: ma.TaskLibAnswers = { + "osType" : { + "osType" : "Windows" + }, + "getVariable": { + "ENDPOINT_URL_ID1": "ftp://valid.microsoft.com", + "ENDPOINT_AUTH_ID1": "{\"scheme\":\"UsernamePassword\", \"parameters\": {\"username\": \"uname\", \"password\": \"pword\"}}", + "build.sourcesDirectory": "/" + }, + "exist" : { + "rootFolder": true + }, + "find": { + "rootFolder": [ + "rootFolder/a", + "rootFolder/b", + "rootFolder/c" + ] + }, + "match": { + "*": [ + "rootFolder/a", + "rootFolder/b", + "rootFolder/c" + ] + } +}; +tr.setAnswers(a); + +tr.run(); \ No newline at end of file diff --git a/Tasks/FtpUploadV1/Tests/L0NoTrustSSL.ts b/Tasks/FtpUploadV1/Tests/L0NoTrustSSL.ts new file mode 100644 index 000000000000..c2d6420c91dc --- /dev/null +++ b/Tasks/FtpUploadV1/Tests/L0NoTrustSSL.ts @@ -0,0 +1,46 @@ +import ma = require('azure-pipelines-task-lib/mock-answer'); +import tmrm = require('azure-pipelines-task-lib/mock-run'); +import path = require('path'); + +let taskPath = path.join(__dirname, '..', 'ftpuploadtask.js'); +let tr: tmrm.TaskMockRunner = new tmrm.TaskMockRunner(taskPath); + +tr.setInput('serverEndpoint', 'ID1'); +tr.setInput('rootFolder', 'rootFolder'); +tr.setInput('filePatterns', '**'); +tr.setInput('remotePath', '/upload/'); +tr.setInput('clean', 'true'); +tr.setInput('overwrite', 'true'); +tr.setInput('preservePaths', 'true'); + +// provide answers for task mock +let a: ma.TaskLibAnswers = { + "osType" : { + "osType" : "Windows" + }, + "getVariable": { + "ENDPOINT_URL_ID1": "ftp://valid.microsoft.com", + "ENDPOINT_AUTH_ID1": "{\"scheme\":\"UsernamePassword\", \"parameters\": {\"username\": \"uname\", \"password\": \"pword\"}}", + "build.sourcesDirectory": "/" + }, + "exist" : { + "rootFolder": true + }, + "find": { + "rootFolder": [ + "rootFolder/a", + "rootFolder/b", + "rootFolder/c" + ] + }, + "match": { + "*": [ + "rootFolder/a", + "rootFolder/b", + "rootFolder/c" + ] + } +}; +tr.setAnswers(a); + +tr.run(); \ No newline at end of file From a250538a869564b3a1a183945bc438b5f28b1462 Mon Sep 17 00:00:00 2001 From: Maxim Zaytsev Date: Mon, 21 Dec 2020 07:17:19 -0800 Subject: [PATCH 3/9] removed osType from answers --- Tasks/FtpUploadV1/Tests/L0NoClean.ts | 3 --- Tasks/FtpUploadV1/Tests/L0NoFilePatterns.ts | 3 --- Tasks/FtpUploadV1/Tests/L0NoHostName.ts | 3 --- Tasks/FtpUploadV1/Tests/L0NoOverwrite.ts | 3 --- Tasks/FtpUploadV1/Tests/L0NoPreservePaths.ts | 3 --- Tasks/FtpUploadV1/Tests/L0NoProtocol.ts | 3 --- Tasks/FtpUploadV1/Tests/L0NoRemotePath.ts | 3 --- Tasks/FtpUploadV1/Tests/L0NoRootFolder.ts | 3 --- Tasks/FtpUploadV1/Tests/L0NoServerEndpoint.ts | 3 --- Tasks/FtpUploadV1/Tests/L0NoTrustSSL.ts | 3 --- 10 files changed, 30 deletions(-) diff --git a/Tasks/FtpUploadV1/Tests/L0NoClean.ts b/Tasks/FtpUploadV1/Tests/L0NoClean.ts index 48fa61287d4a..e0c4ad749695 100644 --- a/Tasks/FtpUploadV1/Tests/L0NoClean.ts +++ b/Tasks/FtpUploadV1/Tests/L0NoClean.ts @@ -12,9 +12,6 @@ tr.setInput('remotePath', '/upload/'); // provide answers for task mock let a: ma.TaskLibAnswers = { - "osType" : { - "osType" : "Windows" - }, "getVariable": { "ENDPOINT_URL_ID1": "ftp://valid.microsoft.com", "ENDPOINT_AUTH_ID1": "{\"scheme\":\"UsernamePassword\", \"parameters\": {\"username\": \"uname\", \"password\": \"pword\"}}", diff --git a/Tasks/FtpUploadV1/Tests/L0NoFilePatterns.ts b/Tasks/FtpUploadV1/Tests/L0NoFilePatterns.ts index a50d0ddf3e3b..8e3444ba1f04 100644 --- a/Tasks/FtpUploadV1/Tests/L0NoFilePatterns.ts +++ b/Tasks/FtpUploadV1/Tests/L0NoFilePatterns.ts @@ -10,9 +10,6 @@ tr.setInput('rootFolder', 'rootFolder'); // provide answers for task mock let a: ma.TaskLibAnswers = { - "osType" : { - "osType" : "Windows" - }, "getVariable": { "ENDPOINT_URL_ID1": "ftp://valid.microsoft.com", "ENDPOINT_AUTH_ID1": "{\"scheme\":\"UsernamePassword\", \"parameters\": {\"username\": \"uname\", \"password\": \"pword\"}}", diff --git a/Tasks/FtpUploadV1/Tests/L0NoHostName.ts b/Tasks/FtpUploadV1/Tests/L0NoHostName.ts index 8c35ec733c0c..b7e3877412bb 100644 --- a/Tasks/FtpUploadV1/Tests/L0NoHostName.ts +++ b/Tasks/FtpUploadV1/Tests/L0NoHostName.ts @@ -19,9 +19,6 @@ tr.setInput('trustSSL', 'true'); // provide answers for task mock let a: ma.TaskLibAnswers = { - "osType" : { - "osType" : "Windows" - }, "getVariable": { "ENDPOINT_URL_ID1": "ftp://valid.microsoft.com", "ENDPOINT_AUTH_ID1": "{\"scheme\":\"UsernamePassword\", \"parameters\": {\"username\": \"uname\", \"password\": \"pword\"}}", diff --git a/Tasks/FtpUploadV1/Tests/L0NoOverwrite.ts b/Tasks/FtpUploadV1/Tests/L0NoOverwrite.ts index 5851c1ab6cee..3bbddd96337d 100644 --- a/Tasks/FtpUploadV1/Tests/L0NoOverwrite.ts +++ b/Tasks/FtpUploadV1/Tests/L0NoOverwrite.ts @@ -13,9 +13,6 @@ tr.setInput('clean', 'true'); // provide answers for task mock let a: ma.TaskLibAnswers = { - "osType" : { - "osType" : "Windows" - }, "getVariable": { "ENDPOINT_URL_ID1": "ftp://valid.microsoft.com", "ENDPOINT_AUTH_ID1": "{\"scheme\":\"UsernamePassword\", \"parameters\": {\"username\": \"uname\", \"password\": \"pword\"}}", diff --git a/Tasks/FtpUploadV1/Tests/L0NoPreservePaths.ts b/Tasks/FtpUploadV1/Tests/L0NoPreservePaths.ts index 48ba38f43b40..e62cc4cae38e 100644 --- a/Tasks/FtpUploadV1/Tests/L0NoPreservePaths.ts +++ b/Tasks/FtpUploadV1/Tests/L0NoPreservePaths.ts @@ -14,9 +14,6 @@ tr.setInput('overwrite', 'true'); // provide answers for task mock let a: ma.TaskLibAnswers = { - "osType" : { - "osType" : "Windows" - }, "getVariable": { "ENDPOINT_URL_ID1": "ftp://valid.microsoft.com", "ENDPOINT_AUTH_ID1": "{\"scheme\":\"UsernamePassword\", \"parameters\": {\"username\": \"uname\", \"password\": \"pword\"}}", diff --git a/Tasks/FtpUploadV1/Tests/L0NoProtocol.ts b/Tasks/FtpUploadV1/Tests/L0NoProtocol.ts index c52e63bde5d7..b94be5afef47 100644 --- a/Tasks/FtpUploadV1/Tests/L0NoProtocol.ts +++ b/Tasks/FtpUploadV1/Tests/L0NoProtocol.ts @@ -19,9 +19,6 @@ tr.setInput('trustSSL', 'true'); // provide answers for task mock let a: ma.TaskLibAnswers = { - "osType" : { - "osType" : "Windows" - }, "getVariable": { "ENDPOINT_URL_ID1": "ftp://valid.microsoft.com", "ENDPOINT_AUTH_ID1": "{\"scheme\":\"UsernamePassword\", \"parameters\": {\"username\": \"uname\", \"password\": \"pword\"}}", diff --git a/Tasks/FtpUploadV1/Tests/L0NoRemotePath.ts b/Tasks/FtpUploadV1/Tests/L0NoRemotePath.ts index 7fa1ef619831..d16cad0ee3ed 100644 --- a/Tasks/FtpUploadV1/Tests/L0NoRemotePath.ts +++ b/Tasks/FtpUploadV1/Tests/L0NoRemotePath.ts @@ -11,9 +11,6 @@ tr.setInput('filePatterns', '**'); // provide answers for task mock let a: ma.TaskLibAnswers = { - "osType" : { - "osType" : "Windows" - }, "getVariable": { "ENDPOINT_URL_ID1": "ftp://valid.microsoft.com", "ENDPOINT_AUTH_ID1": "{\"scheme\":\"UsernamePassword\", \"parameters\": {\"username\": \"uname\", \"password\": \"pword\"}}", diff --git a/Tasks/FtpUploadV1/Tests/L0NoRootFolder.ts b/Tasks/FtpUploadV1/Tests/L0NoRootFolder.ts index 7f5cb15a19ce..07d04bbda4bf 100644 --- a/Tasks/FtpUploadV1/Tests/L0NoRootFolder.ts +++ b/Tasks/FtpUploadV1/Tests/L0NoRootFolder.ts @@ -9,9 +9,6 @@ tr.setInput('serverEndpoint', 'ID1'); // provide answers for task mock let a: ma.TaskLibAnswers = { - "osType" : { - "osType" : "Windows" - }, "getVariable": { "ENDPOINT_URL_ID1": "ftp://valid.microsoft.com", "ENDPOINT_AUTH_ID1": "{\"scheme\":\"UsernamePassword\", \"parameters\": {\"username\": \"uname\", \"password\": \"pword\"}}", diff --git a/Tasks/FtpUploadV1/Tests/L0NoServerEndpoint.ts b/Tasks/FtpUploadV1/Tests/L0NoServerEndpoint.ts index 757028e5d2fe..d466bcf5c551 100644 --- a/Tasks/FtpUploadV1/Tests/L0NoServerEndpoint.ts +++ b/Tasks/FtpUploadV1/Tests/L0NoServerEndpoint.ts @@ -9,9 +9,6 @@ tr.setInput('credsType', 'serviceEndpoint'); // provide answers for task mock let a: ma.TaskLibAnswers = { - "osType" : { - "osType" : "Windows" - }, "getVariable": { "ENDPOINT_URL_ID1": "ftp://valid.microsoft.com", "ENDPOINT_AUTH_ID1": "{\"scheme\":\"UsernamePassword\", \"parameters\": {\"username\": \"uname\", \"password\": \"pword\"}}", diff --git a/Tasks/FtpUploadV1/Tests/L0NoTrustSSL.ts b/Tasks/FtpUploadV1/Tests/L0NoTrustSSL.ts index c2d6420c91dc..dbf227e2e628 100644 --- a/Tasks/FtpUploadV1/Tests/L0NoTrustSSL.ts +++ b/Tasks/FtpUploadV1/Tests/L0NoTrustSSL.ts @@ -15,9 +15,6 @@ tr.setInput('preservePaths', 'true'); // provide answers for task mock let a: ma.TaskLibAnswers = { - "osType" : { - "osType" : "Windows" - }, "getVariable": { "ENDPOINT_URL_ID1": "ftp://valid.microsoft.com", "ENDPOINT_AUTH_ID1": "{\"scheme\":\"UsernamePassword\", \"parameters\": {\"username\": \"uname\", \"password\": \"pword\"}}", From 0e41d1405e94bcd4a48d30d1a7a2490971bfe9bc Mon Sep 17 00:00:00 2001 From: Maxim Zaytsev Date: Mon, 21 Dec 2020 07:45:35 -0800 Subject: [PATCH 4/9] try new timeout --- Tasks/FtpUploadV1/Tests/L0.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tasks/FtpUploadV1/Tests/L0.ts b/Tasks/FtpUploadV1/Tests/L0.ts index 93babdbe3082..c03ffb01ddd8 100644 --- a/Tasks/FtpUploadV1/Tests/L0.ts +++ b/Tasks/FtpUploadV1/Tests/L0.ts @@ -5,7 +5,7 @@ import * as ttm from 'azure-pipelines-task-lib/mock-test'; describe('FtpUploadV1 Suite', function () { it('check args: no serverEndpoint', (done: Mocha.Done) => { - this.timeout(parseInt(process.env.TASK_TEST_TIMEOUT || '') || 20000); + this.timeout(20000); const tp = path.join(__dirname, 'L0NoServerEndpoint.js'); const tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); From 49ff871ef43b8f51d7676593b6e74fdfbaef5840 Mon Sep 17 00:00:00 2001 From: Maxim Zaytsev Date: Mon, 21 Dec 2020 08:09:32 -0800 Subject: [PATCH 5/9] timeout in describe --- Tasks/FtpUploadV1/Tests/L0.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Tasks/FtpUploadV1/Tests/L0.ts b/Tasks/FtpUploadV1/Tests/L0.ts index c03ffb01ddd8..50fef6b89233 100644 --- a/Tasks/FtpUploadV1/Tests/L0.ts +++ b/Tasks/FtpUploadV1/Tests/L0.ts @@ -4,6 +4,8 @@ import path = require('path'); import * as ttm from 'azure-pipelines-task-lib/mock-test'; describe('FtpUploadV1 Suite', function () { + this.timeout(parseInt(process.env.TASK_TEST_TIMEOUT) || 20000); + it('check args: no serverEndpoint', (done: Mocha.Done) => { this.timeout(20000); From 8123c1876f430ff58678c5020d71aea0e5c4de18 Mon Sep 17 00:00:00 2001 From: Maxim Zaytsev Date: Mon, 21 Dec 2020 08:34:40 -0800 Subject: [PATCH 6/9] remove ftpupload legacy tests --- Tests-Legacy/L0/FtpUpload/_suite.ts | 261 ------------------ Tests-Legacy/L0/FtpUpload/ftpUploadLinux.json | 27 -- Tests-Legacy/L0/FtpUpload/ftpUploadWin.json | 27 -- 3 files changed, 315 deletions(-) delete mode 100644 Tests-Legacy/L0/FtpUpload/_suite.ts delete mode 100644 Tests-Legacy/L0/FtpUpload/ftpUploadLinux.json delete mode 100644 Tests-Legacy/L0/FtpUpload/ftpUploadWin.json diff --git a/Tests-Legacy/L0/FtpUpload/_suite.ts b/Tests-Legacy/L0/FtpUpload/_suite.ts deleted file mode 100644 index 7a1b37a160c3..000000000000 --- a/Tests-Legacy/L0/FtpUpload/_suite.ts +++ /dev/null @@ -1,261 +0,0 @@ -/// -/// -/// - -import Q = require('q'); -import assert = require('assert'); -import trm = require('../../lib/taskRunner'); -import path = require('path'); -import os = require('os'); -var shell = require('shelljs'); - -function setResponseFile(name: string) { - process.env['MOCK_RESPONSES'] = path.join(__dirname, name); - process.env['MOCK_NORMALIZE_SLASHES'] = true; -} - -var jobName = 'FtpUpload'; - -describe(jobName + ' Suite', function () { - this.timeout(10000); - - before((done) => { - // init here - done(); - }); - - after(function () { - - }); - - var responseFiles = ['ftpUploadWin.json', 'ftpUploadLinux.json']; - - responseFiles.forEach((responseFile) => { - var isWin = responseFile == 'ftpUploadWin.json'; - var os = isWin ? 'Windows' : 'Linux'; - - it(os + ' check args: no serverEndpoint', (done) => { - setResponseFile(responseFile); - var tr = new trm.TaskRunner(jobName, true); - tr.setInput('credsType', 'serviceEndpoint'); - - tr.run() - .then(() => { - assert(tr.stderr.indexOf('Input required: serverEndpoint') != -1, 'should have written to stderr'); - assert(tr.failed, 'task should have failed'); - done(); - }) - .fail((err) => { - console.log(err) - done(err); - }); - }); - - it(os + ' check args: no rootFolder', (done) => { - setResponseFile(responseFile); - - var tr = new trm.TaskRunner(jobName, true); - tr.setInput('serverEndpoint', 'ID1'); - - tr.run() - .then(() => { - assert(tr.stderr.indexOf('Input required: rootFolder') != -1, 'should have written to stderr'); - assert(tr.failed, 'task should have failed'); - done(); - }) - .fail((err) => { - console.log(err) - done(err); - }); - }); - - it(os + ' check args: no filePatterns', (done) => { - setResponseFile(responseFile); - - var tr = new trm.TaskRunner(jobName, true); - tr.setInput('serverEndpoint', 'ID1'); - tr.setInput('rootFolder', 'rootFolder'); - - tr.run() - .then(() => { - assert(tr.stderr.indexOf('Input required: filePatterns') != -1, 'should have written to stderr'); - assert(tr.failed, 'task should have failed'); - done(); - }) - .fail((err) => { - console.log(err) - done(err); - }); - }); - - it(os + ' check args: no remotePath', (done) => { - setResponseFile(responseFile); - - var tr = new trm.TaskRunner(jobName, true); - tr.setInput('serverEndpoint', 'ID1'); - tr.setInput('rootFolder', 'rootFolder'); - tr.setInput('filePatterns', '**'); - - tr.run() - .then(() => { - assert(tr.stderr.indexOf('Input required: remotePath') != -1, 'should have written to stderr'); - assert(tr.failed, 'task should have failed'); - done(); - }) - .fail((err) => { - console.log(err) - done(err); - }); - }); - - it(os + ' check args: no clean', (done) => { - setResponseFile(responseFile); - - var tr = new trm.TaskRunner(jobName, true); - tr.setInput('serverEndpoint', 'ID1'); - tr.setInput('rootFolder', 'rootFolder'); - tr.setInput('filePatterns', '**'); - tr.setInput('remotePath', '/upload/'); - - tr.run() - .then(() => { - assert(tr.stderr.indexOf('Input required: clean') != -1, 'should have written to stderr'); - assert(tr.failed, 'task should have failed'); - done(); - }) - .fail((err) => { - console.log(err) - done(err); - }); - }); - - it(os + ' check args: no overwrite', (done) => { - setResponseFile(responseFile); - - var tr = new trm.TaskRunner(jobName, true); - tr.setInput('serverEndpoint', 'ID1'); - tr.setInput('rootFolder', 'rootFolder'); - tr.setInput('filePatterns', '**'); - tr.setInput('remotePath', '/upload/'); - tr.setInput('clean', 'true'); - - tr.run() - .then(() => { - assert(tr.stderr.indexOf('Input required: overwrite') != -1, 'should have written to stderr'); - assert(tr.failed, 'task should have failed'); - done(); - }) - .fail((err) => { - console.log(err) - done(err); - }); - }); - - it(os + ' check args: no preservePaths', (done) => { - setResponseFile(responseFile); - - var tr = new trm.TaskRunner(jobName, true); - tr.setInput('serverEndpoint', 'ID1'); - tr.setInput('rootFolder', 'rootFolder'); - tr.setInput('filePatterns', '**'); - tr.setInput('remotePath', '/upload/'); - tr.setInput('clean', 'true'); - tr.setInput('overwrite', 'true'); - - tr.run() - .then(() => { - assert(tr.stderr.indexOf('Input required: preservePaths') != -1, 'should have written to stderr'); - assert(tr.failed, 'task should have failed'); - done(); - }) - .fail((err) => { - console.log(err) - done(err); - }); - }); - - it(os + ' check args: trustSSL', (done) => { - setResponseFile(responseFile); - - var tr = new trm.TaskRunner(jobName, true); - tr.setInput('serverEndpoint', 'ID1'); - tr.setInput('rootFolder', 'rootFolder'); - tr.setInput('filePatterns', '**'); - tr.setInput('remotePath', '/upload/'); - tr.setInput('clean', 'true'); - tr.setInput('overwrite', 'true'); - tr.setInput('preservePaths', 'true'); - - tr.run() - .then(() => { - assert(tr.stderr.indexOf('Input required: trustSSL') != -1, 'should have written to stderr'); - assert(tr.failed, 'task should have failed'); - done(); - }) - .fail((err) => { - console.log(err) - done(err); - }); - }); - - it(os + ' check args: missing protocol on server URL (ftp:// or ftps://)', (done) => { - setResponseFile(responseFile); - - var tr = new trm.TaskRunner(jobName, true); - tr.setInput('credsType', 'inputs'); - - tr.setInput('serverUrl', 'noprotocol.microsoft.com'); - tr.setInput('username', 'myUsername'); - tr.setInput('password', 'myPassword'); - - tr.setInput('rootFolder', 'rootFolder'); - tr.setInput('filePatterns', '**'); - tr.setInput('remotePath', '/upload/'); - tr.setInput('clean', 'true'); - tr.setInput('overwrite', 'true'); - tr.setInput('preservePaths', 'true'); - tr.setInput('trustSSL', 'true'); - - tr.run() - .then(() => { - assert(tr.stderr.indexOf('The FTP server URL must begin with ftp:// or ftps://') != -1, 'A protocol should have been required in the server URL.'); - assert(tr.failed, 'task should have failed'); - done(); - }) - .fail((err) => { - console.log(err) - done(err); - }); - }); - - it(os + ' check args: missing host name on server URL', (done) => { - setResponseFile(responseFile); - - var tr = new trm.TaskRunner(jobName, true); - tr.setInput('credsType', 'inputs'); - - tr.setInput('serverUrl', 'ftps://'); - tr.setInput('username', 'myUsername'); - tr.setInput('password', 'myPassword'); - - tr.setInput('rootFolder', 'rootFolder'); - tr.setInput('filePatterns', '**'); - tr.setInput('remotePath', '/upload/'); - tr.setInput('clean', 'true'); - tr.setInput('overwrite', 'true'); - tr.setInput('preservePaths', 'true'); - tr.setInput('trustSSL', 'true'); - - tr.run() - .then(() => { - assert(tr.stderr.indexOf('The FTP server URL must include a host name') != -1, 'A host name should have been required in the server URL.'); - assert(tr.failed, 'task should have failed'); - done(); - }) - .fail((err) => { - console.log(err) - done(err); - }); - }); - }); -}); diff --git a/Tests-Legacy/L0/FtpUpload/ftpUploadLinux.json b/Tests-Legacy/L0/FtpUpload/ftpUploadLinux.json deleted file mode 100644 index f62a771c2890..000000000000 --- a/Tests-Legacy/L0/FtpUpload/ftpUploadLinux.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "osType" : { - "osType" : "Linux" - }, - "getVariable": { - "ENDPOINT_URL_ID1": "ftp://valid.microsoft.com", - "ENDPOINT_AUTH_ID1": "{\"scheme\":\"UsernamePassword\", \"parameters\": {\"username\": \"uname\", \"password\": \"pword\"}}", - "build.sourcesDirectory": "/" - }, - "exist" : { - "rootFolder": true - }, - "find": { - "rootFolder": [ - "rootFolder/a", - "rootFolder/b", - "rootFolder/c" - ] - }, - "match": { - "*": [ - "rootFolder/a", - "rootFolder/b", - "rootFolder/c" - ] - } -} \ No newline at end of file diff --git a/Tests-Legacy/L0/FtpUpload/ftpUploadWin.json b/Tests-Legacy/L0/FtpUpload/ftpUploadWin.json deleted file mode 100644 index 26143150e05f..000000000000 --- a/Tests-Legacy/L0/FtpUpload/ftpUploadWin.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "osType" : { - "osType" : "Windows" - }, - "getVariable": { - "ENDPOINT_URL_ID1": "ftp://valid.microsoft.com", - "ENDPOINT_AUTH_ID1": "{\"scheme\":\"UsernamePassword\", \"parameters\": {\"username\": \"uname\", \"password\": \"pword\"}}", - "build.sourcesDirectory": "/" - }, - "exist" : { - "rootFolder": true - }, - "find": { - "rootFolder": [ - "rootFolder/a", - "rootFolder/b", - "rootFolder/c" - ] - }, - "match": { - "*": [ - "rootFolder/a", - "rootFolder/b", - "rootFolder/c" - ] - } -} \ No newline at end of file From 5c8f251300b8f72ed057fea76fd5002da0697952 Mon Sep 17 00:00:00 2001 From: Maxim Zaytsev Date: Mon, 21 Dec 2020 08:38:18 -0800 Subject: [PATCH 7/9] fx --- Tasks/FtpUploadV1/Tests/L0.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tasks/FtpUploadV1/Tests/L0.ts b/Tasks/FtpUploadV1/Tests/L0.ts index 50fef6b89233..a50077159535 100644 --- a/Tasks/FtpUploadV1/Tests/L0.ts +++ b/Tasks/FtpUploadV1/Tests/L0.ts @@ -7,7 +7,7 @@ describe('FtpUploadV1 Suite', function () { this.timeout(parseInt(process.env.TASK_TEST_TIMEOUT) || 20000); it('check args: no serverEndpoint', (done: Mocha.Done) => { - this.timeout(20000); + this.timeout(parseInt(process.env.TASK_TEST_TIMEOUT) || 20000); const tp = path.join(__dirname, 'L0NoServerEndpoint.js'); const tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); From cc4c9703fa1957998c1cf82b49757ef2cbd88163 Mon Sep 17 00:00:00 2001 From: Maxim Zaytsev Date: Tue, 22 Dec 2020 09:09:18 -0800 Subject: [PATCH 8/9] Moved timeout to before --- Tasks/FtpUploadV1/Tests/L0.ts | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/Tasks/FtpUploadV1/Tests/L0.ts b/Tasks/FtpUploadV1/Tests/L0.ts index a50077159535..68a0288d3dc6 100644 --- a/Tasks/FtpUploadV1/Tests/L0.ts +++ b/Tasks/FtpUploadV1/Tests/L0.ts @@ -4,11 +4,11 @@ import path = require('path'); import * as ttm from 'azure-pipelines-task-lib/mock-test'; describe('FtpUploadV1 Suite', function () { - this.timeout(parseInt(process.env.TASK_TEST_TIMEOUT) || 20000); - - it('check args: no serverEndpoint', (done: Mocha.Done) => { + before(() => { this.timeout(parseInt(process.env.TASK_TEST_TIMEOUT) || 20000); + }); + it('check args: no serverEndpoint', (done: Mocha.Done) => { const tp = path.join(__dirname, 'L0NoServerEndpoint.js'); const tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -21,8 +21,6 @@ describe('FtpUploadV1 Suite', function () { }); it('check args: no rootFolder', (done: Mocha.Done) => { - this.timeout(parseInt(process.env.TASK_TEST_TIMEOUT || '') || 20000); - const tp = path.join(__dirname, 'L0NoRootFolder.js'); const tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -35,8 +33,6 @@ describe('FtpUploadV1 Suite', function () { }); it('check args: no filePatterns', (done: Mocha.Done) => { - this.timeout(parseInt(process.env.TASK_TEST_TIMEOUT || '') || 20000); - const tp = path.join(__dirname, 'L0NoFilePatterns.js'); const tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -49,8 +45,6 @@ describe('FtpUploadV1 Suite', function () { }); it('check args: no remotePath', (done: Mocha.Done) => { - this.timeout(parseInt(process.env.TASK_TEST_TIMEOUT || '') || 20000); - const tp = path.join(__dirname, 'L0NoRemotePath.js'); const tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -63,8 +57,6 @@ describe('FtpUploadV1 Suite', function () { }); it('check args: no clean', (done: Mocha.Done) => { - this.timeout(parseInt(process.env.TASK_TEST_TIMEOUT || '') || 20000); - const tp = path.join(__dirname, 'L0NoClean.js'); const tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -77,8 +69,6 @@ describe('FtpUploadV1 Suite', function () { }); it('check args: no overwrite', (done: Mocha.Done) => { - this.timeout(parseInt(process.env.TASK_TEST_TIMEOUT || '') || 20000); - const tp = path.join(__dirname, 'L0NoOverwrite.js'); const tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -91,8 +81,6 @@ describe('FtpUploadV1 Suite', function () { }); it('check args: no preservePaths', (done: Mocha.Done) => { - this.timeout(parseInt(process.env.TASK_TEST_TIMEOUT || '') || 20000); - const tp = path.join(__dirname, 'L0NoPreservePaths.js'); const tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -105,8 +93,6 @@ describe('FtpUploadV1 Suite', function () { }); it('check args: no trustSSL', (done: Mocha.Done) => { - this.timeout(parseInt(process.env.TASK_TEST_TIMEOUT || '') || 20000); - const tp = path.join(__dirname, 'L0NoTrustSSL.js'); const tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -120,8 +106,6 @@ describe('FtpUploadV1 Suite', function () { }); it('check args: no protocol on server URL (ftp:// or ftps://)', (done: Mocha.Done) => { - this.timeout(parseInt(process.env.TASK_TEST_TIMEOUT || '') || 20000); - const tp = path.join(__dirname, 'L0NoProtocol.js'); const tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -134,8 +118,6 @@ describe('FtpUploadV1 Suite', function () { }); it('check args: no host name on server URL', (done: Mocha.Done) => { - this.timeout(parseInt(process.env.TASK_TEST_TIMEOUT || '') || 20000); - const tp = path.join(__dirname, 'L0NoHostName.js'); const tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); From 32c4620d9bf7cbf3143926580b83badfdd12c2e7 Mon Sep 17 00:00:00 2001 From: Maxim Zaytsev Date: Tue, 22 Dec 2020 09:15:49 -0800 Subject: [PATCH 9/9] Removed before() --- Tasks/FtpUploadV1/Tests/L0.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Tasks/FtpUploadV1/Tests/L0.ts b/Tasks/FtpUploadV1/Tests/L0.ts index 68a0288d3dc6..13a8d5dc2ad4 100644 --- a/Tasks/FtpUploadV1/Tests/L0.ts +++ b/Tasks/FtpUploadV1/Tests/L0.ts @@ -4,9 +4,7 @@ import path = require('path'); import * as ttm from 'azure-pipelines-task-lib/mock-test'; describe('FtpUploadV1 Suite', function () { - before(() => { - this.timeout(parseInt(process.env.TASK_TEST_TIMEOUT) || 20000); - }); + this.timeout(parseInt(process.env.TASK_TEST_TIMEOUT) || 20000); it('check args: no serverEndpoint', (done: Mocha.Done) => { const tp = path.join(__dirname, 'L0NoServerEndpoint.js');