Closed ivan19871002 closed 1 year ago
It looks like you want to interpolate an environment variable that's set in your command
into the YAML.
I'm afraid this isn't really possible; YAML isn't designed to do string interpolation easily (there are lots of edge cases), and Smoke doesn't have enough information to do this.
I suggest you build your smoke.yaml file from a template, and then run it. You could use string interpolation or a transformation language such as jq (perhaps via yq) to construct it first.
It looks like you want to interpolate an environment variable that's set in your
command
into the YAML.I'm afraid this isn't really possible; YAML isn't designed to do string interpolation easily (there are lots of edge cases), and Smoke doesn't have enough information to do this.
I suggest you build your smoke.yaml file from a template, and then run it. You could use string interpolation or a transformation language such as jq (perhaps via yq) to construct it first.
tks, I use python modify smoke.yaml before test. It is work.
def replace_string_in_file(filename, old_str, new_str):
with open(filename, 'r') as file:
file_content = file.read()
file_content = file_content.replace(old_str, new_str)
with open(filename, 'w') as file:
file.write(file_content)
example I add daytime into os-release , like OS-VERSION=GITHUB-20230320-AAAA
my test cast
it is failed:smoke: ParseError {errError = ICUError U_REGEX_BAD_INTERVAL, errLine = Just 1, errOffset = Just 20}
if change ${day} to 20230320, it is success
so , If i want use parm for day , How should I write stdout?