moodlehq / moodle-docker

A docker environment for moodle developers
GNU General Public License v3.0
408 stars 250 forks source link

"And I pause scenario execution" doesn't work #96

Open tmuras opened 5 years ago

tmuras commented 5 years ago

Using the step "And I pause scenario execution" triggers an exception:

Break point should only be used with interative terminal. (Behat\Mink\Exception\ExpectationException)

even it the tests are run from inside docker container, using interactive session.

The good news is that it's only the check that is not working in docker:

        // Make sure this step is only used with interactive terminal (if detected).
        if ($posixexists && !@posix_isatty(STDOUT)) {
            $session = $this->getSession();
             throw new ExpectationException('Break point should only be used with interative terminal.', $session);
        }

Simply commenting out throwing an exception line will make the step to behave correctly: image

andrewnicols commented 5 years ago

When you run the Docker exec command pass it the -i flag for an interactive terminal

scara commented 5 years ago

Hi @tmuras, never tried by myself but it looks like we are missing -i or -t or -it here i.e. something like:

stdin_open: true # Maps -i
#tty: true # Maps -t, In case posix_isatty() requires even a TTY since it is called against STDOUT

for the composition i.e.:

$ git diff
diff --git a/base.yml b/base.yml
index 24f3882..6b7cdc0 100755
--- a/base.yml
+++ b/base.yml
@@ -2,6 +2,8 @@ version: "2"
 services:
   webserver:
     image: "moodlehq/moodle-php-apache:${MOODLE_DOCKER_PHP_VERSION}"
+    stdin_open: true
+    #tty: true
     depends_on:
       - db
     volumes:

It would be a nice add-on if it will work, given the right combination (just -i or -it or -t).

HTH, Matteo

stronk7 commented 5 years ago

Have anybody tried this? exec, base.yml or both? I know I can try, heh, just I'm lazy :-)

paulholden commented 3 years ago

Thanks @stronk7 for referring me to this task. I can confirm that @tmuras workaround to comment out the thrown exception during an interaction session on the Docker container did indeed work (after connecting via docker exec -it docker_webserver_1 bash)