Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(json): Call to a member function getValue() on null in JsonContex… #26

Merged
merged 2 commits into from
Jan 12, 2024

Conversation

walva
Copy link

@walva walva commented Dec 21, 2023

Q A
Branch? main
Bug fix? yes
New feature? no
Deprecations? no
Tickets
License MIT
Doc PR

fix(json): Call to a member function getValue() on null in JsonContext:getJson

See here : 8215019#r109969509

Ping @Jean-Beru @develth @NicoHaase

@walva
Copy link
Author

walva commented Dec 21, 2023

Every tests work locally except tests/features/rest.feature:16.

I assume it is due to PHP 8.2

bin/behat tests/features/rest.feature --lang=fr 
PHP Deprecated:  Return type of GuzzleHttp\Cookie\CookieJar::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/ben/Work/symfony/contexts/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php on line 218

Deprecated: Return type of GuzzleHttp\Cookie\CookieJar::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/ben/Work/symfony/contexts/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php on line 218
PHP Deprecated:  Return type of GuzzleHttp\Cookie\CookieJar::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/ben/Work/symfony/contexts/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php on line 223

Deprecated: Return type of GuzzleHttp\Cookie\CookieJar::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/ben/Work/symfony/contexts/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php on line 223
@rest
Feature: Testing RESTContext

  Scenario: Testing headers                                                     # tests/features/rest.feature:4
    When I send a GET request to "rest/index.php"                               # Behatch\Context\RestContext::iSendARequestTo()
    And the header "Content-Type" should contain "text"                         # Behatch\Context\RestContext::theHeaderShouldContain()
    And the header "Content-Type" should be equal to "text/html; charset=UTF-8" # Behatch\Context\RestContext::theHeaderShouldBeEqualTo()
    And the header "Content-Type" should not be equal to "x-test/no-such-type"  # Behatch\Context\RestContext::theHeaderShouldNotBeEqualTo()
    And the header "Content-Type" should not contain "text/json"                # Behatch\Context\RestContext::theHeaderShouldNotContain()
    And the header "Content-Type" should match "@^text/html; [a-zA-Z=-]+@"      # Behatch\Context\RestContext::theHeaderShouldMatch()
    And the header "Content-Type" should not match "/^no-such-type$/"           # Behatch\Context\RestContext::theHeaderShouldNotMatch()
    And the header "xxx" should not exist                                       # Behatch\Context\RestContext::theHeaderShouldNotExist()
    And the response should expire in the future                                # Behatch\Context\RestContext::theResponseShouldExpireInTheFuture()
    And the response should be encoded in "UTF-8"                               # Behatch\Context\RestContext::theResponseShouldBeEncodedIn()

  Scenario: Testing request methods.                                    # tests/features/rest.feature:16
    Given I send a GET request to "/rest/index.php"                     # Behatch\Context\RestContext::iSendARequestTo()
    Then I should see "You have sent a GET request. "                   # Behat\MinkExtension\Context\MinkContext::assertPageContainsText()
    And I should see "No parameter received"                            # Behat\MinkExtension\Context\MinkContext::assertPageContainsText()
    When I send a GET request to "/rest/index.php?first=foo&second=bar" # Behatch\Context\RestContext::iSendARequestTo()
    Then I should see "You have sent a GET request. "                   # Behat\MinkExtension\Context\MinkContext::assertPageContainsText()
    And I should see "2 parameter(s)"                                   # Behat\MinkExtension\Context\MinkContext::assertPageContainsText()
    And I should see "first : foo"                                      # Behat\MinkExtension\Context\MinkContext::assertPageContainsText()
    And I should see "second : bar"                                     # Behat\MinkExtension\Context\MinkContext::assertPageContainsText()
    When I send a POST request to "/rest/index.php" with parameters:    # Behatch\Context\RestContext::iSendARequestToWithParameters()
      | key     | value      |
      | foo     | bar        |
      | foofile | @lorem.txt |
      8192: Creation of dynamic property GuzzleHttp\Psr7\MultipartStream::$stream is deprecated in vendor/guzzlehttp/psr7/src/MultipartStream.php line 34
    Then I should see "You have sent a POST request. "                  # Behat\MinkExtension\Context\MinkContext::assertPageContainsText()
    And I should see "1 parameter(s)"                                   # Behat\MinkExtension\Context\MinkContext::assertPageContainsText()
    And I should see "1 file(s)"                                        # Behat\MinkExtension\Context\MinkContext::assertPageContainsText()
    And I should see "foo : bar"                                        # Behat\MinkExtension\Context\MinkContext::assertPageContainsText()
    And I should see "foofile - name : lorem.txt"                       # Behat\MinkExtension\Context\MinkContext::assertPageContainsText()
    And I should see "foofile - error : 0"                              # Behat\MinkExtension\Context\MinkContext::assertPageContainsText()
    And I should see "foofile - size : 39"                              # Behat\MinkExtension\Context\MinkContext::assertPageContainsText()
    When I send a PUT request to "/rest/index.php"                      # Behatch\Context\RestContext::iSendARequestTo()
    Then I should see "You have sent a PUT request. "                   # Behat\MinkExtension\Context\MinkContext::assertPageContainsText()
    When I send a DELETE request to "/rest/index.php"                   # Behatch\Context\RestContext::iSendARequestTo()
    Then I should see "You have sent a DELETE request. "                # Behat\MinkExtension\Context\MinkContext::assertPageContainsText()
    When I send a POST request to "/rest/index.php" with body:          # Behatch\Context\RestContext::iSendARequestToWithBody()
      """
      This is a body.
      """
    Then I should see "Body : This is a body."                          # Behat\MinkExtension\Context\MinkContext::assertPageContainsText()
    When I send a PUT request to "/rest/index.php" with body:           # Behatch\Context\RestContext::iSendARequestToWithBody()
      """
      {"this is":"some json"}
      """
    Then the response should be empty                                   # Behatch\Context\RestContext::theResponseShouldBeEmpty()

  Scenario: request parameter with dot                               # tests/features/rest.feature:57
      https://github.com/Behatch/contexts/issues/256
    When I send a POST request to "/rest/index.php" with parameters: # Behatch\Context\RestContext::iSendARequestToWithParameters()
      | key     | value |
      | item.id | 1     |
    Then I should see "item.id=1"                                    # Behat\MinkExtension\Context\MinkContext::assertPageContainsText()

  Scenario: Add header                             # tests/features/rest.feature:64
    Given I add "xxx" header equal to "yyy"        # Behatch\Context\RestContext::iAddHeaderEqualTo()
    When I send a GET request to "/rest/index.php" # Behatch\Context\RestContext::iSendARequestTo()
    Then I should see "HTTP_XXX : yyy"             # Behat\MinkExtension\Context\MinkContext::assertPageContainsText()

  Scenario: Add header with large numeric value                            # tests/features/rest.feature:69
    Given I add "xxx-large-numeric" header equal to "92233720368547758070" # Behatch\Context\RestContext::iAddHeaderEqualTo()
    When I send a GET request to "/rest/index.php"                         # Behatch\Context\RestContext::iSendARequestTo()
    Then I should see "HTTP_XXX_LARGE_NUMERIC : 92233720368547758070"      # Behat\MinkExtension\Context\MinkContext::assertPageContainsText()

  Scenario: Header should not be cross-scenarios persistent # tests/features/rest.feature:74
    When I send a GET request to "/rest/index.php"          # Behatch\Context\RestContext::iSendARequestTo()
    Then I should not see "HTTP_XXX : yyy"                  # Behat\MinkExtension\Context\MinkContext::assertPageNotContainsText()
    Then I should not see "HTTP_XXX_LARGE_NUMERIC"          # Behat\MinkExtension\Context\MinkContext::assertPageNotContainsText()

  Scenario: Case-insensitive header name                 # tests/features/rest.feature:79
      Like describe in the rfc2614 §4.2
      https://tools.ietf.org/html/rfc2616#section-4.2
    When I send a GET request to "rest/index.php"        # Behatch\Context\RestContext::iSendARequestTo()
    Then the header "content-type" should contain "text" # Behatch\Context\RestContext::theHeaderShouldContain()

  Scenario: Debug                                                    # tests/features/rest.feature:86
    Given I add "xxx" header equal to "yyy"                          # Behatch\Context\RestContext::iAddHeaderEqualTo()
    When I send a POST request to "/rest/index.php" with parameters: # Behatch\Context\RestContext::iSendARequestToWithParameters()
      | key | value |
      | foo | bar   |
    Then print last response headers                                 # Behatch\Context\RestContext::printLastResponseHeaders()
      │ host: localhost:8080
      │ connection: close
      │ x-powered-by: PHP/8.2.12
      │ date: 2023-12-21T10:16:08+00:00
      │ expires: 2023-12-21T10:17:08+00:00
      │ content-type: text/html; charset=utf-8
      │ 
    And print the corresponding curl command                         # Behatch\Context\RestContext::printTheCorrespondingCurlCommand()
      │ curl -X POST --data 'foo=bar' 'http://localhost:8080/rest/index.php'

  Scenario: Response body                 # tests/features/rest.feature:94
    Given I send a GET request to "/"     # Behatch\Context\RestContext::iSendARequestTo()
    Then the response should be equal to: # Behatch\Context\RestContext::theResponseShouldBeEqualTo()
      """
      Congratulations, you've correctly set up your apache environment.
      """

  Scenario: Accept header should not be set by dfault # tests/features/rest.feature:101
    When I send a GET request to "/rest/index.php"    # Behatch\Context\RestContext::iSendARequestTo()
    Then I should not see "HTTP_ACCEPT"               # Behat\MinkExtension\Context\MinkContext::assertPageNotContainsText()

  @>php5.5
  Scenario: Set content headers in POST request                 # tests/features/rest.feature:106
    When I add "Content-Type" header equal to "xxx"             # Behatch\Context\RestContext::iAddHeaderEqualTo()
    When I send a "POST" request to "rest/index.php" with body: # Behatch\Context\RestContext::iSendARequestToWithBody()
      """
      {"name": "test"}
      """
    Then the response should contain ">CONTENT_TYPE : xxx"      # Behat\MinkExtension\Context\MinkContext::assertResponseContains()
    Then the response should contain ">HTTP_CONTENT_TYPE : xxx" # Behat\MinkExtension\Context\MinkContext::assertResponseContains()

  Scenario: Content header is clear in different scenario           # tests/features/rest.feature:115
    When I send a "POST" request to "rest/index.php" with body:     # Behatch\Context\RestContext::iSendARequestToWithBody()
      """
      {"name": "test"}
      """
    Then the response should not contain ">CONTENT_TYPE : xxx"      # Behat\MinkExtension\Context\MinkContext::assertResponseNotContains()
    Then the response should not contain ">HTTP_CONTENT_TYPE : xxx" # Behat\MinkExtension\Context\MinkContext::assertResponseNotContains()

