-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
Test failure on Alpine Linux with PSTests.Parallel.FileSystemProviderTests.TestMode
#17889
Comments
PSTests.Parallel.FileSystemProviderTests.TestMode
I wonder why you build pwsh for Alpine if MSFT releases official PowerShell package for the OS. |
Alpine Linux, much like other distributions, do not accept inclusion of binary packages in their main repository. Thus, every package need to be built from source. This has lead to much bigger projects like dotnet's source-build, allowing dotnet to be built from source for inclusion in official distro repositories. Indeed, as it is self-hosted, ideally I should use |
I have tried repeatedly to fix this, but all PRs have been rejected by MSFT PowerShell team. :-( Perhaps you can change their minds. If I am not mistaken, the scripts in this repository run on Windows and use cross-compilation to prepare packages for ARM. So you will have to redo them to get your process going. |
Could you point me to relevant PRs so I can study their reasoning? |
@ayakael There is not one PR that solves the whole problem. I tried to start one, two... but it was not accepted. Right now the build is done by Start-PSBuild from Build.psm1
My intention was to move most of these steps into csproj so as not to depend on pwsh and build ps script(s). |
I see. I implemented what appears to be a successful building script here. It is based on an archlinux AUR. In fact, you can already test the package on Alpine Linux by activating the As I don't use |
I built |
The error says that As for build process, you could directly communicate with @SteveL-MSFT. |
Oh, so that's how that error should be interpreted. Indeed, |
Then, to fix the test I just need to point to an actual executable file. It was under my nose this whole time. |
The following patch fixed the test on Alpine: From 04b0c8b1274918015c91f609cd63fdda6099ab95 Mon Sep 17 00:00:00 2001
Patch-Source: https://github.com/PowerShell/PowerShell/issues/17889
From: Antoine Martin <dev@ayakael.net>
Date: Tue, 26 Jul 2022 20:34:30 -0400
Subject: [PATCH 1/1] Neutralize PSTests.Parallel.FileSystemProviderTests.TestMode
PSTests.Parallel.FileSystemProviderTests.TestMode prints error:
[xUnit.net 00:00:06.26] PSTests.Parallel.FileSystemProviderTests.TestMode [FAIL]
Failed PSTests.Parallel.FileSystemProviderTests.TestMode [5 ms]
Error Message:
Assert.Equal() Failure
↓ (pos 0)
Expected: -----
Actual: l----
↑ (pos 0)
Stack Trace:
at PSTests.Parallel.FileSystemProviderTests.TestMode() in /home/user/projects/powershell/testing/powershell/src/PowerShell-7.2.5/test/xUnit/csharp/test_FileSystemProvider.cs:line 123
This patch fixes this failed test by pointing the to-be-tested file to
/bin/busybox rather than /bin/echo, as the latter is a symbolic link
---
test/xUnit/csharp/test_FileSystemProvider.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/xUnit/csharp/test_FileSystemProvider.cs b/test/xUnit/csharp/test_FileSystemProvider.cs
index 85ab0b2ee..160862146 100644
--- a/test/xUnit/csharp/test_FileSystemProvider.cs
+++ b/test/xUnit/csharp/test_FileSystemProvider.cs
@@ -109,7 +109,7 @@ namespace PSTests.Parallel
{
directoryObject = new DirectoryInfo(@"/");
fileObject = new FileInfo(@"/etc/hosts");
- executableObject = new FileInfo(@"/bin/echo");
+ executableObject = new FileInfo(@"/bin/busybox");
}
else
{
--
2.36.2 As it is fixed, closing issue. Thanks for your help! As for moving build to csproj, it would've indeed made things easier. I hope ya'll move this direction! As for me, the package building script reverse engineered from build.psm1 works. I'll try to eventually send some PRs ya'll's way. |
Prerequisites
Steps to reproduce
Currently building a package for
powershell
on Alpine Linux, now thatdotnet6
is implemented. All tests butPSTests.Parallel.FileSystemProviderTests.TestMode
pass.To reproduce,
git clone https://gitlab.alpinelinux.org/ayakael/aports -b testing/powershell-test-fail
andabuild -r
in any Alpine environment equal or greater to version3.16
.Expected behavior
All checks should pass.
Actual behavior
All but one passes.
Error details
Visuals
No response
The text was updated successfully, but these errors were encountered: