Files
xahaud/test
David Schwartz e9381ddeb2 Add "Default Ripple" account flag and associated logic:
AccountSet set/clear, asfDefaultRipple = 8

AccountRoot flag, lsfDefaultRipple = 0x00800000

In trustCreate, set no ripple flag if appropriate.

If an account does not have the default ripple flag set,
new ripple lines created as a result of its offers being
taken or people creating trust lines to it have no ripple
set by that account's side automatically

Trust lines can be deleted if the no ripple flag matches
its default setting based on the account's default ripple
setting.

Fix default no-rippling in integration tests.
2015-03-10 14:05:18 -07:00
..
2014-06-28 18:27:33 -07:00
2014-06-28 18:27:33 -07:00
2014-07-18 10:35:06 -07:00
2015-01-12 18:00:52 -05:00
2014-06-28 18:27:33 -07:00
2014-06-28 18:27:33 -07:00
2014-06-28 18:27:33 -07:00
2014-06-28 18:27:33 -07:00
2014-06-28 18:27:33 -07:00
2014-10-28 10:59:59 -07:00

Integration tests

Basic usage.

Documentation for installation of dependencies and running these tests can be found with the Rippled build instructions. (Also for Windows, OS X, or Ubuntu.)

Advanced usage.

These instructions assume familiarity with the instructions linked above.

Debugging rippled

By default, each test will start and stop an independent instance of rippled. This ensures that each test is run against the known genesis ledger.

To use a running rippled, particularly one running in a debugger, follow these steps:

  1. Make a copy of the example configuration file: cp -i test/config-example.js test/config.js

  2. Edit test/config.js to select the "debug" server configuration.

  • Change the existing default server to: exports.server_default = "debug"; (near the top of the file).
  1. Create a rippled.cfg file for the tests.

  2. Run npm test. The tests will fail. This failure is expected.

  3. Copy and/or rename the tmp/server/debug/rippled.cfg file to somewhere convenient.

  4. Start rippled (in a debugger) with command line options -av --conf <rippled-created-above.cfg>.

  5. Set any desired breakpoints in the rippled source.

  6. Running one test per genesis ledger is highly recommended. If the relevant .js file contains more than one test, change test( to test.only( for the single desired test.

  • To run multiple tests, change test( to test.skip( for any undesired tests in the .js file.
  1. Start test(s) in the node-inspector debugger. (Note that the tests can be run without the debugger, but there will probably be problems with timeouts or reused ledgers).

  2. node_modules/node-inspector/bin/inspector.js &

  3. node node_modules/.bin/mocha --debug --debug-brk test/<testfile.js>

  4. Browse to http://127.0.0.1:8080/debug?port=5858 in a browser supported by node-inspector (i.e. Chrome or Safari).

  5. To run multiple tests, put a breakpoint in the following function:

  • File testutils.js -> function build_teardown() -> nested function teardown() -> nested series function stop_server().
    • When this breakpoint is hit, stop and restart rippled.
  1. Use the node-inspector UI to step through and run the test(s) until control is handed off to rippled. When the request is finished control will be handed back to node-inspector, which may or may not stop depending on which breakpoints are set.

After debugging

  1. To return to the default behavior, edit test/config.js and change the default server back to its original value: exports.server_default = "alpha";.
  • Alternately, delete test/config.js.