-
Notifications
You must be signed in to change notification settings - Fork 517
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(cli): consolidate common run flags in same file (#2390)
- Loading branch information
1 parent
fc9b91a
commit aec0b89
Showing
4 changed files
with
71 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
const { Flags } = require('@oclif/core'); | ||
|
||
const CommonRunFlags = { | ||
target: Flags.string({ | ||
char: 't', | ||
description: | ||
'Set target endpoint. Overrides the target already set in the test script' | ||
}), | ||
config: Flags.string({ | ||
char: 'c', | ||
description: 'Read configuration for the test from the specified file' | ||
}), | ||
// TODO: Replace with --profile | ||
environment: Flags.string({ | ||
char: 'e', | ||
description: 'Use one of the environments specified in config.environments' | ||
}), | ||
'scenario-name': Flags.string({ | ||
description: 'Name of the specific scenario to run' | ||
}), | ||
output: Flags.string({ | ||
char: 'o', | ||
description: 'Write a JSON report to file' | ||
}), | ||
dotenv: Flags.string({ | ||
description: 'Path to a dotenv file to load environment variables from' | ||
}), | ||
overrides: Flags.string({ | ||
description: 'Dynamically override values in the test script; a JSON object' | ||
}), | ||
insecure: Flags.boolean({ | ||
char: 'k', | ||
description: 'Allow insecure TLS connections; do not use in production' | ||
}), | ||
// multiple allows multiple arguments for the -i flag, which means that e.g.: | ||
// artillery -i one.yml -i two.yml main.yml | ||
// does not work as expected. Instead of being considered an argument, "main.yml" | ||
// is considered to be input for "-i" and oclif then complains about missing | ||
// argument | ||
input: Flags.string({ | ||
char: 'i', | ||
description: 'Input script file', | ||
multiple: true, | ||
hidden: true | ||
}), | ||
|
||
//Artillery Cloud commands | ||
tags: Flags.string({ | ||
description: | ||
'Comma-separated list of tags in key:value format to tag the test run, for example: --tags team:sqa,service:foo' | ||
}), | ||
note: Flags.string({ | ||
description: 'Add a note/annotation to the test run' | ||
}), | ||
record: Flags.boolean({ | ||
description: 'Record test run to Artillery Cloud' | ||
}), | ||
key: Flags.string({ | ||
description: 'API key for Artillery Cloud' | ||
}) | ||
}; | ||
|
||
module.exports = { | ||
CommonRunFlags | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters