-
Notifications
You must be signed in to change notification settings - Fork 5
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
GPII-1897: Isolate buildup and teardown to allow for persistence between runs. #12
Conversation
Even with my best efforts, I cannot seem to get the in-memory
I only get the errors when loading test data, likely these are records with hard-coded We should look at this as part of this PR. It may be that we can mitigate this by removing in-memory storage as an option for express-pouchdb, and only allowing in-memory databases on the browser side. Now that the filesystem-backed grade has been better fleshed out, I'm happy only using that in my own work. |
…-platform PouchDB wrapper grade.
The new |
…ck from the team.
…f `npm outdated`.
dbComponentOptions.dbPaths = expandedDef.data; | ||
} | ||
|
||
var dbComponent = fluid.component(dbComponentOptions); |
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 must never be done - the fact that it still works is just the blindest accident and will be cleaned up in the next framework update. Always use initDependent (if you must have a programmatic API) or preferably the Nexus methods such as fluid.construct
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.
The programmatic API was used to support the previous databases
option rather than forcing everyone to define subcomponents for each database. I will try the Nexus methods here and we can review 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.
Done, I migrated to using fluid.construct
.
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.
Looking at this in light of other comments, dbOptions
can easily become the basis of the options set for the "array of dynamic components" we've been discussing.
… per PR feedback.
This needs to be merged after gpii-express, so that we can move to a published version. |
|
||
| Option | Type | Description | | ||
| -------------------- | ---------- | ----------- | | ||
| `baseDir` (required) | `{Number}` | A full or package-relative path to the base directory in which all database content, configuration files, and logs will be stored. | |
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.
Type of {Number} doesn't seem right here
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.
Fixed.
…lete` means that everything is completely reset.
…endencies). Fixed lint errors.
@cindyli, I have completed the refactor we discussed in our last meeting. We now use the previous "destroy" method to cleanup database instances. Please confirm if this works for you. |
…nup mechanism and clarify the cleanup behavior in pouch-express.
Note that the strategy for sequencing test runs in package.json fails on Windows: |
Thanks, @amb26. Based on our frequent use of && across platforms, I foolishly assumed a semicolon would work as well. I have updated the definition to use && instead. |
To summarize, after much effort the project is in a usable state at the moment. As mentioned above, I have created issues for the remaining work, which now includes tracking down the underlying source of the 409 errors:
@cindyli and @amb26, I hope that a) I have summarized the work remaining correctly and b) we can agree to merge what we have. |
|
||
var PouchDB = require("pouchdb"); | ||
|
||
var path = require("path"); // eslint-disable-line no-unused-vars |
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.
With respect to the discussion below about inclusion of "path", this require is ineffective. All it does is load path into your global object, not into Infusion's.
The safe way of ensuring that "path" is available for global resolution is to write
fluid.require("path", require, "path");
http://docs.fluidproject.org/infusion/development/NodeAPI.html#fluid-require-modulename-foreignrequire-namespace-
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.
Thanks, and fixed. Given that I had to tiptoe around the ESLint "unused variable" warning, it should be easy enough to remember when this is relevant in the future.
See GPII-1897 for details.