-
Notifications
You must be signed in to change notification settings - Fork 9
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
Feature retry cypher query #97
Feature retry cypher query #97
Conversation
- Also refactored PropertyFile to preserve whitespace - Also re-added "credential" flag to CLI cmd (for now) - Also added DbmsQueryError for failure records
packages/cli/docs/dbms.md
Outdated
@@ -24,6 +24,7 @@ ARGUMENTS | |||
DBMS Name or ID of a Neo4j instance | |||
|
|||
OPTIONS | |||
-c, --credentials=credentials (required) |
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 need to make this testable
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 would prefer we mock STDIN than adding a flag for credentials. Passing credentials as flags/arguments is not a good practice and I think we should avoid it as much as we can.
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 totally agree. Do you have any example on doing this?
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 just looked at the built-in mocking of STDIN that oclif provides. They don't close the stream after sending data, which makes it useless in our case.
An alternative to that would be mocking the passwordPrompt
module using jest.
jest.mock('../../prompts', () => {
return {
passwordPrompt: (): Promise<string> => Promise.resolve(TestDbmss.DBMS_CREDENTIALS),
};
});
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.
great suggestion, updated!
@@ -4,7 +4,7 @@ | |||
"esModuleInterop": true, | |||
"emitDecoratorMetadata": true, | |||
"allowSyntheticDefaultImports": true, | |||
"target": "es5", | |||
"target": "es6", |
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.
@nglgzz this is why instanceof ErrorAbstract
wasnt working
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.
Looks good to me
Added runQuery to dbmss with a stepped retry over 20 sec