-
Notifications
You must be signed in to change notification settings - Fork 4
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
Fix test suite #103
Fix test suite #103
Conversation
c1bec82
to
32a5e04
Compare
32a5e04
to
72672f0
Compare
@@ -4,6 +4,9 @@ import { describe, it, beforeEach, afterEach } from 'vitest'; | |||
import { runTestSuite } from '@pluto-encrypted/test-suite'; | |||
import { createLevelDBStorage } from '../src' | |||
|
|||
const SegfaultHandler = require('segfault-handler'); |
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.
rm maybe
import { addRxPlugin } from "rxdb"; | ||
import { RxDBDevModePlugin } from "rxdb/plugins/dev-mode"; | ||
import nodeCrypto from "crypto"; | ||
|
||
// set up segfault handler |
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.
rm maybe
let storage: RxStorage<any, any> | ||
let storageInstance: RxStorageInstance<RxDocType, any, any, any> | undefined | ||
const { it, describe } = suite | ||
// let storage: RxStorage<any, any> |
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.
rm
@@ -372,6 +361,7 @@ export function testCorrectQueries<RxDocType>( | |||
} | |||
|
|||
// Test output of RxStorageInstance.query(); | |||
// TODO: queries arent returning anything |
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.
TODO for leveldb
|
||
await storageInstance.cleanup(Infinity) | ||
// await storageInstance.close() |
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.
TODO: do we need to close each instance?
packages/test-suite/src/index.ts
Outdated
}], | ||
testContext | ||
) | ||
await storageInstance.bulkWrite( |
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.
check the writeResponse
@@ -184,8 +188,16 @@ export class RxStorageIntanceLevelDB<RxDocType> implements RxStorageInstance< | |||
upperBound | |||
); | |||
const indexName = getIndexName(index); | |||
// => '_meta.lwt,key' | |||
// QUESTION: this doesn't seem to map to any of the indexes being entered? |
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.
We're seeing some weirdness where the queryPlan
generates index name which is then used by getIndex
and gets nothing ... looking at what's going in with setIndex
is seems there is some mis-alignment (i.e. no indexes are being set with value _meta.lwt,key
....
Pausing here for today - the next questions are:
- why misalignment
- what should
setIndex
getIndex
be doing? (where's the definition) - ....?
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.
When you have a query, the storage should check if the current query is satisfied by an index and get the index instead of listing all the rows.
Its done for efficiency, the indexes are just faster to query than whole table if that makes sense.
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.
Yeah I know what an index is, have used them a bunch.
What I'm confused about is why the setIndex
and getIndex
look so wrong
Signed-off-by: mix irving <mix@protozoa.nz>
Currently, the test suite is failing to run on leveldb. This PR does the follow:
TODO: