Skip to content

Commit

Permalink
Fix warning for buf beta graph (#2246)
Browse files Browse the repository at this point in the history
  • Loading branch information
unmultimedio authored Jun 29, 2023
1 parent c716da4 commit 6bc1e5f
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 0 deletions.
10 changes: 10 additions & 0 deletions private/buf/cmd/buf/imports_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,16 @@ func TestValidImportFromLocalOnlyWorkspaceUnnamedModules(t *testing.T) {
)
}

func TestGraphNoWarningsValidImportFromWorkspaceNamedModules(t *testing.T) {
t.Parallel()
testRunStdoutStderr(
t, nil, 0,
"", // no warnings
"beta", "graph",
filepath.Join("testdata", "imports", "success", "workspace", "valid_explicit_deps"),
)
}

func testRunStderrWithCache(t *testing.T, stdin io.Reader, expectedExitCode int, expectedStderrPartials []string, args ...string) {
appcmdtesting.RunCommandExitCodeStderrContains(
t,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
version: v1
directories:
- mod-a
- mod-b
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
syntax = "proto3";

package a.v1;

import "b/v1/b.proto";

message A {
b.v1.B b = 1;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
version: v1
name: buf.build/foo/mod-a
deps:
- buf.build/foo/mod-b
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
syntax = "proto3";

package b.v1;

message B {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
version: v1
name: buf.build/foo/mod-b
1 change: 1 addition & 0 deletions private/bufpkg/bufgraph/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ func (b *builder) buildForModule(
ctx,
module,
bufimagebuild.WithWorkspace(workspace),
bufimagebuild.WithExpectedDirectDependencies(module.DeclaredDirectDependencies()),
)
if err != nil {
return nil, err
Expand Down

0 comments on commit 6bc1e5f

Please sign in to comment.