debug nixos build

Signed-off-by: Christine Dodrill <xe@tailscale.com>
This commit is contained in:
Christine Dodrill 2021-06-30 10:15:16 -04:00
parent 6f3a5802a6
commit a5a95b6759
2 changed files with 14 additions and 4 deletions

View File

@ -1,9 +1,9 @@
name: "integration-vms"
on:
# # NOTE(Xe): uncomment this region when testing the test
# pull_request:
# branches: [ main ]
# NOTE(Xe): uncomment this region when testing the test
pull_request:
branches: [ main ]
push:
branches: [ main ]
release:
@ -21,7 +21,7 @@ jobs:
uses: actions/checkout@v1
- name: Download VM Images
run: go test ./tstest/integration/vms -run-vm-tests -run=Download -timeout=60m
run: go test ./tstest/integration/vms -run-vm-tests -run=Download -timeout=60m -v -verbose-nix-output -distro-regex nixos
env:
XDG_CACHE_HOME: "/var/lib/ghrunner/cache"

View File

@ -8,9 +8,11 @@ package vms
import (
"flag"
"fmt"
"os"
"os/exec"
"path/filepath"
"strings"
"testing"
"text/template"
@ -191,6 +193,14 @@ func makeNixOSImage(t *testing.T, d Distro, cdir string, bins *integration.Binar
cmd.Stderr = logger.FuncWriter(t.Logf)
} else {
t.Log("building nixos image...")
fout, err = os.Create("/var/lib/ghrunner/nix-out-" + strings.Replace(t.Name(), "/", "-", -1))
if err != nil {
fmt.Println(err)
os.Exit(1)
}
defer fout.Close()
cmd.Stdout = fout
cmd.Stderr = fout
}
cmd.Env = append(os.Environ(), "NIX_PATH=nixpkgs="+d.url)
cmd.Dir = outpath