Conversion to full YAML
This commit is contained in:
@@ -7,6 +7,8 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"gitea.westgate.pw/ShadowsOverWestgate/sow-tools/internal/pipeline"
|
||||
)
|
||||
|
||||
func TestRunBuildTopPackageUsesCachedCompiledOutputs(t *testing.T) {
|
||||
@@ -233,6 +235,47 @@ func TestTopdataConsoleDebugProgressAndRelativePaths(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestProjectConsoleSuppressesBuildModuleProgressInNormalMode(t *testing.T) {
|
||||
var stdout bytes.Buffer
|
||||
console := &projectConsole{
|
||||
stdout: &stdout,
|
||||
projectRoot: "/workspace/project",
|
||||
projectName: "Test Module",
|
||||
commandName: "build-module",
|
||||
commandLabel: "Build Module",
|
||||
level: logLevelNormal,
|
||||
}
|
||||
|
||||
console.progress("Writing module archive...")
|
||||
|
||||
if stdout.String() != "" {
|
||||
t.Fatalf("expected no normal-mode progress output, got %q", stdout.String())
|
||||
}
|
||||
}
|
||||
|
||||
func TestProjectConsoleEmitsRelativePaths(t *testing.T) {
|
||||
var stdout bytes.Buffer
|
||||
console := &projectConsole{
|
||||
stdout: &stdout,
|
||||
projectRoot: "/workspace/project",
|
||||
projectName: "Test Module",
|
||||
commandName: "compare",
|
||||
commandLabel: "Compare",
|
||||
level: logLevelNormal,
|
||||
}
|
||||
|
||||
console.emitCompareResult(pipeline.CompareResult{
|
||||
ModulePath: "/workspace/project/build/test.mod",
|
||||
HAKPaths: []string{"/workspace/project/build/core.hak"},
|
||||
Checked: 42,
|
||||
})
|
||||
|
||||
output := stdout.String()
|
||||
if !strings.Contains(output, "module: build/test.mod") {
|
||||
t.Fatalf("expected relative module path, got %q", output)
|
||||
}
|
||||
}
|
||||
|
||||
func TestRunBuildModuleToolkitPreflightRefreshesManifestAndSkipsBrokenCompiler(t *testing.T) {
|
||||
root := t.TempDir()
|
||||
mkdirAll(t, filepath.Join(root, "src", "module"))
|
||||
@@ -309,8 +352,11 @@ scripts:
|
||||
if _, err := os.Stat(filepath.Join(root, ".cache", "ncs", "use_thing.ncs")); !os.IsNotExist(err) {
|
||||
t.Fatalf("expected broken explicit compiler to skip compilation, got err=%v", err)
|
||||
}
|
||||
if !strings.Contains(stdout.String(), "Skipping NWScript compilation for this build.") {
|
||||
t.Fatalf("expected skip-compilation progress in output, got %q", stdout.String())
|
||||
if !strings.Contains(stdout.String(), "script compilation: skipped") {
|
||||
t.Fatalf("expected skip-compilation summary in output, got %q", stdout.String())
|
||||
}
|
||||
if strings.Contains(stdout.String(), "[build-module]") {
|
||||
t.Fatalf("did not expect raw build-module progress in normal output, got %q", stdout.String())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -385,8 +431,11 @@ scripts:
|
||||
if _, err := os.Stat(compiledScript); err != nil {
|
||||
t.Fatalf("expected installed compiler to compile script: %v", err)
|
||||
}
|
||||
if !strings.Contains(stdout.String(), "NWScript compiler not found locally. Installing it now...") {
|
||||
t.Fatalf("expected install progress in output, got %q", stdout.String())
|
||||
if !strings.Contains(stdout.String(), "script compilation: installed") {
|
||||
t.Fatalf("expected install summary in output, got %q", stdout.String())
|
||||
}
|
||||
if strings.Contains(stdout.String(), "[build-module]") {
|
||||
t.Fatalf("did not expect raw build-module progress in normal output, got %q", stdout.String())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user