diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e4a47b9..c3766fa 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,8 +17,5 @@ jobs: with: go-version: "1.25" - - name: build - run: go build -v -o procman . - - name: test run: go test -v ./... diff --git a/.gitignore b/.gitignore index 9cb0c32..13009ac 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ procman +Procfile.dev diff --git a/README.md b/README.md index 8f32b06..342cbaa 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,6 @@ for a PTY interface. ## Developing ```bash -go build ./... # build go test ./... # run tests go vet ./... # static checks goimports -local "$(go list -m)" -w . # format imports diff --git a/procman_test.go b/procman_test.go index 44d541f..0de20dc 100644 --- a/procman_test.go +++ b/procman_test.go @@ -9,6 +9,18 @@ import ( "time" ) +func TestMain(m *testing.M) { + cmd := exec.Command("go", "build", "-o", "procman", ".") + if err := cmd.Run(); err != nil { + fmt.Fprintf(os.Stderr, "failed to build: %v\n", err) + os.Exit(1) + } + code := m.Run() + os.Remove("procman") + os.Remove("Procfile.dev") + os.Exit(code) +} + func TestSetupProcesses(t *testing.T) { tests := []struct { name string @@ -134,7 +146,6 @@ func TestWriteErr(t *testing.T) { } // TestProcmanIntegration tests the full procman workflow. -// Requires `go build -o procman .` to be run first. func TestProcmanIntegration(t *testing.T) { content := "echo: echo 'hello'\nsleep: sleep 10" if err := os.WriteFile("Procfile.dev", []byte(content), 0644); err != nil {