-
-
Notifications
You must be signed in to change notification settings - Fork 52
Conversation
test/leveldown-test.js
Outdated
) | ||
t.end() | ||
}) | ||
|
||
test('test database open no-arg throws', function (t) { |
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.
What to do with this file now? It only contains one test which doesn't do anything. I think we have two options here.
- We remove it completely
- We rewrite it to test other things that might be related to inheritance, such as checking for the complete api and not only
.open
- Keep it as it is
If we go with 2 or 3, the current test should be renamed because it doesn't have anything to do with throw
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.
I'd personally would go for 1.
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.
+1 to removing
Restarting browser tests a second time. |
What about the abstract tests? abstract-leveldown/test/batch-test.js Line 8 in 74d7340
etc |
|
|
Found this test which assumes location based implementations abstract-leveldown/test/open-test.js Lines 84 to 109 in 74d7340
Will comment out this for now. |
test/open-test.js
Outdated
}) | ||
}) | ||
}) | ||
// TODO this assumes location based backends, move out to respective |
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 is the only test that assumes the (previous) leveldown
parameter to accept a location
argument (so it can try and open on the same location). We should either remove this and move to location based implementations, or move it to a location based file (e.g. test/leveldown-test.js
).
However, it uses errorIfExists
property which afaik is related to leveldown
, so maybe we should just move it to LevelDB
based implementations.
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.
Hm, why does this test need two db
instances? If you open a db, close it, then reopen with errorIfExists
, it should error too, right?
(Removing createIfMissing
and errorIfExists
from abstract-leveldown
is probably a discussion for later)
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.
I'm in a rush right now. Will get back to this in a bit.
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.
@vweevers Reverted the commit and brought back the test using a single db instance.
@vweevers I could use some feedback on the |
Left to do:
|
README.md
Outdated
function FakeLevelDOWN (location) { | ||
AbstractLevelDOWN.call(this, location) | ||
this.location = location |
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.
Might as well remove this too
test/common.js
Outdated
var tempy = require('tempy') | ||
|
||
module.exports = { | ||
// TODO remove? |
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.
Removing SGTM. Implementations only have to call tempy.directory
in their factory.
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.
Yep! Also means we can merge common.js
and common-browser.js
into one file.
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.
Yay!
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.
Oh but we should document somewhere that each factory
call should return a fresh db
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.
Or add a test for this behavior :)
Would it make sense for |
It might make sense actually. The api would be a lot cleaner since Maybe merge those in another PR? |
👍 |
I love where this is going! |
Haha same here. Things just seemed to fall in place a lot when location was no longer something to consider. |
test/open-test.js
Outdated
@@ -80,35 +80,6 @@ module.exports.openAdvanced = function (factory, test) { | |||
|
|||
async = true | |||
}) | |||
|
|||
// TODO this assumes location based backends, move out to respective |
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.
I'm not sure about this, see #258 (comment)
I added the tag |
This test should be implemented in location based implementations, e.g. leveldown, leveldown-hyper, rocksdb etc.
This reverts commit fceb64e.
49b7b2d
to
3dc4cd7
Compare
Rebased onto latest master (without node 9 so faster builds yay!) |
@@ -1,9 +1,4 @@ | |||
var collectEntries = require('level-concat-iterator') | |||
var tempy = require('tempy') | |||
|
|||
module.exports = { |
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.
Maybe we could export a function here instead? E.g.
module.exports = function (opts) {
return xtend({
setUp: function (t) { t.end() },
tearDown: function (t) { t.end() }
}, opts)
}
@vweevers Sorry to be a pain. Good to squash? |
Can you give me until tonight (~6 hours from now)? |
For sure! |
test/open-test.js
Outdated
@@ -82,20 +82,17 @@ module.exports.openAdvanced = function (leveldown, test, testCommon) { | |||
}) | |||
|
|||
test('test database open errorIfExists:true', function (t) { | |||
var location = testCommon.location() | |||
var db = leveldown(location) | |||
var db = factory() | |||
|
|||
// make a valid database first, then close and dispose |
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.
Leftover comment: " and dispose"
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.
Removing the comments altogether.
@ralphtheninja Can you open issues for:
|
Closes #63
Also see discussion from #256