--- Scénarios échoués:

    tests/features/rest.feature:16

12 scénarios (11 succès, 1 échecs)
62 étapes (46 succès, 1 échecs, 15 ignorés)
0m0.05s (14.52Mb)

@jakub-sellerpoint
Copy link

I also have the same issue with all rest requests: Fatal error: Call to a member function getValue() on null (Behat\Testwork\Call\Exception\FatalThrowableError)

@Jean-Beru
Copy link
Collaborator

Thanks for your PR @walva.

The CI still fail due to an WebDriver\Exception\NoSuchDriver exception thrown in HttpCallListener. Maybe we can add something like this in the last try ... catch

catch(\WebDriver\Exception $e) {
    // No WebDriver
}

WDYT ?

@walva
Copy link
Author

walva commented Jan 2, 2024

Hello @Jean-Beru,

I trust you if you tell me it's needed. I would say we could also let the exception propagate. Furthermore, I am unable to express any strong opinion because of my level of knowledge of this package.

Regarding the error, do you know how I can reproduce locally?
I would like to avoid adding the statement without testing or understanding what I am doing. I'm not even sure where I should add the try/catch block.

I see in the CI the error is with PHP 8.1 & ./bin/behat --profile=symfony2, which is currently passing on my computer with PHP 8.2. I will need to find a way to switch PHP version on my computer or use a container to do so.
image

