From c69bc00d87e5d37d8c28dd002e98a52a9273866f Mon Sep 17 00:00:00 2001 From: Bernardo Guerreiro <39738771+bernardobridge@users.noreply.github.com> Date: Thu, 25 Jul 2024 15:44:07 +0200 Subject: [PATCH] test(cli): fix windows tests issues (#3288) --- package-lock.json | 510 ++---------------- .../artillery-engine-playwright/package.json | 2 +- packages/artillery-plugin-ensure/package.json | 2 +- .../package.json | 4 +- .../test/{index.spec.mjs => index.spec.js} | 61 ++- .../test/server/{server.mjs => server.js} | 2 +- .../test/{util.mjs => util.js} | 12 +- .../package.json | 2 +- .../package.json | 2 +- packages/artillery/package.json | 2 +- .../artillery/test/cli/custom-plugin.test.js | 32 +- .../test/cloud-e2e/fargate/bom.test.js | 12 +- packages/artillery/test/helpers/index.js | 7 + 13 files changed, 128 insertions(+), 522 deletions(-) rename packages/artillery-plugin-memory-inspector/test/{index.spec.mjs => index.spec.js} (81%) rename packages/artillery-plugin-memory-inspector/test/server/{server.mjs => server.js} (95%) rename packages/artillery-plugin-memory-inspector/test/{util.mjs => util.js} (54%) diff --git a/package-lock.json b/package-lock.json index ddd44cc90f..00713b8a0c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7955,10 +7955,13 @@ "license": "MIT" }, "node_modules/@types/fs-extra": { - "version": "9.0.13", + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-11.0.4.tgz", + "integrity": "sha512-yTbItCNreRooED33qjunPthRcSjERP1r4MqCZc7wv0u2sUkzTFp45tgUfS5+r7FrZPdmCCNflLhVSP/o+SemsQ==", "dev": true, - "license": "MIT", + "optional": true, "dependencies": { + "@types/jsonfile": "*", "@types/node": "*" } }, @@ -8003,10 +8006,11 @@ "dev": true }, "node_modules/@types/jsonfile": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/@types/jsonfile/-/jsonfile-6.1.1.tgz", - "integrity": "sha512-GSgiRCVeapDN+3pqA35IkQwasaCh/0YFH5dEF6S88iDvEn901DjOeH3/QPY+XYP1DFzDZPvIvfeEgk+7br5png==", + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/@types/jsonfile/-/jsonfile-6.1.4.tgz", + "integrity": "sha512-D5qGUYwjvnNNextdU59/+fI+spnwtTFmyQP0h+PfIOSkNfpU6AOICUOkm4i0OnSk+NyjdPJrxCDro0sJsWlRpQ==", "dev": true, + "optional": true, "dependencies": { "@types/node": "*" } @@ -8042,15 +8046,6 @@ "version": "17.0.26", "license": "MIT" }, - "node_modules/@types/node-fetch": { - "version": "2.6.1", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": "*", - "form-data": "^3.0.0" - } - }, "node_modules/@types/normalize-package-data": { "version": "2.4.1", "dev": true, @@ -8061,12 +8056,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/ps-tree": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@types/ps-tree/-/ps-tree-1.1.2.tgz", - "integrity": "sha512-ZREFYlpUmPQJ0esjxoG1fMvB2HNaD3z+mjqdSosZvd3RalncI9NEur73P8ZJz4YQdL64CmV1w0RuqoRUlhQRBw==", - "dev": true - }, "node_modules/@types/responselike": { "version": "1.0.0", "license": "MIT", @@ -8117,12 +8106,6 @@ "@types/node": "*" } }, - "node_modules/@types/which": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/which/-/which-3.0.0.tgz", - "integrity": "sha512-ASCxdbsrwNfSMXALlC3Decif9rwDMu+80KGp5zI2RLRotfMsTv7fHL8W8VDp24wymzDyIFudhUeSCugrgRFfHQ==", - "dev": true - }, "node_modules/@typescript-eslint/experimental-utils": { "version": "4.33.0", "dev": true, @@ -11149,11 +11132,6 @@ "present": "^0.0.3" } }, - "node_modules/duplexer": { - "version": "0.1.2", - "dev": true, - "license": "MIT" - }, "node_modules/eastasianwidth": { "version": "0.2.0", "license": "MIT" @@ -12310,20 +12288,6 @@ "node": ">= 0.6" } }, - "node_modules/event-stream": { - "version": "3.3.4", - "dev": true, - "license": "MIT", - "dependencies": { - "duplexer": "~0.1.1", - "from": "~0", - "map-stream": "~0.1.0", - "pause-stream": "0.0.11", - "split": "0.3", - "stream-combiner": "~0.0.4", - "through": "~2.3.1" - } - }, "node_modules/eventemitter3": { "version": "4.0.7", "license": "MIT" @@ -12605,29 +12569,6 @@ "reusify": "^1.0.4" } }, - "node_modules/fetch-blob": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", - "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/jimmywarting" - }, - { - "type": "paypal", - "url": "https://paypal.me/jimmywarting" - } - ], - "dependencies": { - "node-domexception": "^1.0.0", - "web-streams-polyfill": "^3.0.3" - }, - "engines": { - "node": "^12.20 || >= 14.13" - } - }, "node_modules/figures": { "version": "3.2.0", "dev": true, @@ -12869,18 +12810,6 @@ "node": ">= 6" } }, - "node_modules/formdata-polyfill": { - "version": "4.0.10", - "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", - "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", - "dev": true, - "dependencies": { - "fetch-blob": "^3.1.2" - }, - "engines": { - "node": ">=12.20.0" - } - }, "node_modules/forwarded": { "version": "0.2.0", "dev": true, @@ -12897,11 +12826,6 @@ "node": ">= 0.6" } }, - "node_modules/from": { - "version": "0.1.7", - "dev": true, - "license": "MIT" - }, "node_modules/fromentries": { "version": "1.3.2", "funding": [ @@ -12991,15 +12915,6 @@ "dev": true, "license": "MIT" }, - "node_modules/fx": { - "version": "28.0.0", - "resolved": "https://registry.npmjs.org/fx/-/fx-28.0.0.tgz", - "integrity": "sha512-vKQDA9g868cZiW8ulgs2uN1yx1i7/nsS33jTMOxekk0Z03BJLffVcdW6AVD32fWb3E6RtmWWuBXBZOk8cLXFNQ==", - "dev": true, - "bin": { - "fx": "index.js" - } - }, "node_modules/gauge": { "version": "3.0.2", "dev": true, @@ -15553,10 +15468,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/map-stream": { - "version": "0.1.0", - "dev": true - }, "node_modules/matcher-collection": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/matcher-collection/-/matcher-collection-1.1.2.tgz", @@ -16400,25 +16311,6 @@ "node": ">= 10.13" } }, - "node_modules/node-domexception": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", - "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/jimmywarting" - }, - { - "type": "github", - "url": "https://paypal.me/jimmywarting" - } - ], - "engines": { - "node": ">=10.5.0" - } - }, "node_modules/node-fetch": { "version": "2.6.7", "dev": true, @@ -17712,17 +17604,6 @@ "node": "*" } }, - "node_modules/pause-stream": { - "version": "0.0.11", - "dev": true, - "license": [ - "MIT", - "Apache2" - ], - "dependencies": { - "through": "~2.3" - } - }, "node_modules/pbkdf2": { "version": "3.1.2", "dev": true, @@ -18270,20 +18151,6 @@ "node": ">= 0.10" } }, - "node_modules/ps-tree": { - "version": "1.2.0", - "dev": true, - "license": "MIT", - "dependencies": { - "event-stream": "=3.3.4" - }, - "bin": { - "ps-tree": "bin/ps-tree.js" - }, - "engines": { - "node": ">= 0.10" - } - }, "node_modules/public-encrypt": { "version": "4.0.3", "dev": true, @@ -19759,17 +19626,6 @@ "version": "3.0.11", "license": "CC0-1.0" }, - "node_modules/split": { - "version": "0.3.3", - "dev": true, - "license": "MIT", - "dependencies": { - "through": "2" - }, - "engines": { - "node": "*" - } - }, "node_modules/split2": { "version": "3.2.2", "dev": true, @@ -19864,14 +19720,6 @@ "readable-stream": "^2.0.2" } }, - "node_modules/stream-combiner": { - "version": "0.0.4", - "dev": true, - "license": "MIT", - "dependencies": { - "duplexer": "~0.1.1" - } - }, "node_modules/stream-http": { "version": "2.8.3", "dev": true, @@ -21594,6 +21442,13 @@ "node": ">=12" } }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true, + "optional": true + }, "node_modules/unique-filename": { "version": "1.1.1", "dev": true, @@ -21836,29 +21691,11 @@ "defaults": "^1.0.3" } }, - "node_modules/web-streams-polyfill": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz", - "integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, "node_modules/webidl-conversions": { "version": "3.0.1", "dev": true, "license": "BSD-2-Clause" }, - "node_modules/webpod": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/webpod/-/webpod-0.0.2.tgz", - "integrity": "sha512-cSwwQIeg8v4i3p4ajHhwgR7N6VyxAf+KYSSsY6Pd3aETE+xEU4vbitz7qQkB0I321xnhDdgtxuiSfk5r/FVtjg==", - "dev": true, - "bin": { - "webpod": "dist/index.js" - } - }, "node_modules/whatwg-url": { "version": "5.0.0", "dev": true, @@ -22839,130 +22676,29 @@ } }, "node_modules/zx": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/zx/-/zx-4.3.0.tgz", - "integrity": "sha512-KuEjpu5QFIMx0wWfzknDRhY98s7a3tWNRmYt19XNmB7AfOmz5zISA4+3Q8vlJc2qguxMn89uSxhPDCldPa3YLA==", + "version": "8.1.4", + "resolved": "https://registry.npmjs.org/zx/-/zx-8.1.4.tgz", + "integrity": "sha512-QFDYYpnzdpRiJ3dL2102Cw26FpXpWshW4QLTGxiYfIcwdAqg084jRCkK/kuP/NOSkxOjydRwNFG81qzA5r1a6w==", "dev": true, - "dependencies": { - "@types/fs-extra": "^9.0.12", - "@types/minimist": "^1.2.2", - "@types/node": "^16.6", - "@types/node-fetch": "^2.5.12", - "chalk": "^4.1.2", - "fs-extra": "^10.0.0", - "globby": "^12.0.1", - "minimist": "^1.2.5", - "node-fetch": "^2.6.1", - "ps-tree": "^1.2.0", - "which": "^2.0.2" - }, "bin": { - "zx": "zx.mjs" - }, - "engines": { - "node": ">= 14.13.1" - } - }, - "node_modules/zx/node_modules/@types/node": { - "version": "16.11.28", - "dev": true, - "license": "MIT" - }, - "node_modules/zx/node_modules/ansi-styles": { - "version": "4.3.0", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/zx/node_modules/array-union": { - "version": "3.0.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/zx/node_modules/chalk": { - "version": "4.1.2", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/zx/node_modules/color-convert": { - "version": "2.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/zx/node_modules/color-name": { - "version": "1.1.4", - "dev": true, - "license": "MIT" - }, - "node_modules/zx/node_modules/globby": { - "version": "12.2.0", - "dev": true, - "license": "MIT", - "dependencies": { - "array-union": "^3.0.1", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.7", - "ignore": "^5.1.9", - "merge2": "^1.4.1", - "slash": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "zx": "build/cli.js" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/zx/node_modules/slash": { - "version": "4.0.0", - "dev": true, - "license": "MIT", "engines": { - "node": ">=12" + "node": ">= 12.17.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "optionalDependencies": { + "@types/fs-extra": ">=11", + "@types/node": ">=20" } }, - "node_modules/zx/node_modules/supports-color": { - "version": "7.2.0", + "node_modules/zx/node_modules/@types/node": { + "version": "20.14.12", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.12.tgz", + "integrity": "sha512-r7wNXakLeSsGT0H1AU863vS2wa5wBOK4bWMjZz2wj+8nBx+m5PeIn0k8AloSLpRuiwdRQZwarZqHE4FNArPuJQ==", "dev": true, - "license": "MIT", + "optional": true, "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" + "undici-types": "~5.26.4" } }, "packages/artillery": { @@ -23030,7 +22766,7 @@ "rewiremock": "^3.14.3", "sinon": "^4.5.0", "tap": "^19.0.2", - "zx": "^4.2.0" + "zx": "^8.1.4" }, "engines": { "node": ">= 18.16.1" @@ -23080,7 +22816,7 @@ }, "devDependencies": { "tap": "^19.0.2", - "zx": "^4.3.0" + "zx": "^8.1.4" } }, "packages/artillery-engine-posthog": { @@ -23128,7 +22864,7 @@ }, "devDependencies": { "tap": "^19.0.2", - "zx": "^4.3.0" + "zx": "^8.1.4" } }, "packages/artillery-plugin-ensure/node_modules/filtrex": { @@ -23220,181 +22956,7 @@ "devDependencies": { "portfinder": "^1.0.32", "tap": "^19.0.2", - "zx": "^7.2.3" - } - }, - "packages/artillery-plugin-memory-inspector/node_modules/@types/fs-extra": { - "version": "11.0.1", - "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-11.0.1.tgz", - "integrity": "sha512-MxObHvNl4A69ofaTRU8DFqvgzzv8s9yRtaPPm5gud9HDNvpB3GPQFvNuTWAI59B9huVGV5jXYJwbCsmBsOGYWA==", - "dev": true, - "dependencies": { - "@types/jsonfile": "*", - "@types/node": "*" - } - }, - "packages/artillery-plugin-memory-inspector/node_modules/@types/node": { - "version": "18.17.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.17.1.tgz", - "integrity": "sha512-xlR1jahfizdplZYRU59JlUx9uzF1ARa8jbhM11ccpCJya8kvos5jwdm2ZAgxSCwOl0fq21svP18EVwPBXMQudw==", - "dev": true - }, - "packages/artillery-plugin-memory-inspector/node_modules/chalk": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", - "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", - "dev": true, - "engines": { - "node": "^12.17.0 || ^14.13 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "packages/artillery-plugin-memory-inspector/node_modules/data-uri-to-buffer": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz", - "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==", - "dev": true, - "engines": { - "node": ">= 12" - } - }, - "packages/artillery-plugin-memory-inspector/node_modules/fs-extra": { - "version": "11.1.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.1.1.tgz", - "integrity": "sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ==", - "dev": true, - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=14.14" - } - }, - "packages/artillery-plugin-memory-inspector/node_modules/globby": { - "version": "13.2.2", - "resolved": "https://registry.npmjs.org/globby/-/globby-13.2.2.tgz", - "integrity": "sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w==", - "dev": true, - "dependencies": { - "dir-glob": "^3.0.1", - "fast-glob": "^3.3.0", - "ignore": "^5.2.4", - "merge2": "^1.4.1", - "slash": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "packages/artillery-plugin-memory-inspector/node_modules/jsonfile": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", - "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", - "dev": true, - "dependencies": { - "universalify": "^2.0.0" - }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "packages/artillery-plugin-memory-inspector/node_modules/node-fetch": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.1.tgz", - "integrity": "sha512-cRVc/kyto/7E5shrWca1Wsea4y6tL9iYJE5FBCius3JQfb/4P4I295PfhgbJQBLTx6lATE4z+wK0rPM4VS2uow==", - "dev": true, - "dependencies": { - "data-uri-to-buffer": "^4.0.0", - "fetch-blob": "^3.1.4", - "formdata-polyfill": "^4.0.10" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/node-fetch" - } - }, - "packages/artillery-plugin-memory-inspector/node_modules/slash": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", - "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "packages/artillery-plugin-memory-inspector/node_modules/universalify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", - "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", - "dev": true, - "engines": { - "node": ">= 10.0.0" - } - }, - "packages/artillery-plugin-memory-inspector/node_modules/which": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/which/-/which-3.0.1.tgz", - "integrity": "sha512-XA1b62dzQzLfaEOSQFTCOd5KFf/1VSzZo7/7TUjnya6u0vGGKzU96UQBZTAThCb2j4/xjBAyii1OhRLJEivHvg==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/which.js" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "packages/artillery-plugin-memory-inspector/node_modules/yaml": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.1.tgz", - "integrity": "sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==", - "dev": true, - "engines": { - "node": ">= 14" - } - }, - "packages/artillery-plugin-memory-inspector/node_modules/zx": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/zx/-/zx-7.2.3.tgz", - "integrity": "sha512-QODu38nLlYXg/B/Gw7ZKiZrvPkEsjPN3LQ5JFXM7h0JvwhEdPNNl+4Ao1y4+o3CLNiDUNcwzQYZ4/Ko7kKzCMA==", - "dev": true, - "dependencies": { - "@types/fs-extra": "^11.0.1", - "@types/minimist": "^1.2.2", - "@types/node": "^18.16.3", - "@types/ps-tree": "^1.1.2", - "@types/which": "^3.0.0", - "chalk": "^5.2.0", - "fs-extra": "^11.1.1", - "fx": "*", - "globby": "^13.1.4", - "minimist": "^1.2.8", - "node-fetch": "3.3.1", - "ps-tree": "^1.2.0", - "webpod": "^0", - "which": "^3.0.0", - "yaml": "^2.2.2" - }, - "bin": { - "zx": "build/cli.js" - }, - "engines": { - "node": ">= 16.0.0" + "zx": "^8.1.4" } }, "packages/artillery-plugin-metrics-by-endpoint": { @@ -23405,7 +22967,7 @@ }, "devDependencies": { "tap": "^19.0.2", - "zx": "^4.3.0" + "zx": "^8.1.4" } }, "packages/artillery-plugin-publish-metrics": { @@ -23441,7 +23003,7 @@ "devDependencies": { "shelljs": "^0.8.4", "tap": "^19.0.2", - "zx": "^4.3.0" + "zx": "^8.1.4" } }, "packages/artillery-plugin-publish-metrics/node_modules/@aws-crypto/ie11-detection": { diff --git a/packages/artillery-engine-playwright/package.json b/packages/artillery-engine-playwright/package.json index c220641ca7..fc5e8d3521 100644 --- a/packages/artillery-engine-playwright/package.json +++ b/packages/artillery-engine-playwright/package.json @@ -27,6 +27,6 @@ }, "devDependencies": { "tap": "^19.0.2", - "zx": "^4.3.0" + "zx": "^8.1.4" } } diff --git a/packages/artillery-plugin-ensure/package.json b/packages/artillery-plugin-ensure/package.json index 09c5bd9a72..46d5f4540f 100644 --- a/packages/artillery-plugin-ensure/package.json +++ b/packages/artillery-plugin-ensure/package.json @@ -26,6 +26,6 @@ }, "devDependencies": { "tap": "^19.0.2", - "zx": "^4.3.0" + "zx": "^8.1.4" } } diff --git a/packages/artillery-plugin-memory-inspector/package.json b/packages/artillery-plugin-memory-inspector/package.json index d2274b318b..308b40b231 100644 --- a/packages/artillery-plugin-memory-inspector/package.json +++ b/packages/artillery-plugin-memory-inspector/package.json @@ -4,7 +4,7 @@ "description": "Inspect the memory of processes running together with your load tests!", "main": "index.js", "scripts": { - "test": "tap ./test/*.spec.mjs --timeout 300" + "test": "tap ./test/*.spec.js --timeout 300" }, "tap": { "disable-coverage": true, @@ -23,6 +23,6 @@ "devDependencies": { "portfinder": "^1.0.32", "tap": "^19.0.2", - "zx": "^7.2.3" + "zx": "^8.1.4" } } diff --git a/packages/artillery-plugin-memory-inspector/test/index.spec.mjs b/packages/artillery-plugin-memory-inspector/test/index.spec.js similarity index 81% rename from packages/artillery-plugin-memory-inspector/test/index.spec.mjs rename to packages/artillery-plugin-memory-inspector/test/index.spec.js index cbd6263510..098505850e 100644 --- a/packages/artillery-plugin-memory-inspector/test/index.spec.mjs +++ b/packages/artillery-plugin-memory-inspector/test/index.spec.js @@ -1,25 +1,27 @@ -import fs from 'fs'; -import { startTestServer } from './util.mjs'; -import { test, afterEach } from 'tap'; -import { $ } from 'zx'; +const fs = require('fs'); +const { startTestServer } = require('./util.js'); +const { test, afterEach } = require('tap'); +const { $ } = require('zx'); let childProcess; afterEach(async () => { //cleanup output file after each test fs.unlinkSync('./test/output.json'); - childProcess.kill() + childProcess.kill(); }); test('cpu and memory metrics display in the aggregate report with the correct name and unit', async (t) => { //Arrange: Test Server and Plugin overrides const testServer = await startTestServer(); - childProcess = testServer.childProcess + childProcess = testServer.childProcess; const override = JSON.stringify({ config: { plugins: { - 'memory-inspector': [{ pid: testServer.currentPid, name: 'express-example', unit: 'kb' }] + 'memory-inspector': [ + { pid: testServer.currentPid, name: 'express-example', unit: 'kb' } + ] } } }); @@ -66,15 +68,20 @@ test('cpu and memory metrics display in the aggregate report with the correct na "Aggregate Histograms doesn't have Memory metric" ); - //assert that kb unit is used - for (const [metric, value] of Object.entries(report.aggregate.summaries['express-example.memory'])) { - if (metric == 'count') { - continue; - } - - const lengthOfValue = Math.round(value).toString().length; - t.ok(lengthOfValue > 3 && lengthOfValue <= 6, `Length of value ${value} should be in KB (more than mb unit, less than byte unit)`) + //assert that kb unit is used + for (const [metric, value] of Object.entries( + report.aggregate.summaries['express-example.memory'] + )) { + if (metric == 'count') { + continue; } + + const lengthOfValue = Math.round(value).toString().length; + t.ok( + lengthOfValue > 3 && lengthOfValue <= 6, + `Length of value ${value} should be in KB (more than mb unit, less than byte unit)` + ); + } }); test('cpu and memory metrics display in the aggregate report with a default name and unit when no name is given', async (t) => { @@ -124,13 +131,18 @@ test('cpu and memory metrics display in the aggregate report with a default name ); //assert that mb unit is used by default - for (const [metric, value] of Object.entries(report.aggregate.summaries[`process_${testServer.currentPid}.memory`])) { + for (const [metric, value] of Object.entries( + report.aggregate.summaries[`process_${testServer.currentPid}.memory`] + )) { if (metric == 'count') { continue; } const lengthOfValue = Math.round(value).toString().length; - t.ok(lengthOfValue <= 3, `Length of value ${value} in MB should be less than 4`) + t.ok( + lengthOfValue <= 3, + `Length of value ${value} in MB should be less than 4` + ); } }); @@ -142,7 +154,9 @@ test('cpu and memory metrics also display in the aggregate report for artillery const override = JSON.stringify({ config: { plugins: { - 'memory-inspector': [{ pid: testServer.currentPid, name: 'express-example' }] + 'memory-inspector': [ + { pid: testServer.currentPid, name: 'express-example' } + ] } } }); @@ -223,13 +237,18 @@ test('cpu and memory metrics also display in the aggregate report for artillery "Aggregate Histograms doesn't have Artillery Heap Total metric" ); - //assert that mb unit is used by default - for (const [metric, value] of Object.entries(report.aggregate.summaries['artillery_internal.memory'])) { + //assert that mb unit is used by default + for (const [metric, value] of Object.entries( + report.aggregate.summaries['artillery_internal.memory'] + )) { if (metric == 'count') { continue; } const lengthOfValue = Math.round(value).toString().length; - t.ok(lengthOfValue <= 3, `Length of value ${value} in MB should be less than 4`) + t.ok( + lengthOfValue <= 3, + `Length of value ${value} in MB should be less than 4` + ); } }); diff --git a/packages/artillery-plugin-memory-inspector/test/server/server.mjs b/packages/artillery-plugin-memory-inspector/test/server/server.js similarity index 95% rename from packages/artillery-plugin-memory-inspector/test/server/server.mjs rename to packages/artillery-plugin-memory-inspector/test/server/server.js index 04d9d53c98..cf08127b9c 100644 --- a/packages/artillery-plugin-memory-inspector/test/server/server.mjs +++ b/packages/artillery-plugin-memory-inspector/test/server/server.js @@ -1,4 +1,4 @@ -import http from 'http'; +const http = require('http'); const port = process.env.TEST_PORT || 4444; // Array that will keep growing, causing a memory leak diff --git a/packages/artillery-plugin-memory-inspector/test/util.mjs b/packages/artillery-plugin-memory-inspector/test/util.js similarity index 54% rename from packages/artillery-plugin-memory-inspector/test/util.mjs rename to packages/artillery-plugin-memory-inspector/test/util.js index c5a6af518e..8f91fad987 100644 --- a/packages/artillery-plugin-memory-inspector/test/util.mjs +++ b/packages/artillery-plugin-memory-inspector/test/util.js @@ -1,13 +1,13 @@ -import portfinder from 'portfinder'; -import { spawn } from 'child_process'; +const portfinder = require('portfinder'); +const { spawn } = require('child_process'); -export const startTestServer = async () => { +const startTestServer = async () => { const port = await portfinder.getPortPromise({ port: 4444, stopPort: 4600 }); - const childProcess = spawn(`node`, ['./test/server/server.mjs'], { + const childProcess = spawn('node', ['./test/server/server.js'], { env: { ...process.env, TEST_PORT: `${port}` @@ -21,3 +21,7 @@ export const startTestServer = async () => { childProcess }; }; + +module.exports = { + startTestServer +}; diff --git a/packages/artillery-plugin-metrics-by-endpoint/package.json b/packages/artillery-plugin-metrics-by-endpoint/package.json index e828f7860a..842ca23db7 100644 --- a/packages/artillery-plugin-metrics-by-endpoint/package.json +++ b/packages/artillery-plugin-metrics-by-endpoint/package.json @@ -24,6 +24,6 @@ }, "devDependencies": { "tap": "^19.0.2", - "zx": "^4.3.0" + "zx": "^8.1.4" } } diff --git a/packages/artillery-plugin-publish-metrics/package.json b/packages/artillery-plugin-publish-metrics/package.json index aee4dacdb5..42bc02febf 100644 --- a/packages/artillery-plugin-publish-metrics/package.json +++ b/packages/artillery-plugin-publish-metrics/package.json @@ -52,6 +52,6 @@ "devDependencies": { "shelljs": "^0.8.4", "tap": "^19.0.2", - "zx": "^4.3.0" + "zx": "^8.1.4" } } diff --git a/packages/artillery/package.json b/packages/artillery/package.json index a499d8894c..107a28e8aa 100644 --- a/packages/artillery/package.json +++ b/packages/artillery/package.json @@ -151,6 +151,6 @@ "rewiremock": "^3.14.3", "sinon": "^4.5.0", "tap": "^19.0.2", - "zx": "^4.2.0" + "zx": "^8.1.4" } } diff --git a/packages/artillery/test/cli/custom-plugin.test.js b/packages/artillery/test/cli/custom-plugin.test.js index 1cebae2f1d..71b219f575 100644 --- a/packages/artillery/test/cli/custom-plugin.test.js +++ b/packages/artillery/test/cli/custom-plugin.test.js @@ -1,9 +1,12 @@ const { test, beforeEach, before, afterEach } = require('tap'); -const http = require('http'); const { $ } = require('zx'); +const http = require('http'); const path = require('path'); +const { toCorrectPath } = require('../helpers'); -const A9 = process.env.A9 || path.join(__dirname, '../../bin/run'); +const A9 = toCorrectPath( + process.env.A9 || path.join(__dirname, '../../bin/run') +); function createServer() { return http.createServer((req, res) => { @@ -31,9 +34,11 @@ beforeEach(async () => { config: { phases: [{ duration: 2, arrivalRate: 2 }], target: `http://localhost:${server.address().port}`, - processor: path.join( - __dirname, - '../scripts/scenario-with-custom-plugin/processor.js' + processor: toCorrectPath( + path.join( + __dirname, + '../scripts/scenario-with-custom-plugin/processor.js' + ) ), plugins: { httphooks: {} @@ -47,13 +52,16 @@ afterEach(async () => { }); test('plugins can attach functions to processor object', async (t) => { - const output = await $`ARTILLERY_PLUGIN_PATH=${path.join( - __dirname, - '../plugins' - )} ${A9} run --quiet --overrides ${overrides} ${path.join( - __dirname, - '../scripts/scenario-with-custom-plugin/custom-plugin.yml' - )}`; + const pluginPath = toCorrectPath(path.join(__dirname, '../plugins')); + const scenarioPath = toCorrectPath( + path.join( + __dirname, + '../scripts/scenario-with-custom-plugin/custom-plugin.yml' + ) + ); + + const output = + await $`ARTILLERY_PLUGIN_PATH=${pluginPath} ${A9} run --quiet --overrides ${overrides} ${scenarioPath}`; t.match(output, /afterResponse hook/, 'plugin should have been called'); }); diff --git a/packages/artillery/test/cloud-e2e/fargate/bom.test.js b/packages/artillery/test/cloud-e2e/fargate/bom.test.js index d3d77b15b2..f598f805b5 100644 --- a/packages/artillery/test/cloud-e2e/fargate/bom.test.js +++ b/packages/artillery/test/cloud-e2e/fargate/bom.test.js @@ -1,13 +1,17 @@ const { test, before, beforeEach } = require('tap'); const { $ } = require('zx'); const fs = require('fs'); -const { generateTmpReportPath, getTestTags } = require('../../helpers'); +const { + generateTmpReportPath, + getTestTags, + toCorrectPath +} = require('../../helpers'); const { checkForNegativeValues, checkAggregateCounterSums } = require('../../helpers/expectations'); -const A9_PATH = process.env.A9_PATH || 'artillery'; +const A9_PATH = toCorrectPath(process.env.A9_PATH || 'artillery'); before(async () => { await $`${A9_PATH} -V`; @@ -23,7 +27,9 @@ beforeEach(async (t) => { }); test('Run simple-bom', async (t) => { - const scenarioPath = `${__dirname}/fixtures/simple-bom/simple-bom.yml`; + const scenarioPath = toCorrectPath( + `${__dirname}/fixtures/simple-bom/simple-bom.yml` + ); const output = await $`${A9_PATH} run-fargate ${scenarioPath} --environment test --region eu-west-1 --count 51 --tags ${baseTags} --record`; diff --git a/packages/artillery/test/helpers/index.js b/packages/artillery/test/helpers/index.js index 4b6a34d61a..c48acfe68a 100644 --- a/packages/artillery/test/helpers/index.js +++ b/packages/artillery/test/helpers/index.js @@ -51,6 +51,12 @@ const getImageArchitecture = () => { return process.env.HAS_ARM64_BUILD === 'true' ? 'arm64' : 'x86_64'; }; +const toCorrectPath = (originalPath) => { + return process.platform === 'win32' + ? originalPath.split(path.sep).join(path.posix.sep) + : originalPath; +}; + module.exports = { execute, deleteFile, @@ -58,5 +64,6 @@ module.exports = { returnTmpPath, generateTmpReportPath, getTestTags, + toCorrectPath, getImageArchitecture };