kurtosis-tech / kurtosis

A platform for packaging and launching ephemeral backend stacks with a focus on approachability for the average developer.
https://docs.kurtosistech.com/
Apache License 2.0
353 stars 52 forks source link

piping doesn't work for run_sh #1597

Closed h4ck3rk3y closed 11 months ago

h4ck3rk3y commented 11 months ago

What's your CLI version?

0.84.9

Description & steps to reproduce

run = "cat /foo/bar.txt | tr -d '\n'"

for a file that looks like

foo

still keeps the newline

Desired behavior

the new line gets dropped due to the pipe

What is the severity of this bug?

Painful; this is causing significant friction in my workflow.

What area of the product does this pertain to?

CLI: the Command Line Interface

h4ck3rk3y commented 11 months ago
def run(plan):
  result = plan.run_sh(run="mkdir -p /src && echo kurtosis > /src/tech.txt", store=["/src/tech.txt"])
  file_artifacts = result.files_artifacts
  result2 = plan.run_sh(run="cat /temp/tech.txt", files={"/temp": file_artifacts[0]})
  plan.verify(result2.output, "==", "kurtosis\n")
  result2 = plan.run_sh(run="cat /temp/tech.txt | tr -d '\n'", files={"/temp": file_artifacts[0]})
  plan.verify(result2.output, "==", "kurtosis") # this should pass but fails