{"action":"created","issue":{"url":"https://api.github.com/repos/paulgibbs/behat-wordpress-extension/issues/18","repository_url":"https://api.github.com/repos/paulgibbs/behat-wordpress-extension","labels_url":"https://api.github.com/repos/paulgibbs/behat-wordpress-extension/issues/18/labels{/name}","comments_url":"https://api.github.com/repos/paulgibbs/behat-wordpress-extension/issues/18/comments","events_url":"https://api.github.com/repos/paulgibbs/behat-wordpress-extension/issues/18/events","html_url":"https://github.com/paulgibbs/behat-wordpress-extension/pull/18","id":200476045,"number":18,"title":"Quiet the call to wp-cli cache flush","user":{"login":"amwhalen","id":91678,"avatar_url":"https://avatars.githubusercontent.com/u/91678?v=3","gravatar_id":"","url":"https://api.github.com/users/amwhalen","html_url":"https://github.com/amwhalen","followers_url":"https://api.github.com/users/amwhalen/followers","following_url":"https://api.github.com/users/amwhalen/following{/other_user}","gists_url":"https://api.github.com/users/amwhalen/gists{/gist_id}","starred_url":"https://api.github.com/users/amwhalen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amwhalen/subscriptions","organizations_url":"https://api.github.com/users/amwhalen/orgs","repos_url":"https://api.github.com/users/amwhalen/repos","events_url":"https://api.github.com/users/amwhalen/events{/privacy}","received_events_url":"https://api.github.com/users/amwhalen/received_events","type":"User","site_admin":false},"labels":[{"id":336239322,"url":"https://api.github.com/repos/paulgibbs/behat-wordpress-extension/labels/bug","name":"bug","color":"fc2929","default":true},{"id":514024207,"url":"https://api.github.com/repos/paulgibbs/behat-wordpress-extension/labels/Under%20Consideration","name":"Under Consideration","color":"d4c5f9","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2017-01-12T20:50:55Z","updated_at":"2017-01-14T23:15:15Z","closed_at":"2017-01-14T23:03:09Z","pull_request":{"url":"https://api.github.com/repos/paulgibbs/behat-wordpress-extension/pulls/18","html_url":"https://github.com/paulgibbs/behat-wordpress-extension/pull/18","diff_url":"https://github.com/paulgibbs/behat-wordpress-extension/pull/18.diff","patch_url":"https://github.com/paulgibbs/behat-wordpress-extension/pull/18.patch"},"body":"While running behat with this extension I was getting `UnexpectedValueException` exceptions due to the cache flush outputting a success message. The exception caused behat to return an error code 1, despite successfully passing the Behat tests.\r\n\r\nThis pull request adds the `--quiet` argument to the call to WP-CLI's cache flush.\r\n\r\nHere's the sample output before the command was quieted:\r\n\r\n```\r\nFeature: As a visitor I should be able to load the home page\r\n\r\n  Scenario: Home page loads    # features/homepage.feature:3\r\n    Given I am on the homepage # Behat\\MinkExtension\\Context\\MinkContext::iAmOnHomepage()\r\n    Then I should see \"Sites\"  # Behat\\MinkExtension\\Context\\MinkContext::assertPageContainsText()\r\n  │\r\n  ╳  WP-CLI driver query failure: Success: The cache was flushed. (UnexpectedValueException)\r\n  │\r\n  └─ @AfterScenario # PaulGibbs\\WordpressBehatExtension\\Context\\WordpressContext::clearCache()\r\n\r\n1 scenario (1 passed)\r\n2 steps (2 passed)\r\n0m1.90s (11.83Mb)\r\nScript vendor/bin/behat --config=build/behat/behat.yml --colors handling the test-behat event returned with error code 1\r\n```\r\n\r\nAnd here's the output after:\r\n\r\n```\r\nFeature: As a visitor I should be able to load the home page\r\n\r\n  Scenario: Home page loads    # features/homepage.feature:3\r\n    Given I am on the homepage # Behat\\MinkExtension\\Context\\MinkContext::iAmOnHomepage()\r\n    Then I should see \"Sites\"  # Behat\\MinkExtension\\Context\\MinkContext::assertPageContainsText()\r\n\r\n1 scenario (1 passed)\r\n2 steps (2 passed)\r\n0m1.56s (11.83Mb)\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/paulgibbs/behat-wordpress-extension/issues/comments/272660548","html_url":"https://github.com/paulgibbs/behat-wordpress-extension/pull/18#issuecomment-272660548","issue_url":"https://api.github.com/repos/paulgibbs/behat-wordpress-extension/issues/18","id":272660548,"user":{"login":"paulgibbs","id":1275914,"avatar_url":"https://avatars.githubusercontent.com/u/1275914?v=3","gravatar_id":"","url":"https://api.github.com/users/paulgibbs","html_url":"https://github.com/paulgibbs","followers_url":"https://api.github.com/users/paulgibbs/followers","following_url":"https://api.github.com/users/paulgibbs/following{/other_user}","gists_url":"https://api.github.com/users/paulgibbs/gists{/gist_id}","starred_url":"https://api.github.com/users/paulgibbs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulgibbs/subscriptions","organizations_url":"https://api.github.com/users/paulgibbs/orgs","repos_url":"https://api.github.com/users/paulgibbs/repos","events_url":"https://api.github.com/users/paulgibbs/events{/privacy}","received_events_url":"https://api.github.com/users/paulgibbs/received_events","type":"User","site_admin":false},"created_at":"2017-01-14T23:15:15Z","updated_at":"2017-01-14T23:15:15Z","body":"Ok. To cut a long story short, to prevent exactly this happening, I'd intended to load a custom logger for WP-CLI. The `--quiet` arg has WP-CLI load its \"silent\" logger, but that's too silent for certain other commands that WordHat uses, so I wrote a custom logger. It lives here https://github.com/paulgibbs/Shouty-Logger-for-WP-CLI and we load that with WP-CLI's `--require=` argument.\r\n\r\nAs WP-CLI can load remote WordPress/WP-CLI over SSH (it passes through the local commands to the remote server), and because WordHat supports this, loading the custom logger in this configuration proved Complex. I've only had it working well in the last few weeks.\r\n\r\nHowever, when fixing that and testing it, I forgot to test WP-CLI without SSH. When I refactored this bootstrap process, I'd forgotten this configuration. I've made it better in 95a5e76, and tested it in every configuration I can think of. It's going to temporarily break WordHat on Windows, but I'll fix that once I have a report of something using this on that platform.\r\n\r\nThanks for highlighting this bug and oversight on my part, @amwhalen! :)"}}
{"actor":{"display_login":"paulgibbs"}}