-
Notifications
You must be signed in to change notification settings - Fork 49
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
Test Local Driver #145
Test Local Driver #145
Conversation
Codecov Report
@@ Coverage Diff @@
## master #145 +/- ##
==========================================
+ Coverage 42.15% 43.97% +1.82%
==========================================
Files 55 56 +1
Lines 3117 3131 +14
==========================================
+ Hits 1314 1377 +63
+ Misses 1409 1379 -30
+ Partials 394 375 -19
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
fae00a7
to
6ad2eb8
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.
LGTM
though it looks like there are failing tests |
e36f22f
to
b757b37
Compare
Signed-off-by: Will Beason <willbeason@google.com>
Signed-off-by: Will Beason <willbeason@google.com>
Signed-off-by: Will Beason <willbeason@google.com>
Signed-off-by: Will Beason <willbeason@google.com>
Signed-off-by: Will Beason <willbeason@google.com>
Signed-off-by: Will Beason <willbeason@google.com>
Signed-off-by: Will Beason <willbeason@google.com>
Signed-off-by: Will Beason <willbeason@google.com>
Signed-off-by: Will Beason <willbeason@google.com>
Signed-off-by: Will Beason <willbeason@google.com>
Signed-off-by: Will Beason <willbeason@google.com>
b757b37
to
0aec61a
Compare
Signed-off-by: Will Beason <willbeason@google.com>
The local driver has problems when trying to handle large numbers of templates.
Below is a performance test (included in this PR) which measures how long it takes to add N templates to the driver.
Note that performance is approximately n^2. This is due to the fact that:
A few PRs from now, I'm going to make a relatively complex change to try to resolve this issue. Our current tests are good at testing happy paths, but it's very possible I'll trigger changes to unhappy paths, and I want to be able to make those changes safely.
Thus, this PR adds a lot of unit tests for the local driver. There is overlap between
local_test.go
andlocal_unit_test.go
but the two files are approaching the tests from different directions. The former mainly tests happy-path behaviors in sequences of calls, andlocal_unit_test.go
strictly tests single operations, and as many paths as feasible to unit test.To aid in testing and discovery I've moved
local.Args
to its own file, and defined a few new args to aid in writing tests. I've made a few small refactorings (e.g. extracting out theexternalDataImpl
function), but nothing that changes the overall flow of the code. Similarly, I've moved around how we instantiate thelocal.driver
so testing is cleaner.Other than that. I've avoided making logic changes except where it was very clear that the code was having an unintentional effect (such as continuing to process after an error state has been reached).