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.
I wonder if we should call it just config?
There was a problem hiding this comment.
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.
configonly 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 andmetricsetConfigfor something specific of the metricset).- An alternative is to call it
config.Moduleso later we can also haveconfig.Metricsetbut 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 |
ruflin
left a comment
There was a problem hiding this comment.
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=apacheyou can test only that modulemodule_configsome modules have specific fields that arerequiredin order them to work.http/jsonmetricset is an example of a required field (namespace).module_configmap-field inconfig.ymladds the map to the config params of a module. For example with thisconfig.ymlinhttp/json/_meta/testdatamodule: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:OmitDocumentedFieldsCheckis a list of fields that must be omitted from the function that checks if the field is contained in{metricset}/_meta/fields.yml