intuit / judo

Judo is an easy-to-use Command Line Interface (CLI) Integration Testing Framework, driven from a simple yaml file that also contains assertions.
Other
51 stars 21 forks source link

STDOUT/STDERR not being caught from bash `read` cmd #25

Closed TennisGazelle closed 4 years ago

TennisGazelle commented 5 years ago

Is this a bug report, or a feature request? Bug report

What is the current behavior? When creating judo tests capture and reply to outputs prompt that should return a bash read command, it simply does not catch it if it gets reported to stdout or to stderr.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo repo of the problem.

run:
  simple-test:
    cwd: test-examples/
    command: ./name-echoer.sh
    when:
    - "Enter your name ": "daniel"

./name-echoer.sh

#/bin/bash
NAME='wei'
read -p "Enter your name " NAME </dev/tty
echo "your name is ${NAME}"

What is the expected behavior? It is expected that the when command will match with the prompt, and supply the actual reply back to the script. i.e. the output should NOT look like:

[INFO]     Executing run step: simple-test
[ERROR]    FAILED "simple-test": Expected "'", "\"" or [^'"\t ] but end of input found. (2ms)

[SUMMARY]  ============= JUDO TESTS COMPLETE =============
[SUMMARY]  test-examples/super-simple-test.yml
[ERROR]    FAILED: simple-test (0.002s)
[SUMMARY]  Total tests: 1 (0.002s)
[SUMMARY]  Passed:      0
[SUMMARY]  Failed:      1

What is your OS, OS version, and node version? Mac OS High Sierra 10.13.6 node 10.16.0