Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

engine: docker-compose manifest and global logs respect the same filters #919

Merged
Merged
Changes from 1 commit
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
14 changes: 11 additions & 3 deletions internal/build/test_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package build

import (
"archive/tar"
"bytes"
"context"
"fmt"
"log"
"os"
"os/exec"
"path/filepath"
"strings"
Expand Down Expand Up @@ -126,7 +126,7 @@ func (f *dockerBuildFixture) getNameFromTest() reference.Named {

func (f *dockerBuildFixture) startRegistry() {
stdout := bufsync.NewThreadSafeBuffer()
stderr := &bytes.Buffer{}
stderr := bufsync.NewThreadSafeBuffer()
cmd := exec.Command("docker", "run", "--name", "tilt-registry", "-p", "5005:5000", "registry:2")
cmd.Stdout = stdout
cmd.Stderr = stderr
Expand All @@ -137,7 +137,11 @@ func (f *dockerBuildFixture) startRegistry() {
f.t.Fatal(err)
}

err = stdout.WaitUntilContains("listening on", 5*time.Second)
if isCircleCI() {
err = stderr.WaitUntilContains("listening on", 5*time.Second)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

womp womp. but legit.

I think i'd prefer combinedOut.WaitUntilContains and then we wouldn't need this conditional -- any way to do that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check it out now!

} else {
err = stdout.WaitUntilContains("listening on", 5*time.Second)
}
if err != nil {
f.t.Fatalf("Registry didn't start: %v", err)
}
Expand Down Expand Up @@ -234,3 +238,7 @@ func containerConfigRunCmd(imgRef reference.NamedTagged, cmd model.Cmd) *contain
func containerConfig(imgRef reference.NamedTagged) *container.Config {
return &container.Config{Image: imgRef.String()}
}

func isCircleCI() bool {
return os.Getenv("CIRCLECI") != ""
}