You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds a Behat suite for log-command (features/: 52 scenarios, outline rows counted) and a Behat workflow that runs it on every pull request, on pushes to develop and on demand.
It covers ee log show for a site (type filters, line counts, following), --cli and --global, site resolution and validation errors. features/COVERAGE.md maps each command, flag and behaviour to its scenarios.
The workflow runs the suite inside a fresh core checkout: core develop is cloned, every easyengine/* package is set to dev-develop, and this package is installed from the pull request's checkout through a Composer path repository, so the code under test is the PR's, not Packagist's.
It runs on PHP 7.4 and 8.5.
Scenarios written for open bugs are left out for now: they assert the fixed behaviour, so each comes back with its fix. Every scenario in this PR gates, and COVERAGE.md lists the bugs that aren't covered yet.
To run it locally (as root, on a test machine, since the suite creates and deletes *.test sites): replace a core checkout's features/ with this package's (rm -rf features && cp -R <package>/features features, as the workflow does; copying over it would keep core's own cli.feature, whose scenario runs ee cli self-uninstall --yes) and run sudo -E vendor/bin/behat from the core root.
Based on site-command's context. Cleanup only deletes sites with the bh-log-command- prefix, the unanchored I run and STDOUT regexes are anchored, and a marked section adds generic steps: lazy site setup, file fixtures confined to the suite's sites, commands bounded by timeout(1) for tail -f, stream and exit-code assertions, and HTTP checks.
proc_open's cwd resolves the app/ volume symlink, so get_site_name() saw /var/lib/docker/volumes/… and the site-detection scenario could never pass. Pass the logical path as PWD, as an interactive cd does.
Add a @known-bug scenario for the unescaped file list (LOGCMD-1), make "--cli honours --n" assert a single ee.log line instead of a check that also passed with the default, reference the issues.md IDs and state that @known-bug scenarios fail until fixed.
Run PHP 7.4 and 8.5, strip control characters from the junit files before building failures.txt, and cap the Behat step at 75 minutes so a hung run still uploads its logs. Diagnostics: the host addresses and routes, and the docker-compose version after the first run (MIG-20).
EE's first run downloads docker-compose 2.27.0 without --fail (MIG-10); on a GitHub error it moves the HTML error page over the binary, as on an admin-tools-command runner. Fetch 2.27.0 again with --fail and retries in that case.
The 7 scenario rows written for open bugs assert the fixed behaviour and fail today, so they stay out of the suite until their fixes land, and COVERAGE.md lists those bugs as not covered yet. Every scenario that ships now gates, and the non-gating known-bug CI lane goes with them.
The AfterFeature cleanup deleted ee.phar and ee-old.phar from the core checkout after every feature, although no scenario here builds them, so a local run removed a developer's own builds. The 'ee phar is generated' step now records that it built them, and the cleanup only removes them then.
The checkout path was spliced into the command unquoted (and as a replacement string), so a path with spaces or a backslash broke the current-directory scenarios.
… step
Neither step is used yet. The count step compared a string with an int and threw on a match; the subsite step swapped the site and the subsite and still used the pre-compose-v2 container name.
…ine output
compareContents() compared list elements by position, so [1,3,5] wasn't found in [1,2,3,4,5], and a missing key or property raised a notice. The indexed exact-output step and both something-like steps only used the first line of the expected text.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The CSV assertion helper can incorrectly pass when duplicate actual rows compensate for missing expected rows.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
Prevent duplicate actual rows from masking missing expected rows
features/bootstrap/support.php:197
The shared match counter lets duplicate actual rows compensate for missing expected rows. For example, actual CSV name\nfoo\nfoo returns true for expected rows [['name'], ['foo'], ['bar']], although bar is absent. Track a match separately for each expected row and stop after its first match to prevent false-positive assertions.
The reason will be displayed to describe this comment to others. Learn more.
🟢 Approval recommended
No unresolved blocking issues were identified in the scenarios, test harness or CI integration.
No open issues 🎉
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a Behat suite for log-command (
features/: 52 scenarios, outline rows counted) and aBehatworkflow that runs it on every pull request, on pushes todevelopand on demand.It covers
ee log showfor a site (type filters, line counts, following),--cliand--global, site resolution and validation errors.features/COVERAGE.mdmaps each command, flag and behaviour to its scenarios.developis cloned, everyeasyengine/*package is set todev-develop, and this package is installed from the pull request's checkout through a Composer path repository, so the code under test is the PR's, not Packagist's.To run it locally (as root, on a test machine, since the suite creates and deletes
*.testsites): replace a core checkout'sfeatures/with this package's (rm -rf features && cp -R <package>/features features, as the workflow does; copying over it would keep core's owncli.feature, whose scenario runsee cli self-uninstall --yes) and runsudo -E vendor/bin/behatfrom the core root.Green run on my fork: https://github.com/mrrobot47/log-command/actions/runs/39292416544