Enable port forwarding tests for WSL2 #3357
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.
Specifics:
All related cases are skipped based on instance name.
It probably should be machine type, but I would need to collect more knowledge as to how add this test to Perl script.
This one is full of pretty crazy stuff. It took me 20 CI runs in my forked repo in addition to local runs to figure this out. So, some explanation would be helpful.
sed s/x/x
is no-op on Unix trick to remove\r
from output on Windows, becausechomp
fails to do so.The only reasonable provider of
nc
was msys2 package manager. But it was impossible to use from Git shell - application will blow up, because of conflicting msys2 runtimes. The only way to use it is through some proxy of a native Windows process, which would separate the msys2 runtimes - something likecmd /C "bash -c 'nc ...
which is awfully complicated. Alternative is to write a bridge app like this one - https://github.com/arixmkii/go-wsllinks I used it in my CI setup to separate msys2 apps from different roots, but there are no prebuilt versions as of now.So, the solution is to use msys2 shell, where we can add packages and install all the needed dependencies, but this is known to not work for Lima, because of some sort of bug in ssh, which is addressed in Git distro. For this purpose we will provide Git distro as additional dependency path for
limactl
via$env:_LIMA_WINDOWS_EXTRA_PATH = 'C:\Program Files\Git\usr\bin'
from the recently merged #3347