@depup/artillery 2.0.30-depup.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +63 -0
- package/bin/run +29 -0
- package/bin/run.cmd +3 -0
- package/changes.json +138 -0
- package/console-reporter.js +1 -0
- package/lib/artillery-global.js +33 -0
- package/lib/cli/banner.js +8 -0
- package/lib/cli/common-flags.js +80 -0
- package/lib/cli/hooks/version.js +20 -0
- package/lib/cmds/dino.js +109 -0
- package/lib/cmds/quick.js +122 -0
- package/lib/cmds/report.js +34 -0
- package/lib/cmds/run-aci.js +91 -0
- package/lib/cmds/run-fargate.js +192 -0
- package/lib/cmds/run-lambda.js +96 -0
- package/lib/cmds/run.js +671 -0
- package/lib/console-capture.js +92 -0
- package/lib/console-reporter.js +438 -0
- package/lib/create-bom/built-in-plugins.js +12 -0
- package/lib/create-bom/create-bom.js +301 -0
- package/lib/dispatcher.js +9 -0
- package/lib/dist.js +222 -0
- package/lib/index.js +5 -0
- package/lib/launch-platform.js +439 -0
- package/lib/load-plugins.js +113 -0
- package/lib/platform/aws/aws-cloudwatch.js +106 -0
- package/lib/platform/aws/aws-create-sqs-queue.js +58 -0
- package/lib/platform/aws/aws-ensure-s3-bucket-exists.js +78 -0
- package/lib/platform/aws/aws-get-account-id.js +26 -0
- package/lib/platform/aws/aws-get-bucket-region.js +18 -0
- package/lib/platform/aws/aws-get-credentials.js +28 -0
- package/lib/platform/aws/aws-get-default-region.js +26 -0
- package/lib/platform/aws/aws-whoami.js +15 -0
- package/lib/platform/aws/constants.js +7 -0
- package/lib/platform/aws/iam-cf-templates/aws-iam-fargate-cf-template.yml +219 -0
- package/lib/platform/aws/iam-cf-templates/aws-iam-lambda-cf-template.yml +125 -0
- package/lib/platform/aws/iam-cf-templates/gh-oidc-fargate.yml +241 -0
- package/lib/platform/aws/iam-cf-templates/gh-oidc-lambda.yml +153 -0
- package/lib/platform/aws-ecs/ecs.js +247 -0
- package/lib/platform/aws-ecs/legacy/aws-util.js +134 -0
- package/lib/platform/aws-ecs/legacy/bom.js +528 -0
- package/lib/platform/aws-ecs/legacy/constants.js +27 -0
- package/lib/platform/aws-ecs/legacy/create-s3-client.js +24 -0
- package/lib/platform/aws-ecs/legacy/create-test.js +247 -0
- package/lib/platform/aws-ecs/legacy/errors.js +34 -0
- package/lib/platform/aws-ecs/legacy/find-public-subnets.js +149 -0
- package/lib/platform/aws-ecs/legacy/plugins/artillery-plugin-inspect-script/index.js +27 -0
- package/lib/platform/aws-ecs/legacy/plugins/artillery-plugin-sqs-reporter/azure-aqs.js +80 -0
- package/lib/platform/aws-ecs/legacy/plugins/artillery-plugin-sqs-reporter/index.js +202 -0
- package/lib/platform/aws-ecs/legacy/plugins.js +16 -0
- package/lib/platform/aws-ecs/legacy/run-cluster.js +1994 -0
- package/lib/platform/aws-ecs/legacy/sqs-reporter.js +401 -0
- package/lib/platform/aws-ecs/legacy/tags.js +22 -0
- package/lib/platform/aws-ecs/legacy/test-run-status.js +9 -0
- package/lib/platform/aws-ecs/legacy/time.js +67 -0
- package/lib/platform/aws-ecs/legacy/util.js +97 -0
- package/lib/platform/aws-ecs/worker/Dockerfile +64 -0
- package/lib/platform/aws-ecs/worker/helpers.sh +80 -0
- package/lib/platform/aws-ecs/worker/loadgen-worker +656 -0
- package/lib/platform/aws-lambda/dependencies.js +130 -0
- package/lib/platform/aws-lambda/index.js +734 -0
- package/lib/platform/aws-lambda/lambda-handler/a9-handler-dependencies.js +73 -0
- package/lib/platform/aws-lambda/lambda-handler/a9-handler-helpers.js +43 -0
- package/lib/platform/aws-lambda/lambda-handler/a9-handler-index.js +235 -0
- package/lib/platform/aws-lambda/lambda-handler/package.json +15 -0
- package/lib/platform/aws-lambda/prices.js +29 -0
- package/lib/platform/az/aci.js +694 -0
- package/lib/platform/az/aqs-queue-consumer.js +88 -0
- package/lib/platform/az/regions.js +52 -0
- package/lib/platform/cloud/api.js +72 -0
- package/lib/platform/cloud/cloud.js +448 -0
- package/lib/platform/cloud/http-client.js +19 -0
- package/lib/platform/local/artillery-worker-local.js +154 -0
- package/lib/platform/local/index.js +174 -0
- package/lib/platform/local/worker.js +261 -0
- package/lib/platform/worker-states.js +13 -0
- package/lib/queue-consumer/index.js +56 -0
- package/lib/stash.js +41 -0
- package/lib/telemetry.js +78 -0
- package/lib/util/await-on-ee.js +24 -0
- package/lib/util/generate-id.js +9 -0
- package/lib/util/parse-tag-string.js +21 -0
- package/lib/util/prepare-test-execution-plan.js +216 -0
- package/lib/util/sleep.js +7 -0
- package/lib/util/validate-script.js +132 -0
- package/lib/util.js +294 -0
- package/lib/utils-config.js +31 -0
- package/package.json +323 -0
- package/types.d.ts +317 -0
- package/util.js +1 -0
package/README.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# @depup/artillery
|
|
2
|
+
|
|
3
|
+
> Dependency-bumped version of [artillery](https://www.npmjs.com/package/artillery)
|
|
4
|
+
|
|
5
|
+
Generated by [DepUp](https://github.com/depup/npm) -- all production
|
|
6
|
+
dependencies bumped to latest versions.
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install @depup/artillery
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
| Field | Value |
|
|
15
|
+
|-------|-------|
|
|
16
|
+
| Original | [artillery](https://www.npmjs.com/package/artillery) @ 2.0.30 |
|
|
17
|
+
| Processed | 2026-03-19 |
|
|
18
|
+
| Smoke test | failed |
|
|
19
|
+
| Deps updated | 33 |
|
|
20
|
+
|
|
21
|
+
## Dependency Changes
|
|
22
|
+
|
|
23
|
+
| Dependency | From | To |
|
|
24
|
+
|------------|------|-----|
|
|
25
|
+
| @aws-sdk/client-cloudwatch-logs | ^3.972.0 | ^3.1012.0 |
|
|
26
|
+
| @aws-sdk/client-ec2 | ^3.972.0 | ^3.1012.0 |
|
|
27
|
+
| @aws-sdk/client-ecs | ^3.972.0 | ^3.1012.0 |
|
|
28
|
+
| @aws-sdk/client-iam | ^3.972.0 | ^3.1012.0 |
|
|
29
|
+
| @aws-sdk/client-lambda | ^3.972.0 | ^3.1012.0 |
|
|
30
|
+
| @aws-sdk/client-s3 | ^3.972.0 | ^3.1012.0 |
|
|
31
|
+
| @aws-sdk/client-sqs | ^3.972.0 | ^3.1012.0 |
|
|
32
|
+
| @aws-sdk/client-ssm | ^3.972.0 | ^3.1012.0 |
|
|
33
|
+
| @aws-sdk/client-sts | ^3.972.0 | ^3.1012.0 |
|
|
34
|
+
| @aws-sdk/credential-providers | ^3.972.0 | ^3.1012.0 |
|
|
35
|
+
| @azure/storage-blob | ^12.30.0 | ^12.31.0 |
|
|
36
|
+
| @oclif/core | ^4.8.0 | ^4.9.0 |
|
|
37
|
+
| @oclif/plugin-help | ^6.2.36 | ^6.2.38 |
|
|
38
|
+
| @oclif/plugin-not-found | ^3.2.73 | ^3.2.75 |
|
|
39
|
+
| @upstash/redis | ^1.36.1 | ^1.37.0 |
|
|
40
|
+
| async | ^2.6.4 | ^3.2.6 |
|
|
41
|
+
| chalk | ^2.4.2 | ^5.6.2 |
|
|
42
|
+
| chokidar | ^3.6.0 | ^5.0.0 |
|
|
43
|
+
| ci-info | ^4.3.1 | ^4.4.0 |
|
|
44
|
+
| csv-parse | ^4.16.3 | ^6.2.0 |
|
|
45
|
+
| dependency-tree | ^11.2.0 | ^11.4.0 |
|
|
46
|
+
| dotenv | ^16.6.1 | ^17.3.1 |
|
|
47
|
+
| esbuild-wasm | ^0.19.12 | ^0.27.4 |
|
|
48
|
+
| fs-extra | ^11.3.3 | ^11.3.4 |
|
|
49
|
+
| got | ^11.8.5 | ^14.6.6 |
|
|
50
|
+
| joi | ^17.13.3 | ^18.0.2 |
|
|
51
|
+
| js-yaml | ^3.14.1 | ^4.1.1 |
|
|
52
|
+
| lodash | ^4.17.21 | ^4.17.23 |
|
|
53
|
+
| nanoid | ^3.3.4 | ^5.1.7 |
|
|
54
|
+
| ora | ^4.0.4 | ^9.3.0 |
|
|
55
|
+
| sqs-consumer | 6.0.2 | ^14.2.3 |
|
|
56
|
+
| tempy | 3.1.0 | ^3.2.0 |
|
|
57
|
+
| walk-sync | ^0.2.3 | ^4.0.1 |
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
Source: https://github.com/depup/npm | Original: https://www.npmjs.com/package/artillery
|
|
62
|
+
|
|
63
|
+
License inherited from the original package.
|
package/bin/run
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
4
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
5
|
+
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
6
|
+
|
|
7
|
+
const oclif = require('@oclif/core');
|
|
8
|
+
const { createGlobalObject } = require('../lib/artillery-global');
|
|
9
|
+
|
|
10
|
+
const { rainbow } = require('../util');
|
|
11
|
+
const banner = require('../lib/cli/banner');
|
|
12
|
+
const setupConsoleCapture = require('../lib/console-capture');
|
|
13
|
+
|
|
14
|
+
async function main() {
|
|
15
|
+
await createGlobalObject();
|
|
16
|
+
await setupConsoleCapture();
|
|
17
|
+
|
|
18
|
+
if (!process.argv.slice(2).length) {
|
|
19
|
+
console.log(Math.random() * 100 > 34 ?
|
|
20
|
+
banner :
|
|
21
|
+
rainbow(banner));
|
|
22
|
+
} else if (process.argv.slice(2).length === 1 && process.argv.slice(2)[0] === '-V') {
|
|
23
|
+
process.argv[2] = 'version';
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
oclif.run().then(require('@oclif/core/flush')).catch(require('@oclif/core/handle'));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
main();
|
package/bin/run.cmd
ADDED
package/changes.json
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
{
|
|
2
|
+
"bumped": {
|
|
3
|
+
"@aws-sdk/client-cloudwatch-logs": {
|
|
4
|
+
"from": "^3.972.0",
|
|
5
|
+
"to": "^3.1012.0"
|
|
6
|
+
},
|
|
7
|
+
"@aws-sdk/client-ec2": {
|
|
8
|
+
"from": "^3.972.0",
|
|
9
|
+
"to": "^3.1012.0"
|
|
10
|
+
},
|
|
11
|
+
"@aws-sdk/client-ecs": {
|
|
12
|
+
"from": "^3.972.0",
|
|
13
|
+
"to": "^3.1012.0"
|
|
14
|
+
},
|
|
15
|
+
"@aws-sdk/client-iam": {
|
|
16
|
+
"from": "^3.972.0",
|
|
17
|
+
"to": "^3.1012.0"
|
|
18
|
+
},
|
|
19
|
+
"@aws-sdk/client-lambda": {
|
|
20
|
+
"from": "^3.972.0",
|
|
21
|
+
"to": "^3.1012.0"
|
|
22
|
+
},
|
|
23
|
+
"@aws-sdk/client-s3": {
|
|
24
|
+
"from": "^3.972.0",
|
|
25
|
+
"to": "^3.1012.0"
|
|
26
|
+
},
|
|
27
|
+
"@aws-sdk/client-sqs": {
|
|
28
|
+
"from": "^3.972.0",
|
|
29
|
+
"to": "^3.1012.0"
|
|
30
|
+
},
|
|
31
|
+
"@aws-sdk/client-ssm": {
|
|
32
|
+
"from": "^3.972.0",
|
|
33
|
+
"to": "^3.1012.0"
|
|
34
|
+
},
|
|
35
|
+
"@aws-sdk/client-sts": {
|
|
36
|
+
"from": "^3.972.0",
|
|
37
|
+
"to": "^3.1012.0"
|
|
38
|
+
},
|
|
39
|
+
"@aws-sdk/credential-providers": {
|
|
40
|
+
"from": "^3.972.0",
|
|
41
|
+
"to": "^3.1012.0"
|
|
42
|
+
},
|
|
43
|
+
"@azure/storage-blob": {
|
|
44
|
+
"from": "^12.30.0",
|
|
45
|
+
"to": "^12.31.0"
|
|
46
|
+
},
|
|
47
|
+
"@oclif/core": {
|
|
48
|
+
"from": "^4.8.0",
|
|
49
|
+
"to": "^4.9.0"
|
|
50
|
+
},
|
|
51
|
+
"@oclif/plugin-help": {
|
|
52
|
+
"from": "^6.2.36",
|
|
53
|
+
"to": "^6.2.38"
|
|
54
|
+
},
|
|
55
|
+
"@oclif/plugin-not-found": {
|
|
56
|
+
"from": "^3.2.73",
|
|
57
|
+
"to": "^3.2.75"
|
|
58
|
+
},
|
|
59
|
+
"@upstash/redis": {
|
|
60
|
+
"from": "^1.36.1",
|
|
61
|
+
"to": "^1.37.0"
|
|
62
|
+
},
|
|
63
|
+
"async": {
|
|
64
|
+
"from": "^2.6.4",
|
|
65
|
+
"to": "^3.2.6"
|
|
66
|
+
},
|
|
67
|
+
"chalk": {
|
|
68
|
+
"from": "^2.4.2",
|
|
69
|
+
"to": "^5.6.2"
|
|
70
|
+
},
|
|
71
|
+
"chokidar": {
|
|
72
|
+
"from": "^3.6.0",
|
|
73
|
+
"to": "^5.0.0"
|
|
74
|
+
},
|
|
75
|
+
"ci-info": {
|
|
76
|
+
"from": "^4.3.1",
|
|
77
|
+
"to": "^4.4.0"
|
|
78
|
+
},
|
|
79
|
+
"csv-parse": {
|
|
80
|
+
"from": "^4.16.3",
|
|
81
|
+
"to": "^6.2.0"
|
|
82
|
+
},
|
|
83
|
+
"dependency-tree": {
|
|
84
|
+
"from": "^11.2.0",
|
|
85
|
+
"to": "^11.4.0"
|
|
86
|
+
},
|
|
87
|
+
"dotenv": {
|
|
88
|
+
"from": "^16.6.1",
|
|
89
|
+
"to": "^17.3.1"
|
|
90
|
+
},
|
|
91
|
+
"esbuild-wasm": {
|
|
92
|
+
"from": "^0.19.12",
|
|
93
|
+
"to": "^0.27.4"
|
|
94
|
+
},
|
|
95
|
+
"fs-extra": {
|
|
96
|
+
"from": "^11.3.3",
|
|
97
|
+
"to": "^11.3.4"
|
|
98
|
+
},
|
|
99
|
+
"got": {
|
|
100
|
+
"from": "^11.8.5",
|
|
101
|
+
"to": "^14.6.6"
|
|
102
|
+
},
|
|
103
|
+
"joi": {
|
|
104
|
+
"from": "^17.13.3",
|
|
105
|
+
"to": "^18.0.2"
|
|
106
|
+
},
|
|
107
|
+
"js-yaml": {
|
|
108
|
+
"from": "^3.14.1",
|
|
109
|
+
"to": "^4.1.1"
|
|
110
|
+
},
|
|
111
|
+
"lodash": {
|
|
112
|
+
"from": "^4.17.21",
|
|
113
|
+
"to": "^4.17.23"
|
|
114
|
+
},
|
|
115
|
+
"nanoid": {
|
|
116
|
+
"from": "^3.3.4",
|
|
117
|
+
"to": "^5.1.7"
|
|
118
|
+
},
|
|
119
|
+
"ora": {
|
|
120
|
+
"from": "^4.0.4",
|
|
121
|
+
"to": "^9.3.0"
|
|
122
|
+
},
|
|
123
|
+
"sqs-consumer": {
|
|
124
|
+
"from": "6.0.2",
|
|
125
|
+
"to": "^14.2.3"
|
|
126
|
+
},
|
|
127
|
+
"tempy": {
|
|
128
|
+
"from": "3.1.0",
|
|
129
|
+
"to": "^3.2.0"
|
|
130
|
+
},
|
|
131
|
+
"walk-sync": {
|
|
132
|
+
"from": "^0.2.3",
|
|
133
|
+
"to": "^4.0.1"
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
"timestamp": "2026-03-19T03:29:49.713Z",
|
|
137
|
+
"totalUpdated": 33
|
|
138
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./lib/console-reporter');
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const version = require('../package.json').version;
|
|
2
|
+
const telemetry = require('./telemetry');
|
|
3
|
+
|
|
4
|
+
const { updateGlobalObject } = require('@artilleryio/int-core');
|
|
5
|
+
|
|
6
|
+
async function createGlobalObject(_opts) {
|
|
7
|
+
await updateGlobalObject({
|
|
8
|
+
version,
|
|
9
|
+
telemetry
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
global.artillery.runtimeOptions = global.artillery.runtimeOptions || {};
|
|
13
|
+
global.artillery.runtimeOptions.legacyReporting =
|
|
14
|
+
typeof process.env.ARTILLERY_USE_LEGACY_REPORT_FORMAT !== 'undefined';
|
|
15
|
+
global.artillery._workerThreadSend =
|
|
16
|
+
global.artillery._workerThreadSend || null;
|
|
17
|
+
|
|
18
|
+
global.artillery.__createReporter = require('./console-reporter');
|
|
19
|
+
|
|
20
|
+
global.artillery._exitCode = 0;
|
|
21
|
+
|
|
22
|
+
global.artillery.shutdown =
|
|
23
|
+
global.artillery.shutdown ||
|
|
24
|
+
(
|
|
25
|
+
async () => {
|
|
26
|
+
// TODO: Move graceful shutdown logic into here
|
|
27
|
+
process.exit(global.artillery.suggestedExitCode);
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
module.exports = {
|
|
32
|
+
createGlobalObject
|
|
33
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
const { Flags } = require('@oclif/core');
|
|
2
|
+
|
|
3
|
+
const CommonRunFlags = {
|
|
4
|
+
target: Flags.string({
|
|
5
|
+
char: 't',
|
|
6
|
+
description:
|
|
7
|
+
'Set target endpoint. Overrides the target already set in the test script'
|
|
8
|
+
}),
|
|
9
|
+
config: Flags.string({
|
|
10
|
+
char: 'c',
|
|
11
|
+
description: 'Read configuration for the test from the specified file'
|
|
12
|
+
}),
|
|
13
|
+
// TODO: Replace with --profile
|
|
14
|
+
environment: Flags.string({
|
|
15
|
+
char: 'e',
|
|
16
|
+
description: 'Use one of the environments specified in config.environments'
|
|
17
|
+
}),
|
|
18
|
+
'scenario-name': Flags.string({
|
|
19
|
+
description: 'Name of the specific scenario to run'
|
|
20
|
+
}),
|
|
21
|
+
output: Flags.string({
|
|
22
|
+
char: 'o',
|
|
23
|
+
description: 'Write a JSON report to file'
|
|
24
|
+
}),
|
|
25
|
+
dotenv: Flags.string({
|
|
26
|
+
description: 'Path to a dotenv file to load environment variables from',
|
|
27
|
+
aliases: ['env-file']
|
|
28
|
+
}),
|
|
29
|
+
variables: Flags.string({
|
|
30
|
+
char: 'v',
|
|
31
|
+
description:
|
|
32
|
+
'Set variables available to vusers during the test; a JSON object'
|
|
33
|
+
}),
|
|
34
|
+
overrides: Flags.string({
|
|
35
|
+
description: 'Dynamically override values in the test script; a JSON object'
|
|
36
|
+
}),
|
|
37
|
+
insecure: Flags.boolean({
|
|
38
|
+
char: 'k',
|
|
39
|
+
description: 'Allow insecure TLS connections; do not use in production'
|
|
40
|
+
}),
|
|
41
|
+
quiet: Flags.boolean({
|
|
42
|
+
char: 'q',
|
|
43
|
+
description: 'Quiet mode'
|
|
44
|
+
}),
|
|
45
|
+
// multiple allows multiple arguments for the -i flag, which means that e.g.:
|
|
46
|
+
// artillery -i one.yml -i two.yml main.yml
|
|
47
|
+
// does not work as expected. Instead of being considered an argument, "main.yml"
|
|
48
|
+
// is considered to be input for "-i" and oclif then complains about missing
|
|
49
|
+
// argument
|
|
50
|
+
input: Flags.string({
|
|
51
|
+
char: 'i',
|
|
52
|
+
description: 'Input script file',
|
|
53
|
+
multiple: true,
|
|
54
|
+
hidden: true
|
|
55
|
+
}),
|
|
56
|
+
|
|
57
|
+
//Artillery Cloud options:
|
|
58
|
+
|
|
59
|
+
name: Flags.string({
|
|
60
|
+
description:
|
|
61
|
+
'Name of the test run. This name will be shown in the Artillery Cloud dashboard. Equivalent to setting a "name" tag.'
|
|
62
|
+
}),
|
|
63
|
+
tags: Flags.string({
|
|
64
|
+
description:
|
|
65
|
+
'Comma-separated list of tags in key:value format to tag the test run with in Artillery Cloud, for example: --tags team:sqa,service:foo'
|
|
66
|
+
}),
|
|
67
|
+
note: Flags.string({
|
|
68
|
+
description: 'Add a note/annotation to the test run'
|
|
69
|
+
}),
|
|
70
|
+
record: Flags.boolean({
|
|
71
|
+
description: 'Record test run to Artillery Cloud'
|
|
72
|
+
}),
|
|
73
|
+
key: Flags.string({
|
|
74
|
+
description: 'API key for Artillery Cloud'
|
|
75
|
+
})
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
module.exports = {
|
|
79
|
+
CommonRunFlags
|
|
80
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const banner = require('../banner');
|
|
2
|
+
const version = require('../../../package.json').version;
|
|
3
|
+
|
|
4
|
+
async function versionHook() {
|
|
5
|
+
if (['-v', '-V', '--version', 'version'].includes(process.argv[2])) {
|
|
6
|
+
console.log(banner);
|
|
7
|
+
|
|
8
|
+
console.log(`
|
|
9
|
+
VERSION INFO:
|
|
10
|
+
|
|
11
|
+
Artillery: ${version}
|
|
12
|
+
Node.js: ${process.version}
|
|
13
|
+
OS: ${process.platform}
|
|
14
|
+
`);
|
|
15
|
+
|
|
16
|
+
return process.exit(0);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
module.exports = versionHook;
|
package/lib/cmds/dino.js
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
+
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
4
|
+
|
|
5
|
+
const { Command, Flags } = require('@oclif/core');
|
|
6
|
+
const { rainbow } = require('../util');
|
|
7
|
+
|
|
8
|
+
class DinoCommand extends Command {
|
|
9
|
+
async run() {
|
|
10
|
+
const { flags } = await this.parse(DinoCommand);
|
|
11
|
+
let output = '';
|
|
12
|
+
const message = flags.message
|
|
13
|
+
? flags.message
|
|
14
|
+
: flags.quiet
|
|
15
|
+
? "You can't silence me!"
|
|
16
|
+
: 'Artillery!';
|
|
17
|
+
const n = message.length + 2;
|
|
18
|
+
const balloon = ` ${'-'.repeat(n)}\n< ${message} >\n ${'-'.repeat(n)}\n`;
|
|
19
|
+
|
|
20
|
+
output += `${balloon} \\\n \\\n`;
|
|
21
|
+
|
|
22
|
+
const i = Math.floor(Math.random() * dinos.length);
|
|
23
|
+
output += dinos[i];
|
|
24
|
+
|
|
25
|
+
if (flags.rainbow) {
|
|
26
|
+
console.log(rainbow(output));
|
|
27
|
+
} else {
|
|
28
|
+
console.log(output);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
DinoCommand.description = 'here be dinosaurs';
|
|
34
|
+
DinoCommand.flags = {
|
|
35
|
+
message: Flags.string({
|
|
36
|
+
char: 'm',
|
|
37
|
+
description: 'Tell dinosaur what to say'
|
|
38
|
+
}),
|
|
39
|
+
rainbow: Flags.boolean({
|
|
40
|
+
char: 'r',
|
|
41
|
+
description: 'Add some color'
|
|
42
|
+
}),
|
|
43
|
+
quiet: Flags.boolean({
|
|
44
|
+
char: 'q',
|
|
45
|
+
description: 'Quiet mode'
|
|
46
|
+
})
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const dinos = [
|
|
50
|
+
' __' +
|
|
51
|
+
'\n' +
|
|
52
|
+
' / _)' +
|
|
53
|
+
'\n' +
|
|
54
|
+
' _/\\/\\/\\_/ /' +
|
|
55
|
+
'\n' +
|
|
56
|
+
' _| /' +
|
|
57
|
+
'\n' +
|
|
58
|
+
' _| ( | ( |' +
|
|
59
|
+
'\n' +
|
|
60
|
+
"/__.-'|_|--|_|" +
|
|
61
|
+
'\n',
|
|
62
|
+
|
|
63
|
+
' __ \n' +
|
|
64
|
+
' / _) \n' +
|
|
65
|
+
' .-^^^-/ / \n' +
|
|
66
|
+
' __/ / \n' +
|
|
67
|
+
'<__.|_|-|_|',
|
|
68
|
+
|
|
69
|
+
' .@\n' +
|
|
70
|
+
' @.+\n' +
|
|
71
|
+
' @,\n' +
|
|
72
|
+
" @'\n" +
|
|
73
|
+
" @'\n" +
|
|
74
|
+
' @;\n' +
|
|
75
|
+
' `@;\n' +
|
|
76
|
+
' @+;\n' +
|
|
77
|
+
" .@#;'\n" +
|
|
78
|
+
" #@###@;'.\n" +
|
|
79
|
+
' :#@@@@@;.\n' +
|
|
80
|
+
" @@@+;'@@:\n" +
|
|
81
|
+
" `@@@';;;@@\n" +
|
|
82
|
+
' @;:@@;;;;+#\n' +
|
|
83
|
+
'`@;` ,@@,, @@`\n' +
|
|
84
|
+
' @`@ @`+\n' +
|
|
85
|
+
' @ , @ @\n' +
|
|
86
|
+
' @ @ @ @',
|
|
87
|
+
|
|
88
|
+
' ..`\n' +
|
|
89
|
+
" ;:,'+;\n" +
|
|
90
|
+
' ,;;,,;,\n' +
|
|
91
|
+
" #:;':\n" +
|
|
92
|
+
" @';'+;\n" +
|
|
93
|
+
" `::;''';\n" +
|
|
94
|
+
" '; ,:'+;;\n" +
|
|
95
|
+
" `,,` .;';'+;'\n" +
|
|
96
|
+
" ; `'+;;;::';++':,;\n" +
|
|
97
|
+
" `+++++##+'';#\n" +
|
|
98
|
+
" .;+##+''';\n" +
|
|
99
|
+
" '+##'''#'\n" +
|
|
100
|
+
" ++# +;'.##\n" +
|
|
101
|
+
' ##, `: .#,\n' +
|
|
102
|
+
" :# '+\n" +
|
|
103
|
+
" #. '\n" +
|
|
104
|
+
' # +\n' +
|
|
105
|
+
" :+ #'\n" +
|
|
106
|
+
" #+` ';."
|
|
107
|
+
];
|
|
108
|
+
|
|
109
|
+
module.exports = DinoCommand;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
+
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
const RunCommand = require('./run');
|
|
8
|
+
const parse = require('node:url').parse;
|
|
9
|
+
const fs = require('node:fs');
|
|
10
|
+
const _ = require('lodash');
|
|
11
|
+
const _debug = require('debug')('commands:quick');
|
|
12
|
+
|
|
13
|
+
const { Command, Flags, Args } = require('@oclif/core');
|
|
14
|
+
|
|
15
|
+
class QuickCommand extends Command {
|
|
16
|
+
async run() {
|
|
17
|
+
const { flags, args } = await this.parse(QuickCommand);
|
|
18
|
+
const url = args.target;
|
|
19
|
+
|
|
20
|
+
const script = {
|
|
21
|
+
config: {
|
|
22
|
+
target: '',
|
|
23
|
+
phases: [],
|
|
24
|
+
mode: 'uniform',
|
|
25
|
+
__createdByQuickCommand: true
|
|
26
|
+
},
|
|
27
|
+
scenarios: [
|
|
28
|
+
{
|
|
29
|
+
flow: []
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const p = parse(url);
|
|
35
|
+
const target = `${p.protocol}//${p.host}`;
|
|
36
|
+
script.config.target = target;
|
|
37
|
+
|
|
38
|
+
if (flags.insecure && p.protocol.match(/https/)) {
|
|
39
|
+
script.config.tls = {
|
|
40
|
+
rejectUnauthorized: false
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
script.config.phases.push({
|
|
45
|
+
duration: 1,
|
|
46
|
+
arrivalCount: flags.count
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
let requestSpec = {};
|
|
50
|
+
if (p.protocol.match('http')) {
|
|
51
|
+
requestSpec.get = { url: url };
|
|
52
|
+
} else if (p.protocol.match('ws')) {
|
|
53
|
+
requestSpec.send = 'hello from Artillery!';
|
|
54
|
+
} else {
|
|
55
|
+
console.error('Unknown protocol in target:', args.target);
|
|
56
|
+
console.error('Supported protocols: HTTP(S) and WS(S)');
|
|
57
|
+
process.exit(1);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (flags.num > 1) {
|
|
61
|
+
requestSpec = {
|
|
62
|
+
loop: [requestSpec],
|
|
63
|
+
count: flags.num
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
script.scenarios[0].flow.push(requestSpec);
|
|
68
|
+
if (p.protocol.match(/ws/)) {
|
|
69
|
+
script.scenarios[0].engine = 'ws';
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const temporaryFile = (await import('tempy')).temporaryFile;
|
|
73
|
+
const tmpf = temporaryFile({ extension: 'yml' });
|
|
74
|
+
fs.writeFileSync(tmpf, JSON.stringify(script, null, 2), { flag: 'w' });
|
|
75
|
+
|
|
76
|
+
const runArgs = [];
|
|
77
|
+
if (flags.output) {
|
|
78
|
+
runArgs.push('--output');
|
|
79
|
+
runArgs.push(flags.output);
|
|
80
|
+
}
|
|
81
|
+
if (flags.quiet) {
|
|
82
|
+
runArgs.push('--quiet');
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
runArgs.push(tmpf);
|
|
86
|
+
|
|
87
|
+
RunCommand.run(runArgs);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
QuickCommand.description = 'run a simple test without writing a test script';
|
|
92
|
+
QuickCommand.flags = {
|
|
93
|
+
count: Flags.string({
|
|
94
|
+
char: 'c',
|
|
95
|
+
description: 'Number of VUs to create',
|
|
96
|
+
parse: (input) => parseInt(input, 10),
|
|
97
|
+
default: 10
|
|
98
|
+
}),
|
|
99
|
+
num: Flags.string({
|
|
100
|
+
char: 'n',
|
|
101
|
+
description: 'Number of requests/messages that each VU will send',
|
|
102
|
+
parse: (input) => parseInt(input, 10),
|
|
103
|
+
default: 10
|
|
104
|
+
}),
|
|
105
|
+
output: Flags.string({
|
|
106
|
+
char: 'o',
|
|
107
|
+
description: 'Filename of the JSON report'
|
|
108
|
+
}),
|
|
109
|
+
insecure: Flags.boolean({
|
|
110
|
+
char: 'k',
|
|
111
|
+
description: 'Allow insecure TLS connections'
|
|
112
|
+
}),
|
|
113
|
+
quiet: Flags.boolean({
|
|
114
|
+
char: 'q',
|
|
115
|
+
description: 'Quiet mode'
|
|
116
|
+
})
|
|
117
|
+
};
|
|
118
|
+
QuickCommand.args = {
|
|
119
|
+
target: Args.string()
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
module.exports = QuickCommand;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
const { Command, Flags, Args } = require('@oclif/core');
|
|
2
|
+
|
|
3
|
+
const chalk = require('chalk');
|
|
4
|
+
|
|
5
|
+
class ReportCommand extends Command {
|
|
6
|
+
async run() {
|
|
7
|
+
console.error(deprecationNotice);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
ReportCommand.description =
|
|
12
|
+
'generate a HTML report from a JSON log produced with artillery run';
|
|
13
|
+
|
|
14
|
+
ReportCommand.flags = {
|
|
15
|
+
output: Flags.string({
|
|
16
|
+
char: 'o',
|
|
17
|
+
description: 'Write HTML report to specified location'
|
|
18
|
+
})
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const deprecationNotice = `
|
|
22
|
+
┌───────────────────────────────────────────────────────────────────────┐
|
|
23
|
+
| ${chalk.blue(
|
|
24
|
+
'The "report" command has been deprecated and is no longer supported'
|
|
25
|
+
)} |
|
|
26
|
+
| |
|
|
27
|
+
| You can use Artillery Cloud (https://app.artillery.io) to visualize |
|
|
28
|
+
| test results, create custom reports, and share them with your team. |
|
|
29
|
+
└───────────────────────────────────────────────────────────────────────┘
|
|
30
|
+
`;
|
|
31
|
+
|
|
32
|
+
ReportCommand.args = { file: Args.string() };
|
|
33
|
+
|
|
34
|
+
module.exports = ReportCommand;
|