-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add ability to use a config file for the CLI tool #145
base: main
Are you sure you want to change the base?
Conversation
Another thing: as I did things here, when executing |
dcc8bf0
to
2f830ed
Compare
const configFileValidation = object({ | ||
// --gatling-home <value> | ||
gatlingHome: string.optional(), | ||
// --sources-folder <value> | ||
sourcesFolder: string.optional(), | ||
// --resources-folder <value> | ||
resourcesFolder: string.optional(), | ||
// --results-folder <value> | ||
resultsFolder: string.optional(), | ||
// --bundle-file <value> | ||
bundleFile: string.optional(), | ||
// --package-file <value> | ||
packageFile: string.optional(), | ||
// --memory <value> | ||
memory: number.optional(), | ||
// args [optionKey=optionValue...] | ||
runParameters: dictionary(string, string).default({}), | ||
// --control-plane-url <value> | ||
controlPlaneUrl: string.optional(), | ||
// --package-descriptor-filename <value> | ||
packageDescriptorFilename: string.optional() | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feels like yup (validation library that we use for frontend code)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Location
As you mentioned, I prefer to be in the .gatling
directory.
I hate tools that force to be in root, that clutters the main repository.
I, personally, do support the dot-config initiative.
HOCON vs JSON
I personally go to HOCON because it allows for including other files, env var substitution, reusing part of configuration, etc, while accepting a plain JSON.
In same file or not?
If HOCON, I'll go in the same file. but different "main" key
current one is gatling.enterprise.package
we can imagine another key, suggestions:
gatling.enterprise.build
gatling.enterprise.cli
gatling.enterprise.local
gatling.enterprise.arguments
gatling.enterprise.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the file is expected to be named package.conf
by default, IMO it should be in another file in .gatling/
. (HOCON allow file refs if users want it merged in a same file).
I agree on the key suggestion gatling.enterprise.cli
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See discussion in https://github.com/gatling/gatling-js/pull/145/files#r1981183789
|
||
export type ConfigFile = typeof configFileValidation.T; | ||
|
||
const configFileValidation = object({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would all these parameters except memory
, runParameters
and controlPlaneUrl
be configurable by the end users? They shouldn't.
Goal: avoid having to always specify all options on the command line, when many of them will always be the same for a given project.
Still in draft, because there is a discussion to have about the file format and file location/name.
.gatling/package.conf
by default) and for the thegatling.conf
file..gatling
folder (like the package descriptor file)? Tools like tsc/prettier/etc. just look for their config files at the root of the project folder by default, but since we already have this.gatling
folder, we should probably use it....gatling/cli.json
for testing, but I don't like it...