Skip to content

Commit

Permalink
build(.github) debug failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lucatume committed Oct 21, 2023
1 parent b8f5567 commit ceff9f3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 18 deletions.
13 changes: 2 additions & 11 deletions .github/workflows/test.yaml → .github/workflows/test-debug.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow

name: Test
name: Test Debug

on: # yamllint disable-line rule:truthy
pull_request:
Expand Down Expand Up @@ -33,16 +33,7 @@ jobs:
matrix:
php_version: [ '8.0', '8.1', '8.2' ]
suite:
- acceptance
- climodule
- functional
- muloader
- unit
- webdriver
- wpcli_module
- wploader_multisite
- wploader_wpdb_interaction
- wploadersuite
name: ${{ matrix.suite }} php@${{ matrix.php_version }}
runs-on: ubuntu-22.04
steps:
Expand Down Expand Up @@ -87,7 +78,7 @@ jobs:

- name: Run tests
id: test
run: vendor/bin/codecept run ${{ matrix.suite }}
run: vendor/bin/codecept run tests/unit/lucatume/WPBrowser/ManagedProcess/PhpBuiltInServerTest.php --debug

- name: Upload Artifacts
uses: actions/upload-artifact@v2
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ clean_procs:
pgrep -f 'php -S' | xargs kill
pgrep chromedriver | xargs kill
rm -f var/_output/*.pid var/_output/*.running
docker compose down
.PHONY: clean_procs

build_35:
Expand Down
10 changes: 3 additions & 7 deletions src/ManagedProcess/PhpBuiltInServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,9 @@ public function getPort(): int

private function confirmServerRunningOnPort(Process $process): bool
{
if ($process->getErrorOutput() === '') {
$process->waitUntil(
static function (string $type, string $output): bool {
return $type === Process::ERR && !empty($output);
}
);
}
do {
$processOutput = $process->getErrorOutput();
} while (stripos($processOutput, 'failed') === false && stripos($processOutput, 'started') === false);

if (stripos($process->getErrorOutput(), 'failed') !== false) {
return false;
Expand Down

0 comments on commit ceff9f3

Please sign in to comment.