@Jean-Beru
Copy link
Collaborator

Jean-Beru commented Jan 3, 2024

I finally reproduced this fail using act, its full Ubuntu image (18Gb 😱) and some fixes!

The error is due to the debug.feature test ran just before system.feature. The DebugContext uses the Selenium2Driver and stops the session at the end. But the next test does not start any session, so $this->mink->getSession()->getPage()->getContent() fails.

I think that we can add the following catch to solve the issue:

        } catch (\WebDriver\Exception\NoSuchDriver $e) {
            // A session is either terminated or not started
        }

@walva Can you update your PR, test it in your CI and push please ?

@walva
Copy link
Author

walva commented Jan 11, 2024

@Jean-Beru I'm working on it. I've installed act. Thanks for the help!

Presently, I cannot run any behat job on my machine. What machine do you have ? (I have a Macbook M series)

image

@walva
Copy link
Author

walva commented Jan 11, 2024

Here is the stack trace I have, while commenting .github/workflows/ci.yml:126 to only enable the profile symfony2 which is failing.

I will try at home with a windows machine (WSL)

act -j behat --container-architecture linux/amd64
[CI/Behat] 🚀  Start image=catthehacker/ubuntu:full-22.04
INFO[0000] Parallel tasks (0) below minimum, setting to 1 
[CI/Behat]   🐳  docker pull image=catthehacker/ubuntu:full-22.04 platform=linux/amd64 username= forcePull=true
INFO[0001] Parallel tasks (0) below minimum, setting to 1 
[CI/Behat]   🐳  docker create image=catthehacker/ubuntu:full-22.04 platform=linux/amd64 entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host"
[CI/Behat]   🐳  docker run image=catthehacker/ubuntu:full-22.04 platform=linux/amd64 entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host"
[CI/Behat]   🐳  docker exec cmd=[chown -R 1001:127 /Users/ben/Work/symfony/contexts] user=0 workdir=
[CI/Behat]   ☁  git clone 'https://github.com/shivammathur/setup-php' # ref=v2
[CI/Behat]   ☁  git clone 'https://github.com/actions/setup-java' # ref=v3
[CI/Behat]   ☁  git clone 'https://github.com/actions/cache' # ref=v3
[CI/Behat] 🧪  Matrix: map[php:8.1 profile:symfony2]
[CI/Behat] ⭐ Run Main actions/checkout@v3
[CI/Behat]   🐳  docker cp src=/Users/ben/Work/symfony/contexts/. dst=/Users/ben/Work/symfony/contexts
[CI/Behat]   🐳  docker exec cmd=[chown -R 1001:127 /Users/ben/Work/symfony/contexts] user=0 workdir=
[CI/Behat]   ✅  Success - Main actions/checkout@v3
[CI/Behat] ⭐ Run Main Setup PHP
[CI/Behat]   🐳  docker cp src=/Users/ben/.cache/act/shivammathur-setup-php@v2/ dst=/var/run/act/actions/shivammathur-setup-php@v2/
[CI/Behat]   🐳  docker exec cmd=[chown -R 1001:127 /var/run/act/actions/shivammathur-setup-php@v2/] user=0 workdir=
[CI/Behat]   🐳  docker exec cmd=[node /var/run/act/actions/shivammathur-setup-php@v2/dist/index.js] user= workdir=
| [command]/usr/bin/bash /run/act/actions/shivammathur-setup-php@v2/src/scripts/run.sh
| 
| ==> Setup PHP
| ✓ PHP Found PHP 8.1.2
| 
| ==> Setup Extensions
| ✓ intl Enabled
| ✓ bcmath Enabled
| ✓ curl Enabled
| ✓ openssl Enabled
| ✓ mbstring Enabled
| 
| ==> Setup Tools
| ✓ composer Added composer 2.6.6
| ✓ PECL Added PECL 1.10.12
| 
| ==> Setup Coverage
| ✓ pcov.enabled=1 Added to php.ini
| ✓ pcov PCOV 1.0.11 enabled as coverage driver
| 
| ==> Add php.ini values
| ✓ memory_limit=-1 Added to php.ini
| ✓ display_errors=1 Added to php.ini
| ✓ error_reporting=-1 Added to php.ini
| 
| ==> Sponsor setup-php
| ✓ setup-php https://setup-php.com/sponsor
[CI/Behat]   ✅  Success - Main Setup PHP
[CI/Behat]   ⚙  ::set-env:: COMPOSER_NO_AUDIT=1
[CI/Behat]   ⚙  ::set-env:: RUNNER_TOOL_CACHE=/tmp
[CI/Behat]   ⚙  ::set-env:: COMPOSER_PROCESS_TIMEOUT=0
[CI/Behat]   ⚙  ::set-env:: COMPOSER_NO_INTERACTION=1
[CI/Behat]   ⚙  ::set-output:: php-version=8.1.2
[CI/Behat]   ⚙  ::add-path:: /home/runner/.composer/vendor/bin
[CI/Behat] ⭐ Run Main Setup Java
[CI/Behat]   🐳  docker cp src=/Users/ben/.cache/act/actions-setup-java@v3/ dst=/var/run/act/actions/actions-setup-java@v3/
[CI/Behat]   🐳  docker exec cmd=[chown -R 1001:127 /var/run/act/actions/actions-setup-java@v3/] user=0 workdir=
[CI/Behat]   🐳  docker exec cmd=[node /var/run/act/actions/actions-setup-java@v3/dist/setup/index.js] user= workdir=
[CI/Behat]   ❓  ::group::Installed distributions
| Trying to resolve the latest version from remote
| Resolved latest version as 8.0.392+8
| Trying to download...
| Downloading Java 8.0.392+8 (Temurin-Hotspot) from https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u392-b08/OpenJDK8U-jdk_x64_linux_hotspot_8u392b08.tar.gz ...
[CI/Behat]   💬  ::debug::Downloading https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u392-b08/OpenJDK8U-jdk_x64_linux_hotspot_8u392b08.tar.gz
[CI/Behat]   💬  ::debug::Destination /tmp/eea1715c-65c4-4670-8698-8ca8582d7ee7
[CI/Behat]   💬  ::debug::download complete
| Extracting Java archive...
[CI/Behat]   💬  ::debug::Checking tar --version
[CI/Behat]   💬  ::debug::tar (GNU tar) 1.34%0ACopyright (C) 2021 Free Software Foundation, Inc.%0ALicense GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.%0AThis is free software: you are free to change and redistribute it.%0AThere is NO WARRANTY, to the extent permitted by law.%0A%0AWritten by John Gilmore and Jay Fenlason.
| [command]/usr/bin/tar xz --warning=no-unknown-keyword -C /tmp/afb872fb-d960-4731-9fb2-0235ed41f8d1 -f /tmp/eea1715c-65c4-4670-8698-8ca8582d7ee7
[CI/Behat]   💬  ::debug::Caching tool Java_Temurin-Hotspot_jdk 8.0.392-8 x64
[CI/Behat]   💬  ::debug::source dir: /tmp/afb872fb-d960-4731-9fb2-0235ed41f8d1/jdk8u392-b08
[CI/Behat]   💬  ::debug::destination /tmp/Java_Temurin-Hotspot_jdk/8.0.392-8/x64
[CI/Behat]   💬  ::debug::finished caching tool
| Java 8.0.392+8 was downloaded
| Setting Java 8.0.392+8 as the default
| Creating toolchains.xml for JDK version 8 from temurin
| Writing to /home/runner/.m2/toolchains.xml
| 
| Java configuration:
|   Distribution: temurin
|   Version: 8.0.392+8
|   Path: /tmp/Java_Temurin-Hotspot_jdk/8.0.392-8/x64
| 
[CI/Behat]   ❓  ::endgroup::
[CI/Behat]   ❓ add-matcher /run/act/actions/actions-setup-java@v3/.github/java.json
| Creating settings.xml with server-id: github
| Writing to /home/runner/.m2/settings.xml
[CI/Behat]   ✅  Success - Main Setup Java
[CI/Behat]   ⚙  ::set-env:: JAVA_HOME=/tmp/Java_Temurin-Hotspot_jdk/8.0.392-8/x64
[CI/Behat]   ⚙  ::set-env:: JAVA_HOME_8_X64=/tmp/Java_Temurin-Hotspot_jdk/8.0.392-8/x64
[CI/Behat]   ⚙  ::set-output:: version=8.0.392+8
[CI/Behat]   ⚙  ::set-output:: distribution=Temurin-Hotspot
[CI/Behat]   ⚙  ::set-output:: path=/tmp/Java_Temurin-Hotspot_jdk/8.0.392-8/x64
[CI/Behat]   ⚙  ::add-path:: /tmp/Java_Temurin-Hotspot_jdk/8.0.392-8/x64/bin
[CI/Behat] ⭐ Run Main Run Selenium
[CI/Behat]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/3] user= workdir=
| --2024-01-11 09:21:20--  https://selenium-release.storage.googleapis.com/3.9/selenium-server-standalone-3.9.1.jar
| Resolving selenium-release.storage.googleapis.com (selenium-release.storage.googleapis.com)... 142.250.110.207, 64.233.184.207, 142.251.173.207, ...
| Connecting to selenium-release.storage.googleapis.com (selenium-release.storage.googleapis.com)|142.250.110.207|:443... connected.
| HTTP request sent, awaiting response... 200 OK
| Length: 23428464 (22M) [application/java-archive]
| Saving to: ‘selenium.jar’
| 
selenium.jar        100%[===================>]  22.34M  15.6MB/s    in 1.4s    
| 
| 2024-01-11 09:21:21 (15.6 MB/s) - ‘selenium.jar’ saved [23428464/23428464]
| 
[CI/Behat]   ✅  Success - Main Run Selenium
[CI/Behat] ⭐ Run Main Run PHP fixtures server
[CI/Behat]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/4] user= workdir=
[CI/Behat]   ✅  Success - Main Run PHP fixtures server
[CI/Behat] ⭐ Run Main Get composer cache directory
[CI/Behat]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/composercache] user= workdir=
[CI/Behat]   ✅  Success - Main Get composer cache directory
[CI/Behat]   ⚙  ::set-output:: dir=/home/runner/.cache/composer/files
[CI/Behat]   🐳  docker exec cmd=[node /var/run/act/workflow/hashfiles/index.js] user= workdir=
[CI/Behat] ⭐ Run Main Cache dependencies
[CI/Behat]   🐳  docker cp src=/Users/ben/.cache/act/actions-cache@v3/ dst=/var/run/act/actions/actions-cache@v3/
[CI/Behat]   🐳  docker exec cmd=[chown -R 1001:127 /var/run/act/actions/actions-cache@v3/] user=0 workdir=
[CI/Behat]   🐳  docker exec cmd=[node /var/run/act/actions/actions-cache@v3/dist/restore/index.js] user= workdir=
[CI/Behat]   💬  ::debug::Resolved Keys:
[CI/Behat]   💬  ::debug::["Linux-composer-a95c6428ddc1661bd3170dc82fc49e709a1a56eecfa268111f004dcdcf22a0a3","Linux-composer-"]
[CI/Behat]   💬  ::debug::Checking zstd --quiet --version
[CI/Behat]   💬  ::debug::1.5.5
[CI/Behat]   💬  ::debug::zstd version: 1.5.5
[CI/Behat]   💬  ::debug::Resource Url: http://10.102.24.1:57493/_apis/artifactcache/cache?keys=Linux-composer-a95c6428ddc1661bd3170dc82fc49e709a1a56eecfa268111f004dcdcf22a0a3%252CLinux-composer-&version=16f0fbd9c90a1120831a20985c6552f7d9cf86f6c6110fbd7fecda246ef95745
[CI/Behat]   ⚙  ***
[CI/Behat]   💬  ::debug::Cache Result:
[CI/Behat]   💬  ::debug::{"archiveLocation":"***","cacheKey":"linux-composer-a95c6428ddc1661bd3170dc82fc49e709a1a56eecfa268111f004dcdcf22a0a3","result":"hit"}
[CI/Behat]   💬  ::debug::Archive Path: /tmp/2f4cb5ad-80b5-460f-a661-9f22c82ed7a1/cache.tzst
[CI/Behat]   💬  ::debug::Use Azure SDK: false
[CI/Behat]   💬  ::debug::Download concurrency: 8
[CI/Behat]   💬  ::debug::Request timeout (ms): 30000
[CI/Behat]   💬  ::debug::Cache segment download timeout mins env var: undefined
[CI/Behat]   💬  ::debug::Segment download timeout (ms): 600000
[CI/Behat]   💬  ::debug::Lookup only: false
| Cache Size: ~4 MB (4465340 B)
| [command]/usr/bin/tar -xf /tmp/2f4cb5ad-80b5-460f-a661-9f22c82ed7a1/cache.tzst -P -C /Users/ben/Work/symfony/contexts --use-compress-program unzstd
| Cache restored successfully
| Cache restored from key: linux-composer-a95c6428ddc1661bd3170dc82fc49e709a1a56eecfa268111f004dcdcf22a0a3
[CI/Behat]   ✅  Success - Main Cache dependencies
[CI/Behat]   ⚙  ::set-output:: cache-hit=true
[CI/Behat] ⭐ Run Main Update project dependencies
[CI/Behat]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/7] user= workdir=
| Loading composer repositories with package information
| Updating dependencies
| Lock file operations: 75 installs, 0 updates, 0 removals
|   - Locking atoum/atoum (4.2.0)
|   - Locking atoum/stubs (2.6.0)
|   - Locking behat/behat (v3.14.0)
|   - Locking behat/gherkin (v4.9.0)
|   - Locking behat/mink (v1.11.0)
|   - Locking behat/mink-browserkit-driver (v1.4.1)
|   - Locking behat/mink-goutte-driver (v1.3.0)
|   - Locking behat/mink-selenium2-driver (v1.7.0)
|   - Locking behat/transliterator (v1.5.0)
|   - Locking doctrine/instantiator (2.0.0)
|   - Locking fabpot/goutte (v3.3.1)
|   - Locking friends-of-behat/mink-extension (v2.7.5)
|   - Locking guzzlehttp/guzzle (6.5.8)
|   - Locking guzzlehttp/promises (1.5.3)
|   - Locking guzzlehttp/psr7 (1.9.1)
|   - Locking instaclick/php-webdriver (1.4.18)
|   - Locking justinrainbow/json-schema (v5.2.13)
|   - Locking myclabs/deep-copy (1.11.1)
|   - Locking nikic/php-parser (v5.0.0)
|   - Locking phar-io/manifest (2.0.3)
|   - Locking phar-io/version (3.2.1)
|   - Locking phpunit/php-code-coverage (9.2.30)
|   - Locking phpunit/php-file-iterator (3.0.6)
|   - Locking phpunit/php-invoker (3.1.1)
|   - Locking phpunit/php-text-template (2.0.4)
|   - Locking phpunit/php-timer (5.0.3)
|   - Locking phpunit/phpunit (9.6.15)
|   - Locking psr/container (2.0.2)
|   - Locking psr/event-dispatcher (1.0.0)
|   - Locking psr/http-message (1.1)
|   - Locking ralouphie/getallheaders (3.0.3)
|   - Locking sebastian/cli-parser (1.0.1)
|   - Locking sebastian/code-unit (1.0.8)
|   - Locking sebastian/code-unit-reverse-lookup (2.0.3)
|   - Locking sebastian/comparator (4.0.8)
|   - Locking sebastian/complexity (2.0.3)
|   - Locking sebastian/diff (4.0.5)
|   - Locking sebastian/environment (5.1.5)
|   - Locking sebastian/exporter (4.0.5)
|   - Locking sebastian/global-state (5.0.6)
|   - Locking sebastian/lines-of-code (1.0.4)
|   - Locking sebastian/object-enumerator (4.0.4)
|   - Locking sebastian/object-reflector (2.0.4)
|   - Locking sebastian/recursion-context (4.0.5)
|   - Locking sebastian/resource-operations (3.0.3)
|   - Locking sebastian/type (3.2.1)
|   - Locking sebastian/version (3.0.2)
|   - Locking symfony/browser-kit (v4.4.44)
|   - Locking symfony/config (v6.4.0)
|   - Locking symfony/console (v6.4.2)
|   - Locking symfony/css-selector (v5.4.26)
|   - Locking symfony/dependency-injection (v6.4.2)
|   - Locking symfony/deprecation-contracts (v3.4.0)
|   - Locking symfony/dom-crawler (v4.4.45)
|   - Locking symfony/event-dispatcher (v6.4.2)
|   - Locking symfony/event-dispatcher-contracts (v3.4.0)
|   - Locking symfony/filesystem (v6.4.0)
|   - Locking symfony/http-foundation (v6.4.2)
|   - Locking symfony/polyfill-ctype (v1.28.0)
|   - Locking symfony/polyfill-intl-grapheme (v1.28.0)
|   - Locking symfony/polyfill-intl-idn (v1.28.0)
|   - Locking symfony/polyfill-intl-normalizer (v1.28.0)
|   - Locking symfony/polyfill-mbstring (v1.28.0)
|   - Locking symfony/polyfill-php72 (v1.28.0)
|   - Locking symfony/polyfill-php80 (v1.28.0)
|   - Locking symfony/polyfill-php83 (v1.28.0)
|   - Locking symfony/property-access (v6.4.0)
|   - Locking symfony/property-info (v6.4.0)
|   - Locking symfony/service-contracts (v3.4.1)
|   - Locking symfony/string (v6.4.2)
|   - Locking symfony/translation (v6.4.2)
|   - Locking symfony/translation-contracts (v3.4.1)
|   - Locking symfony/var-exporter (v6.4.2)
|   - Locking symfony/yaml (v6.4.0)
|   - Locking theseer/tokenizer (1.2.2)
| Writing lock file
| Installing dependencies from lock file (including require-dev)
| Package operations: 75 installs, 0 updates, 0 removals
|   - Downloading friends-of-behat/mink-extension (v2.7.5)
|   - Installing atoum/atoum (4.2.0): Extracting archive
|   - Installing atoum/stubs (2.6.0): Extracting archive
|   - Installing behat/gherkin (v4.9.0): Extracting archive
|   - Installing symfony/polyfill-php80 (v1.28.0): Extracting archive
|   - Installing symfony/polyfill-mbstring (v1.28.0): Extracting archive
|   - Installing symfony/polyfill-ctype (v1.28.0): Extracting archive
|   - Installing symfony/dom-crawler (v4.4.45): Extracting archive
|   - Installing symfony/css-selector (v5.4.26): Extracting archive
|   - Installing symfony/browser-kit (v4.4.44): Extracting archive
|   - Installing symfony/polyfill-php72 (v1.28.0): Extracting archive
|   - Installing symfony/polyfill-intl-normalizer (v1.28.0): Extracting archive
|   - Installing symfony/polyfill-intl-idn (v1.28.0): Extracting archive
|   - Installing ralouphie/getallheaders (3.0.3): Extracting archive
|   - Installing psr/http-message (1.1): Extracting archive
|   - Installing guzzlehttp/psr7 (1.9.1): Extracting archive
|   - Installing guzzlehttp/promises (1.5.3): Extracting archive
|   - Installing guzzlehttp/guzzle (6.5.8): Extracting archive
|   - Installing fabpot/goutte (v3.3.1): Extracting archive
|   - Installing behat/mink (v1.11.0): Extracting archive
|   - Installing behat/mink-browserkit-driver (v1.4.1): Extracting archive
|   - Installing behat/mink-goutte-driver (v1.3.0): Extracting archive
|   - Installing instaclick/php-webdriver (1.4.18): Extracting archive
|   - Installing behat/mink-selenium2-driver (v1.7.0): Extracting archive
|   - Installing behat/transliterator (v1.5.0): Extracting archive
|   - Installing symfony/filesystem (v6.4.0): Extracting archive
|   - Installing symfony/deprecation-contracts (v3.4.0): Extracting archive
|   - Installing symfony/config (v6.4.0): Extracting archive
|   - Installing symfony/yaml (v6.4.0): Extracting archive
|   - Installing symfony/translation-contracts (v3.4.1): Extracting archive
|   - Installing symfony/translation (v6.4.2): Extracting archive
|   - Installing psr/event-dispatcher (1.0.0): Extracting archive
|   - Installing symfony/event-dispatcher-contracts (v3.4.0): Extracting archive
|   - Installing symfony/event-dispatcher (v6.4.2): Extracting archive
|   - Installing symfony/var-exporter (v6.4.2): Extracting archive
|   - Installing psr/container (2.0.2): Extracting archive
|   - Installing symfony/service-contracts (v3.4.1): Extracting archive
|   - Installing symfony/dependency-injection (v6.4.2): Extracting archive
|   - Installing symfony/polyfill-intl-grapheme (v1.28.0): Extracting archive
|   - Installing symfony/string (v6.4.2): Extracting archive
|   - Installing symfony/console (v6.4.2): Extracting archive
|   - Installing behat/behat (v3.14.0): Extracting archive
|   - Installing friends-of-behat/mink-extension (v2.7.5): Extracting archive
|   - Installing justinrainbow/json-schema (v5.2.13): Extracting archive
|   - Installing sebastian/version (3.0.2): Extracting archive
|   - Installing sebastian/type (3.2.1): Extracting archive
|   - Installing sebastian/resource-operations (3.0.3): Extracting archive
|   - Installing sebastian/recursion-context (4.0.5): Extracting archive
|   - Installing sebastian/object-reflector (2.0.4): Extracting archive
|   - Installing sebastian/object-enumerator (4.0.4): Extracting archive
|   - Installing sebastian/global-state (5.0.6): Extracting archive
|   - Installing sebastian/exporter (4.0.5): Extracting archive
|   - Installing sebastian/environment (5.1.5): Extracting archive
|   - Installing sebastian/diff (4.0.5): Extracting archive
|   - Installing sebastian/comparator (4.0.8): Extracting archive
|   - Installing sebastian/code-unit (1.0.8): Extracting archive
|   - Installing sebastian/cli-parser (1.0.1): Extracting archive
|   - Installing phpunit/php-timer (5.0.3): Extracting archive
|   - Installing phpunit/php-text-template (2.0.4): Extracting archive
|   - Installing phpunit/php-invoker (3.1.1): Extracting archive
|   - Installing phpunit/php-file-iterator (3.0.6): Extracting archive
|   - Installing theseer/tokenizer (1.2.2): Extracting archive
|   - Installing nikic/php-parser (v5.0.0): Extracting archive
|   - Installing sebastian/lines-of-code (1.0.4): Extracting archive
|   - Installing sebastian/complexity (2.0.3): Extracting archive
|   - Installing sebastian/code-unit-reverse-lookup (2.0.3): Extracting archive
|   - Installing phpunit/php-code-coverage (9.2.30): Extracting archive
|   - Installing phar-io/version (3.2.1): Extracting archive
|   - Installing phar-io/manifest (2.0.3): Extracting archive
|   - Installing myclabs/deep-copy (1.11.1): Extracting archive
|   - Installing doctrine/instantiator (2.0.0): Extracting archive
|   - Installing phpunit/phpunit (9.6.15): Extracting archive
|   - Installing symfony/polyfill-php83 (v1.28.0): Extracting archive
|   - Installing symfony/http-foundation (v6.4.2): Extracting archive
|   - Installing symfony/property-info (v6.4.0): Extracting archive
|   - Installing symfony/property-access (v6.4.0): Extracting archive
| 9 package suggestions were added by new dependencies, use `composer suggest` to see details.
| Package behat/mink-goutte-driver is abandoned, you should avoid using it. Use behat/mink-browserkit-driver instead.
| Package fabpot/goutte is abandoned, you should avoid using it. Use symfony/browser-kit instead.
| Generating autoload files
| 55 packages you are using are looking for funding.
| Use the `composer fund` command to find out more!
[CI/Behat]   ✅  Success - Main Update project dependencies
[CI/Behat] ⭐ Run Main Wait for browser & PHP to start
[CI/Behat]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/8] user= workdir=
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
| Waiting for Selenium to start...
[CI/Behat]   ❌  Failure - Main Wait for browser & PHP to start
[CI/Behat] context deadline exceeded
[CI/Behat]   🐳  docker exec cmd=[node /var/run/act/workflow/hashfiles/index.js] user= workdir=
[CI/Behat] ⭐ Run Post Setup Java
[CI/Behat]   🐳  docker exec cmd=[node /var/run/act/actions/actions-setup-java@v3/dist/cleanup/index.js] user= workdir=
[CI/Behat]   ✅  Success - Post Setup Java
[CI/Behat] 🏁  Job failed
Error: Job 'Behat' failed

@Jean-Beru
Copy link
Collaborator

What machine do you have ? (I have a Macbook M series)

I'm working on Ubuntu.

Here is the stack trace I have, while commenting .github/workflows/ci.yml:126 to only enable the profile symfony2 which is failing.

If you want to run this action through act, you have to run Selenium, the PHP Server and Behat in the same job. It don't really know why.

I tested the "try... catch" fix using act to go fast but can you test it directly in your PR? GitHub action will do the job.

@Jean-Beru
Copy link
Collaborator

@walva It found how to add a commit to your PR. I applied the fix and it works!

Thanks a lot for your help ❤️

@Jean-Beru Jean-Beru merged commit 7f40806 into soyuka:main Jan 12, 2024
8 checks passed
@walva
Copy link
Author

walva commented Jan 14, 2024

@Jean-Beru thanks for your time and patience. I learned a lot and hope to help more in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants