Need help in reading input for terratest from CLI at run time using prompt way or command line input #284
-
|
Could you please let me know if it is possible to pass variable values to golang terratest from CLI instead terraformOptions Vars:. Please advise suitable solution At least let me know , Is it possible to read input from end user through prompt , I tried below code but did not work , It is not pausing and prompting its running without stop hence i am NOT able to pass dynamic input to terratest ` fmt.Print("Enter your name & age: ") |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
This is unfortunately by design. Terratest is meant to be a non-interactive testing framework, similar to The canonical way to handle what you are describing with secrets is to use environment variables, or a secrets management solution (like AWS Secrets Manager) and pull the data from those sources instead of feeding them in in an interactive manner. |
Beta Was this translation helpful? Give feedback.
This is unfortunately by design. Terratest is meant to be a non-interactive testing framework, similar to
npm test,pytest, and others. Under the hood, terratest uses the unit testing framework of golang (ingo test), and thus stdin is not accessible. It would take considerable effort for us to support this, and thus we are unlikely to support interactive prompts anytime soon.The canonical way to handle what you are describing with secrets is to use environment variables, or a secrets management solution (like AWS Secrets Manager) and pull the data from those sources instead of feeding them in in an interactive manner.