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

DX-5177: drush runserver problem #4609

Closed
dpagini opened this issue Oct 11, 2022 · 5 comments · Fixed by #4631
Closed

DX-5177: drush runserver problem #4609

dpagini opened this issue Oct 11, 2022 · 5 comments · Fixed by #4631
Labels
Awaiting response Maintainer needs more info Bug Something isn't working

Comments

@dpagini
Copy link
Contributor

dpagini commented Oct 11, 2022

Describe the bug
I just updated from 13.4.0 to 13.5.2 and I'm having trouble with my tests command in CI, where I'm using drush runserver functionality to test my site. In my BLT update, I'm also upgrading drush from 11.0.5 to 11.2.1.
I can't find where I think the problem is in the diff of either of those, but I do think I see the problem.

BLT is basically calling:
$ drush runserver --uri=http://127.0.0.1:8888

but, according to the docs, there is no --uri option. The URI is supposed to be passed in as the primary argument, not a flag... so:
$ drush runserver http://127.0.0.1:8888

To Reproduce
Given the above software versions, if I run (note the port numbers)...

$ vendor/bin/drush @self runserver --uri=http://127.0.0.1:59477
 [notice] HTTP server listening on 127.0.0.1, port 8888 (see http://127.0.0.1:8888/), serving site, sites/default
[Tue Oct 11 09:49:10 2022] PHP 7.4.32 Development Server (http://127.0.0.1:8888) started

$ vendor/bin/drush @self runserver http://127.0.0.1:59477
 [notice] HTTP server listening on 127.0.0.1, port 59477 (see http://127.0.0.1:59477/), serving site, sites/default
[Tue Oct 11 09:49:22 2022] PHP 7.4.32 Development Server (http://127.0.0.1:59477) started

Expected behavior
When I run $ blt tss -Dtests.server.url=http://127.0.0.1:59478 -v I want it to work.

Actual behavior
It times out.

Workaround
None.

System information

  • Operating system type: Ubuntu
  • Operating system version: 18
  • BLT version: 13.5.2
@dpagini dpagini added the Bug Something isn't working label Oct 11, 2022
@github-actions github-actions bot changed the title drush runserver problem DX-5177: drush runserver problem Oct 11, 2022
@mikemadison13
Copy link
Contributor

@dpagini do you have a ci.blt.yml file in your blt directory? this runserver stuff has been problematic on other projects and i think in many cases it's because of that config. see https://github.com/Drupal4Gov/Drupal-GovCon-2017/blob/develop/blt/ci.blt.yml as a working example. i haven't had issues with runserver "not" working on the govcon repo

@mikemadison13 mikemadison13 added the Awaiting response Maintainer needs more info label Oct 11, 2022
@ayalon
Copy link

ayalon commented Nov 16, 2022

This is obviously a bug in BLT. The ci.blt.yml File has nothing to do with it.

This is how run server is called. But it is wrong, it does not work with the latest drush version.

src/Robo/Commands/Tests/ServerCommand.php

    /** @var \Acquia\Blt\Robo\Common\Executor $executor */
    $executor = $this->getContainer()->get('executor');
    $result = $executor
      ->drush("runserver --quiet --uri=$this->serverUrl > $log_file 2>&1")
      ->background(TRUE)
      ->printOutput(TRUE)
      ->run();

It should be:

    /** @var \Acquia\Blt\Robo\Common\Executor $executor */
    $executor = $this->getContainer()->get('executor');
    $result = $executor
      ->drush("runserver --quiet $this->serverUrl > $log_file 2>&1")
      ->background(TRUE)
      ->printOutput(TRUE)
      ->run();

mikemadison13 added a commit to mikemadison13/blt that referenced this issue Nov 16, 2022
@mikemadison13
Copy link
Contributor

i opened a PR to test this, could you give it a shot, please?

@ayalon
Copy link

ayalon commented Nov 16, 2022

Tested and works on BLT 13.6.0 and Drush 11

@dpagini
Copy link
Contributor Author

dpagini commented Nov 22, 2022

Thanks all! Sorry I hadn't seen the replies back to me until now... =/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting response Maintainer needs more info Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants