Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Sample Ledger data files (ledger-*.json) for testing & development? #4199

Closed
willy-b opened this issue Sep 22, 2016 · 3 comments · Fixed by #4656
Closed

Sample Ledger data files (ledger-*.json) for testing & development? #4199

willy-b opened this issue Sep 22, 2016 · 3 comments · Fixed by #4656

Comments

@willy-b
Copy link
Contributor

willy-b commented Sep 22, 2016

Did you search for similar issues before submitting this one?
Yes

Describe the issue you encountered:
After updates to ledger-client / userdata formats, it takes a long time to fund a wallet, generate a browsing history, and trigger multiple reconciliations in order to have Ledger userdata to test against.
For multiple reconciliations, even triggering manually one can easily spend an hour on this (each time).

Expected behavior
Perhaps we could maintain a sample set of ledger-*.json files (short browsing history, a few reconciliations/transactions, always in latest format) for testing and development purposes. When updating userdata format or ledger-client this would be updated as well.

(Obviously the wallet associated with the sample data files would be unfunded but we need a standard to test against.)

Lately I've been running into some ledger errors and since it takes significant time to clear state, fund a wallet, visit pages, and get reconciliation to trigger (this is the long step), this would be extremely helpful for testing / UI work.

cc @mrose17
#4286

@willy-b
Copy link
Contributor Author

willy-b commented Sep 22, 2016

Perhaps we could also have an environment variable which can be used to tell Brave to use the mock Ledger data (and not try to update it).

@mrose17
Copy link
Member

mrose17 commented Oct 7, 2016

@willy-b - sorry for the delay in replying. it seems to me that by setting the NODE_ENV environment variable to either 'test' or 'dev', the browser will look in different folders for all the configuration files. on macOS, you'll get brave-test or brave-development in ~/Library/Application Support/ ... is that sufficient? thanks!

@willy-b
Copy link
Contributor Author

willy-b commented Oct 7, 2016

Thanks for the reply, @mrose17.

The separation of user data by NODE_ENV is good, but in this issue I'm looking for your thoughts on a versioned sample data set.

This would be useful for unit, integration, and manual testing to ensure that all features are working without forcing the tester to generate new data (which costs Bitcoin(!) and time). Also when making changes to the transaction data format, you could know right away whether any features were broken.

I did add some mock data for thejs/lib/ledgerExportUtil.js unit tests (https://github.com/brave/browser-laptop/blob/master/test/unit/lib/ledgerExportUtilTest.js).
That mock data is at: https://github.com/brave/browser-laptop/blob/master/test/unit/lib/exampleLedgerData.js .

But it isn't generally useful like a sample set toggled by environment variable would be, like for manual testing of Payment History, which right now requires you to spend Bitcoin to see.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants