소스 검색

tstest/integration/vms: verbosify nixos logs to fs, disable unstable (#2294)

This puts nix build logs on the filesystem so that we can debug them
later. This also disables nixos unstable until
https://github.com/NixOS/nixpkgs/issues/128783 is fixed.

Signed-off-by: Christine Dodrill <[email protected]>
Christine Dodrill 4 년 전
부모
커밋
5813da885c
2개의 변경된 파일15개의 추가작업 그리고 2개의 파일을 삭제
  1. 11 1
      tstest/integration/vms/nixos_test.go
  2. 4 1
      tstest/integration/vms/vms_test.go

+ 11 - 1
tstest/integration/vms/nixos_test.go

@@ -8,9 +8,11 @@ package vms
 
 
 import (
 import (
 	"flag"
 	"flag"
+	"fmt"
 	"os"
 	"os"
 	"os/exec"
 	"os/exec"
 	"path/filepath"
 	"path/filepath"
+	"strings"
 	"testing"
 	"testing"
 	"text/template"
 	"text/template"
 
 
@@ -190,7 +192,15 @@ func makeNixOSImage(t *testing.T, d Distro, cdir string, bins *integration.Binar
 		cmd.Stdout = logger.FuncWriter(t.Logf)
 		cmd.Stdout = logger.FuncWriter(t.Logf)
 		cmd.Stderr = logger.FuncWriter(t.Logf)
 		cmd.Stderr = logger.FuncWriter(t.Logf)
 	} else {
 	} else {
-		t.Log("building nixos image...")
+		fname := fmt.Sprintf("nix-build-%s-%s", os.Getenv("GITHUB_RUN_NUMBER"), strings.Replace(t.Name(), "/", "-", -1))
+		t.Logf("writing nix logs to %s", fname)
+		fout, err := os.Create(fname)
+		if err != nil {
+			t.Fatalf("can't make log file for nix build: %v", err)
+		}
+		cmd.Stdout = fout
+		cmd.Stderr = fout
+		defer fout.Close()
 	}
 	}
 	cmd.Env = append(os.Environ(), "NIX_PATH=nixpkgs="+d.url)
 	cmd.Env = append(os.Environ(), "NIX_PATH=nixpkgs="+d.url)
 	cmd.Dir = outpath
 	cmd.Dir = outpath

+ 4 - 1
tstest/integration/vms/vms_test.go

@@ -170,8 +170,11 @@ var distros = []Distro{
 	// shasum is meaningless. This `channel:name` syntax is documented at [1].
 	// shasum is meaningless. This `channel:name` syntax is documented at [1].
 	//
 	//
 	// [1]: https://nixos.org/manual/nix/unstable/command-ref/env-common.html
 	// [1]: https://nixos.org/manual/nix/unstable/command-ref/env-common.html
-	{"nixos-unstable", "channel:nixos-unstable", "lolfakesha", 512, "nix", "systemd"},
 	{"nixos-21-05", "channel:nixos-21.05", "lolfakesha", 512, "nix", "systemd"},
 	{"nixos-21-05", "channel:nixos-21.05", "lolfakesha", 512, "nix", "systemd"},
+
+	// // NOTE(Xe): disabled until https://github.com/NixOS/nixpkgs/issues/128783
+	// // is fixed.
+	// {"nixos-unstable", "channel:nixos-unstable", "lolfakesha", 512, "nix", "systemd"},
 }
 }
 
 
 // fetchFromS3 fetches a distribution image from Amazon S3 or reports whether
 // fetchFromS3 fetches a distribution image from Amazon S3 or reports whether