Add test for github.com special handling#390
Conversation
94f3031 to
586d77c
Compare
| os.Chdir(tmpDir) | ||
| os.MkdirAll(filepath.Join(tmpDir, "github.com/docker/no-such-repository"), 0777) | ||
| err = cmd.Execute() | ||
| assert.Contains(t, err.Error(), "unable to prepare context: unable to evaluate symlinks in Dockerfile path:") |
There was a problem hiding this comment.
Since the expectation here is "does build from local directory" maybe this would be more clear by adding a simple Dockerfile to the directory and checking for no error?
This error could easily change and fail the test, but that doesn't necessary mean the test is broken.
There was a problem hiding this comment.
Agreed, I'll look into that
| // TestRunBuildFromLocalGitHubDirNonExistingRepo tests that build contexts | ||
| // starting with `github.com/` are special-cased, and the build command attempts | ||
| // to clone the remote repo, however a local directory should take precedence. | ||
| func TestRunBuildFromLocalGitHubDirNonExistingRepo(t *testing.T) { |
There was a problem hiding this comment.
I think this should be split into two test cases
There was a problem hiding this comment.
Was doubting; in a single test, it more "proves" that without local directory it does X, and with it does Y, but guess it doesn't matter if split; will update
586d77c to
1d5cdf9
Compare
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1d5cdf9 to
f007d62
Compare
Codecov Report
@@ Coverage Diff @@
## master #390 +/- ##
==========================================
+ Coverage 46.26% 46.61% +0.34%
==========================================
Files 193 193
Lines 16093 16093
==========================================
+ Hits 7445 7501 +56
+ Misses 8259 8203 -56
Partials 389 389 |
|
ping @vdemeester PTAL 😅 |
vdemeester
left a comment
There was a problem hiding this comment.
LGTM 🐸
@thaJeztah one thing we should try to handle though is that, as of now, those tests might fail if there is no network (as it might fail with a different error)
|
@vdemeester good call; do we have a |
Found this code still lingering around on my computer 😄
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)

(image taken from https://sustainableutah.files.wordpress.com/2015/03/pika-pixdaus.jpg)