You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DataProviders should support processing wildcards when loading data.
A data wildcard is replaced at load time by the result of a function. Marvin should provide a set of built-in wildcards, but also allow custom wildcards to be plugged in.
Wildcards are defined as strings in data sources. But the result of its computation does not necessarily needs to result in a string, in which case a different type is returned, with the exception of the wildcard being surrounded prefixed and/or suffixed, in that case the result will be the string: prefix + str(value) + suffix.
A wildcard is represented as: OpeningTag + wildcard name + [:argument] + ClosingTag. I suggest using mustache's syntax (unless we think that may clash with real data). E.g.
a_key: {{wildcard_name:argument}}
when processed, marvin will look for a registered function under the name of wildcard_name which will be called with one string argument. If for some reason wildcard functions requires more than one argument, is up to them to parse the given argument into the required bits (e.g. comma splitting)
suggested built-in wildcards:
{{ENV:NAME}} or {{ENV:NAME:DEFAULT}}: replaced by the value of the environment variable NAME, or None, or DEFAULT
{{TIME}} or {{TIME:FORMAT}}: replaced by the current unix time, or a strftime string using the given FORMAT.
{{FILE:path}}: the result of reading the file at path (absolute or relative to cwd)
{{VAR:name}}: the value of the context var 'name'. Notice this can be processed at load time, but at access time.. this might be tricky, we might have to return a promise instead and resolve it per test script block.
The text was updated successfully, but these errors were encountered:
DataProviders should support processing wildcards when loading data.
A data wildcard is replaced at load time by the result of a function. Marvin should provide a set of built-in wildcards, but also allow custom wildcards to be plugged in.
Wildcards are defined as strings in data sources. But the result of its computation does not necessarily needs to result in a string, in which case a different type is returned, with the exception of the wildcard being surrounded prefixed and/or suffixed, in that case the result will be the string: prefix + str(value) + suffix.
A wildcard is represented as: OpeningTag + wildcard name + [:argument] + ClosingTag. I suggest using mustache's syntax (unless we think that may clash with real data). E.g.
when processed, marvin will look for a registered function under the name of
wildcard_name
which will be called with one string argument. If for some reason wildcard functions requires more than one argument, is up to them to parse the given argument into the required bits (e.g. comma splitting)suggested built-in wildcards:
The text was updated successfully, but these errors were encountered: