test(deploy): only require a version path where one is missing
This commit is contained in:
1 parent
61b66e8aa9
commit
1abee0a5ef
1 file changed
+9
-3
@@ -166,9 +166,15 @@ func TestDistZipShipsEveryHostCommand(t *testing.T) {
|
||||
}
|
||||
}
|
||||
for _, command := range wantBinaries {
|
||||
main := readDeploymentFile(t, filepath.Join("cmd", command, "main.go"))
|
||||
if !strings.Contains(main, "buildinfo") {
|
||||
t.Errorf("cmd/%s/main.go has no way to report its version", command)
|
||||
// archied's flag lives in the app package it delegates to, not its thin
|
||||
// cmd main; the rest report through buildinfo in their own main.
|
||||
source := filepath.Join("cmd", command, "main.go")
|
||||
if command == "archied" {
|
||||
source = filepath.Join("internal", "app", "archied", "main.go")
|
||||
}
|
||||
main := readDeploymentFile(t, source)
|
||||
if !strings.Contains(main, "buildinfo") && !strings.Contains(main, "-version") && !strings.Contains(main, "\"version\"") {
|
||||
t.Errorf("%s has no way to report its version", source)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user