TestRunBuildFromLocalGitHubDir tests that a local directory starting with `github.com` takes precedence over the `github.com` special case.
(t *testing.T)
| 134 | // starting with `github.com` takes precedence over the `github.com` special |
| 135 | // case. |
| 136 | func TestRunBuildFromLocalGitHubDir(t *testing.T) { |
| 137 | t.Setenv("DOCKER_BUILDKIT", "0") |
| 138 | |
| 139 | buildDir := filepath.Join(t.TempDir(), "github.com", "docker", "no-such-repository") |
| 140 | err := os.MkdirAll(buildDir, 0o777) |
| 141 | assert.NilError(t, err) |
| 142 | err = os.WriteFile(filepath.Join(buildDir, "Dockerfile"), []byte("FROM busybox\n"), 0o644) |
| 143 | assert.NilError(t, err) |
| 144 | |
| 145 | fakeCLI := test.NewFakeCli(&fakeClient{}) |
| 146 | cmd := newBuildCommand(fakeCLI) |
| 147 | cmd.SetArgs([]string{buildDir}) |
| 148 | cmd.SetOut(io.Discard) |
| 149 | err = cmd.Execute() |
| 150 | assert.NilError(t, err) |
| 151 | } |
| 152 | |
| 153 | func TestRunBuildWithSymlinkedContext(t *testing.T) { |
| 154 | t.Setenv("DOCKER_BUILDKIT", "0") |
nothing calls this directly
no test coverage detected
searching dependent graphs…