Only run expectrl gix-prompt tests where supported #1644
Merged
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.
Two important
gix-prompt
tests simulate interactivity usingexpectrl
, which (non-optionally) depends onptyprocess
. But the only (families of) Unix-like operating systems thatptyprocess
currently supports are Linux, FreeBSD, and macOS.In
ptyprocess
on other Unix-like systems, the call inMaster::get_slave_name
to the free-standingget_slave_name
function fails to compile, because the latter function is not defined. This is not specific to any particular way of usingptyprocess
; it occurs both when buildinggitoxide
's tests and when buildingptyprocess
's tests.That is from a
cargo nextest run --no-fail-fast
run ingix-prompt
on OmniOS, which is an illumos system. The error message shown above is from that system, as are the full details in this gist, which shows the problem on the main branch and how the build succeeds and othergix-prompt
tests are able to run and pass after the fix here.Please note that the problem isn't illumos-specific. Any Unix-like system that is not Linux, FreeBSD, or macOS should be expected to be affected.
The problem does not prevent
gix-prompt
from building other than for tests, because it is a dev dependency. Specifically,ptyprocess
is a transitive dependency throughexpectrl
, which is a dev dependency ofgix-prompt
.The
gix-prompt
tests that usedexpectrl
were, prior to this PR, targeted to all "unix" systems. This narrows them to systems wheretarget_os
islinux
,freebsd
, ormacos
, and conditions theexpectrl
dev dependency on those targets. This way, running the test suite no longer fails to build on other Unix-like systems.