[bisq-network/bisq] [WIP] Add API test harness for Linux (#4366)

Stan notifications at github.com
Thu Jul 9 19:41:12 UTC 2020


This PR adds a new `:apitest` subproject to Bisq with the following goals:

* Enable test driven development of the API project
* Automate end to end testing of the API 
* Simplify `:desktop` testing in regtest/full-dao mode

It requires the installation of bitcoin-core v0.19.1 binaries and the path to them, either passed on the command line or provided in the subproject's config file.  Here is how to pass your bitcoin-core's path on the command line:


	./bisq-apitest --bitcoinPath=/home/you/bitcoin/v0.19.1/src
	

The `:apitest` build downloads and installs dao-setup files in local `bitcoind`, bob & alice datadirs, and the `ApiTestMain` driver will start `bitcoind`, `seednode`, `arbitration` node (`:desktop` or `:daemon`), plus bob & alice nodes (`:desktop` or `:daemon`) as Linux background processes.  Currently, the only testing mode supported is regtest / full-dao mode, without Tor.

There are options for running arb, bob & alice nodes as `:desktop` or `:daemon` instances, for skipping tests, for running end-to-end tests (by starting Linux scripts), or starting Bisq instances as java commands -- to quicken the dev/test cycle by skipping a full build.

Warning:  When using `:apitest` to spin up multiple desktops, be careful to let them all start before closing the modal intro windows.  The activity on the UI threads freezes your display, and there is a good chance the background processes will not start correctly, resulting in having to manually kill `java` and `bitcoind` processes, and starting over.  _"Don't touch anything"_ until all desktop apps are started.

Warning:  When running from the IDE, add the jvm arg 

    -Dlogback.configurationFile=apitest/build/resources/main/logback.xml

to your launcher to avoid chatty logback messages due to having multiple logback.xml files in your classpath. 

Some additional features and fixes are needed:

- [ ] Stabilize the setup task submission -- spinning up background processes 
- [ ] Exclude `:apitest` from OS packages (.deb, .rpm, etc.)
- [ ] Write test suites
- [ ] Build reporting capabilities
- [ ] Register a mediator and refund agent for an `arbitration` node running as a `:daemon`.

More detail is provided in the PR's commits, logically ordered from the bottom up, beggining with configuration related classes.

You can view, comment on, or merge this pull request online at:

  https://github.com/bisq-network/bisq/pull/4366

-- Commit Summary --

  * Add configuration support
  * Add main resource files
  * Add script to get Bisq app pid
  * Support starting bitcoin & bisq apps on Linux
  * Add :apitest main driver, setup task & dummy tests
  * Add build tasks for installing dao-setup files
  * Add subproject :apitest to gradle build file

-- File Changes --

    A apitest/dao-setup.gradle (84)
    A apitest/scripts/get-bisq-pid.sh (15)
    A apitest/src/main/java/bisq/apitest/ApiTestMain.java (304)
    A apitest/src/main/java/bisq/apitest/SetupTask.java (85)
    A apitest/src/main/java/bisq/apitest/SmokeTestBashCommand.java (51)
    A apitest/src/main/java/bisq/apitest/SmokeTestBitcoind.java (72)
    A apitest/src/main/java/bisq/apitest/config/ApiTestConfig.java (416)
    A apitest/src/main/java/bisq/apitest/config/BisqAppConfig.java (122)
    A apitest/src/main/java/bisq/apitest/config/CompositeOptionSet.java (61)
    A apitest/src/main/java/bisq/apitest/linux/AbstractLinuxProcess.java (91)
    A apitest/src/main/java/bisq/apitest/linux/BashCommand.java (149)
    A apitest/src/main/java/bisq/apitest/linux/BisqApp.java (257)
    A apitest/src/main/java/bisq/apitest/linux/BitcoinCli.java (166)
    A apitest/src/main/java/bisq/apitest/linux/BitcoinDaemon.java (91)
    A apitest/src/main/java/bisq/apitest/linux/LinuxProcess.java (30)
    A apitest/src/main/java/bisq/apitest/linux/SystemCommandExecutor.java (119)
    A apitest/src/main/java/bisq/apitest/linux/ThreadedStreamHandler.java (128)
    A apitest/src/main/resources/apitest.properties (0)
    A apitest/src/main/resources/bitcoin.conf (16)
    A apitest/src/main/resources/blocknotify (20)
    A apitest/src/main/resources/logback.xml (21)
    M build.gradle (65)
    M settings.gradle (1)

-- Patch Links --

https://github.com/bisq-network/bisq/pull/4366.patch
https://github.com/bisq-network/bisq/pull/4366.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/4366
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20200709/4d7dab9e/attachment.html>


More information about the bisq-github mailing list