Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ go_deps.from_file(go_mod = "//:go.mod")
use_repo(
go_deps,
"com_github_bazelbuild_buildtools",
"com_github_goaux_decowriter",
"com_github_google_addlicense",
"com_github_google_go_cmp",
"com_github_lvthillo_gomodzip",
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ require (
require (
github.com/bazel-contrib/bazel-gazelle/v2 v2.0.0-3 // indirect
github.com/bmatcuk/doublestar/v4 v4.9.1 // indirect
github.com/goaux/decowriter v1.0.0
github.com/google/addlicense v1.2.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/lvthillo/gomodzip v0.2.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ github.com/bmatcuk/doublestar/v4 v4.0.2/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTS
github.com/bmatcuk/doublestar/v4 v4.9.1 h1:X8jg9rRZmJd4yRy7ZeNDRnM+T3ZfHv15JiBJ/avrEXE=
github.com/bmatcuk/doublestar/v4 v4.9.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc=
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
github.com/goaux/decowriter v1.0.0 h1:f1mfBWGFIo3Upev3gswfGLQzQvC4SBVYi2ZAkNZsIaU=
github.com/goaux/decowriter v1.0.0/go.mod h1:8GKUmiBlNCYxVHU2vlZoQHwLvYh7Iw1c7/tRekJbX7o=
github.com/google/addlicense v1.2.0 h1:W+DP4A639JGkcwBGMDvjSurZHvaq2FN0pP7se9czsKA=
github.com/google/addlicense v1.2.0/go.mod h1:Sm/DHu7Jk+T5miFHHehdIjbi4M5+dJDRS3Cq0rncIxA=
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
Expand Down
1 change: 1 addition & 0 deletions tests/integration/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ go_test(
],
deps = [
"//internal/testutil",
"@com_github_goaux_decowriter//:decowriter",
"@com_github_google_go_cmp//cmp",
"@com_github_google_go_cmp//cmp/cmpopts",
"@rules_go//go/runfiles",
Expand Down
24 changes: 5 additions & 19 deletions tests/integration/ert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@
package integration_test

import (
"bufio"
"context"
"encoding/xml"
"flag"
"fmt"
"io"
"os"
"os/exec"
"path/filepath"
Expand All @@ -33,6 +31,7 @@ import (
_ "embed"

"github.com/bazelbuild/rules_go/go/runfiles"
"github.com/goaux/decowriter"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"

Expand Down Expand Up @@ -534,23 +533,10 @@ func run(t *testing.T, p string, c *exec.Cmd) error {
if c.Stderr != nil {
t.Fatalf("%s: exec.Cmd.Stderr already set", p)
}
r, err := c.StdoutPipe()
if err != nil {
t.Fatalf("%s: %s", p, err)
}
c.Stderr = c.Stdout
if err := c.Start(); err != nil {
t.Fatalf("%s: %s", p, err)
}
s := bufio.NewScanner(r)
for s.Scan() {
t.Logf("[%s] %s", p, s.Bytes())
}
if err := s.Err(); err != nil {
t.Errorf("[%s] error: %s", p, err)
}
io.Copy(io.Discard, r)
return c.Wait()
w := decowriter.New(t.Output(), []byte(fmt.Sprintf("[%s] ", p)), nil)
c.Stdout = w
c.Stderr = w
return c.Run()
}

type timestamp time.Time
Expand Down