-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Add moduleFlag, omitDocumentedFieldsCheck and ModuleConfig to http testing framework #11660
Conversation
Type string | ||
URL string | ||
Suffix string | ||
ModuleConfig map[string]interface{} `yaml:"module_config"` |
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 wonder if we should call it just config
?
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.
The idea was that a reader can clearly understand that anything in this field is module related configuration and not test related configuration.
What about calling it just module
then? If the reason is to short it, the file is already called config.yml
so the fact that some configuration is going to be find inside is assumed.
config
only could lead to confusion as soon as we need any other config, for example metricset config (so we don't end up withconfig
, which refers to module config andmetricsetConfig
for something specific of the metricset).- An alternative is to call it
config.Module
so later we can also haveconfig.Metricset
but I think that as the file is calledconfig.yml
, prefixing a field withconfig.
is redundant as well as placing it in the suffix like now.
At the same time, if we maintain the variables names like config
in data_test.go
code, calls to this module configuration will look like config.Module
instead of config.Config
.
It's great to have the ability to run |
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 like calling the config option module
.
Yes! You must run it from |
Error seems unrelated. Merging |
@sayden Thanks 👍 I will try it again!! |
go test . -module=apache
you can test only that modulemodule_config
some modules have specific fields that arerequired
in order them to work.http/json
metricset is an example of a required field (namespace
).module_config
map-field inconfig.yml
adds the map to the config params of a module. For example with thisconfig.yml
inhttp/json/_meta/testdata
module:The following module config is produced:
omitDocumentedFieldsCheck
: Is a new config field to omit certain fields from being checked inside the documentation. As described in the code:OmitDocumentedFieldsCheck
is a list of fields that must be omitted from the function that checks if the field is contained in{metricset}/_meta/fields.yml