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

After upgrading from 3.18.0 to 3.20.8 my custom tooling wtih options stopped working #3656

Open
acha5066 opened this issue Jan 23, 2024 · 0 comments
Labels
bug Something aint working right!

Comments

@acha5066
Copy link

As the title says, I have custom tooling for phpunit that allows me to choose a configuration file to execute phpunit with but since the upgrade to 3.20.8 it is no longer working.

My tooling:

  phpunit:
    service: appserver
    cmd: /app/bin/phpunit.sh
    level: app
    options:
      config:
        passthrough: true
        alias:
          - c
        interactive:
          type: list
          choices:
            - foobar
            - blabla
          message: 'Select site to test'

Example output on 3.18.0:

me@my-computer:~/Sites/drupal$ lando phpunit -c foobar /app/docroot/modules/custom/product_ingestion/tests/src/Unit/DealDateTest.php

  __  __        __     __        ___            _ __     __   __    ______
 / / / /__  ___/ /__ _/ /____   / _ |_  _____ _(_) /__ _/ /  / /__ / / / /
/ /_/ / _ \/ _  / _ `/ __/ -_) / __ | |/ / _ `/ / / _ `/ _ \/ / -_)_/_/_/ 
\____/ .__/\_,_/\_,_/\__/\__/ /_/ |_|___/\_,_/_/_/\_,_/_.__/_/\__(_|_|_)  
    /_/                                                                   

Updating helps us provide the best support and saves us tons of time

Use the link below to get the latest and greatest
https://github.com/lando/lando/releases/tag/v3.20.8

Lando is FREE and OPEN SOURCE software that relies on contributions from developers like you!
If you like Lando then help us spend more time making, updating and supporting it by contributing at the link below
https://github.com/sponsors/lando

If you would like to customize the behavior of this message then check out:
https://docs.lando.dev/config/releases.html
/app
/app/vendor/bin/phpunit -c /app/config/lando/phpunit.lando.foobar.xml /app/docroot/modules/custom/product_ingestion/tests/src/Unit/DealDateTest.php
PHPUnit 9.6.15 by Sebastian Bergmann and contributors.

Warning:       Your XML configuration validates against a deprecated schema.
Suggestion:    Migrate your XML configuration using "--migrate-configuration"!

Testing Drupal\Tests\product_ingestion\Unit\DealDateTest
.                                                                   1 / 1 (100%)

Time: 00:00.045, Memory: 10.00 MB

OK (1 test, 2 assertions)

Example output on 3.20.8

me@my-computer:~/Sites/drupal$ lando phpunit -c foobar /app/docroot/modules/custom/product_ingestion/tests/src/Unit/DealDateTest.php
/opt/drupal
/app/vendor/bin/phpunit -c /app/config/lando/phpunit.lando.foobar.xml /app/docroot/modules/custom/product_ingestion/tests/src/Unit/DealDateTest.php

Warning: scandir(/sites): Failed to open directory: No such file or directory in /app/vendor/weitzman/drupal-test-traits/src/bootstrap.php on line 83

Warning: scandir(): (errno 0): Success in /app/vendor/weitzman/drupal-test-traits/src/bootstrap.php on line 83

Warning: foreach() argument must be of type array|object, bool given in /app/vendor/weitzman/drupal-test-traits/src/bootstrap.php on line 83

Warning: require_once(/core/tests/bootstrap.php): Failed to open stream: No such file or directory in /app/vendor/weitzman/drupal-test-traits/src/bootstrap.php on line 19
PHPUnit 9.6.15 by Sebastian Bergmann and contributors.

Error in bootstrap script: Error:
Failed opening required '/core/tests/bootstrap.php' (include_path='/app/vendor/pear/archive_tar:/app/vendor/pear/console_getopt:/app/vendor/pear/pear-core-minimal/src:/app/vendor/pear/pear_exception:.:/usr/local/lib/php')
#0 /app/vendor/phpunit/phpunit/src/Util/FileLoader.php(66): include_once()
#1 /app/vendor/phpunit/phpunit/src/Util/FileLoader.php(49): PHPUnit\Util\FileLoader::load('/app/vendor/wei...')
#2 /app/vendor/phpunit/phpunit/src/TextUI/Command.php(565): PHPUnit\Util\FileLoader::checkAndLoad('/app/config/lan...')
#3 /app/vendor/phpunit/phpunit/src/TextUI/Command.php(345): PHPUnit\TextUI\Command->handleBootstrap('/app/config/lan...')
#4 /app/vendor/phpunit/phpunit/src/TextUI/Command.php(112): PHPUnit\TextUI\Command->handleArguments(Array)
#5 /app/vendor/phpunit/phpunit/src/TextUI/Command.php(97): PHPUnit\TextUI\Command->run(Array, true)
#6 /app/vendor/phpunit/phpunit/phpunit(107): PHPUnit\TextUI\Command::main()
#7 /app/vendor/bin/phpunit(122): include('/app/vendor/php...')
#8 {main}

I'm echoing the current working directory in my phpunit script and as you can see on 3.18.0 it is outputting /app but on 3.20.8 it is outputting /opt/drupal

After googling around and randomly trying things I discovered that removing the level:app line from the tooling makes it work. It even still works interactively and with relative paths despite the documentation saying: "Note that if you use interactive options, you need to set level: app": https://docs.lando.dev/core/v3/tooling.html. I never actually understood why I needed that line but it seems to work fine without it... maybe the maintainers know more but could just be a simple documentation fix if it's no longer needed?

Details:

  • OS: Ubuntu
  • Using custom image based on official Drupal image
  • Upgraded from 3.18.0 to 3.20.8
@acha5066 acha5066 added the bug Something aint working right! label Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something aint working right!
Projects
None yet
Development

No branches or pull requests

1 participant