-
Notifications
You must be signed in to change notification settings - Fork 51
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
Add the external test linguist dir from env var #114
Conversation
Codecov Report
@@ Coverage Diff @@
## master #114 +/- ##
=======================================
Coverage 83.95% 83.95%
=======================================
Files 17 17
Lines 985 985
=======================================
Hits 827 827
Misses 96 96
Partials 62 62 Continue to review full report at Codecov.
|
1c1f4a0
to
4de11ba
Compare
This allows to use a cached directory with linguist instead of cloning and speeds up the tests by -10s on my local machine. Signed-off-by: Vadim Markovtsev <vadim@sourced.tech>
4de11ba
to
250519b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be extended to benchmark_test.go
as well, shouldn't it?
common_test.go
Outdated
s.repoLinguist, err = ioutil.TempDir("", "linguist-") | ||
assert.NoError(s.T(), err) | ||
s.repoLinguist = os.Getenv("ENRY_TEST_REPO") | ||
s.cloned = len(s.repoLinguist) == 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be better to compare strings than lengths: s.repoLinguist == ""
s.tmpLinguist, err = ioutil.TempDir("", "linguist-") | ||
assert.NoError(s.T(), err) | ||
s.tmpLinguist = os.Getenv("ENRY_TEST_REPO") | ||
s.cloned = len(s.tmpLinguist) == 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
fb2618d
to
89480f0
Compare
Signed-off-by: Vadim Markovtsev <vadim@sourced.tech>
@abeaumont Fixed |
cmd := exec.Command("git", "clone", lingustURL, s.tmpLinguist) | ||
err = cmd.Run() | ||
assert.NoError(s.T(), err) | ||
if s.cloned { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This second if
is not needed, it should be inside the previous one
Signed-off-by: Vadim Markovtsev <vadim@sourced.tech>
@abeaumont Fixed |
This allows to use a cached directory with linguist instead of cloning and speeds up the tests by 3x on my local machine.