-
Notifications
You must be signed in to change notification settings - Fork 220
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
Vault test refactor #5103
Vault test refactor #5103
Conversation
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 PR title omits that src
is being refactored but the commits look good. I assume the PR will be merged with out squashing.
const debugTick = (...args) => { | ||
console.log(key, (debugCount += 1), ...args); | ||
const debugTick = (optLog, ...args) => { | ||
if (optLog.log) { |
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 hope we find time after MN-1 to rationalize logging. I don't think we have a ticket yet for that per se. #1318 is to do research.
@@ -157,6 +157,7 @@ export const makeVaultManager = ( | |||
liquidationInProgress = false; | |||
// XXX should notify interested parties | |||
console.error('liquidateAndRemove failed with', e); | |||
throw e; |
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.
non-blocking: this is out of scope.
@@ -68,13 +68,14 @@ const liquidate = async ( | |||
collateralBrand, | |||
); | |||
|
|||
// XXX problems with upgrade |
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.
gratuitous removal. this is still true.
@Chris-Hibbert I had included the new |
* turn off unneeded tracing * pass `debt` to liquidation as an offerArg * add trace info in liquidation
* add test/support.js for test helpers * consolidate `makeBundle` and `setupZoeForTest` * make `setupZoeForTest` sync and return promises * add bootstrap `space` setup helper Refactor vault tests: * add `test.before` for shared setup * use `t.context` pervasively for shared and default config * change methods to override `t.context` before invoking `setupServices` * use `econ-behaviors` directly * move `addVaultType` into shared setup * eliminate governance terms
* deleted accidental pre-release stuff * added additional type declarations
* introduce `manualPriceAuthority` for tests * use manualPriceAuthority for example test * further DRY test code
18eebf4
to
744e524
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.
These are improvements.
|
||
priceAuthority.setPrice(makeRatio(677n, runBrand, 900n, aethBrand)); | ||
trace(t, 'price dropped a little'); | ||
// await manualTimer.tick(); |
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.
any reason to leave these tick()
s here long term?
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.
nope. I'll clean that up in a future PR.
refs: #4568
Description
Refactor test support into shared module
makeBundle
andsetupZoeForTest
setupZoeForTest
sync and return promisesspace
setup helperRefactor vault tests:
test.before
for shared setupt.context
pervasively for shared and default configt.context
before invokingsetupServices
econ-behaviors
directlyaddVaultType
into shared setupSecurity Considerations
N/A
Documentation Considerations
N/A
Testing Considerations
This simplifies setup for RUN tests, and dramatically reduces duplicate code and setup in vault tests especially. It also reduces some redundant work in tests like creation of a new Zoe for each independent test. Additional shared overhead is now possible via
test.before