test: run go test under regular user
By default test vm commands run as root, this causes buildFHSEnv bwrap to cover some parts of /proc, making it impossible to mount proc in a mount namespace created under it. Running as a regular user gets around this issue. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -15,8 +15,15 @@ nixosTest {
|
||||
{
|
||||
environment.systemPackages = [
|
||||
# For go tests:
|
||||
self.packages.${system}.fhs
|
||||
(writeShellScriptBin "fortify-src" "echo -n ${self.packages.${system}.fortify.src}")
|
||||
(writeShellScriptBin "fortify-go-test" ''
|
||||
set -e
|
||||
WORK="$(mktemp -ud)"
|
||||
cp -r "${self.packages.${system}.fortify.src}" "$WORK"
|
||||
chmod -R +w "$WORK"
|
||||
cd "$WORK"
|
||||
${self.packages.${system}.fhs}/bin/fortify-fhs -c \
|
||||
'go generate ./... && go test ./... && touch /tmp/go-test-ok'
|
||||
'')
|
||||
];
|
||||
|
||||
# Run with Go race detector:
|
||||
|
||||
Reference in New Issue
Block a user