From a5a95b67596ff4c8c40bfc487533f05d5a59e743 Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Wed, 30 Jun 2021 10:15:16 -0400 Subject: [PATCH] debug nixos build Signed-off-by: Christine Dodrill --- .github/workflows/xe-experimental-vm-test.yml | 8 ++++---- tstest/integration/vms/nixos_test.go | 10 ++++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/xe-experimental-vm-test.yml b/.github/workflows/xe-experimental-vm-test.yml index 02d07a35d..c3416de23 100644 --- a/.github/workflows/xe-experimental-vm-test.yml +++ b/.github/workflows/xe-experimental-vm-test.yml @@ -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" diff --git a/tstest/integration/vms/nixos_test.go b/tstest/integration/vms/nixos_test.go index ecb9192d3..3216620aa 100644 --- a/tstest/integration/vms/nixos_test.go +++ b/tstest/integration/vms/nixos_test.go @@ -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