<p>This PR adds a new <code>:apitest</code> subproject to Bisq with the following goals:</p>
<ul>
<li>Enable test driven development of the API project</li>
<li>Automate end to end testing of the API</li>
<li>Simplify <code>:desktop</code> testing in regtest/full-dao mode</li>
</ul>
<p>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:</p>
<pre><code>./bisq-apitest --bitcoinPath=/home/you/bitcoin/v0.19.1/src
</code></pre>
<p>The <code>:apitest</code> build downloads and installs dao-setup files in local <code>bitcoind</code>, bob & alice datadirs, and the <code>ApiTestMain</code> driver will start <code>bitcoind</code>, <code>seednode</code>, <code>arbitration</code> node (<code>:desktop</code> or <code>:daemon</code>), plus bob & alice nodes (<code>:desktop</code> or <code>:daemon</code>) as Linux background processes.  Currently, the only testing mode supported is regtest / full-dao mode, without Tor.</p>
<p>There are options for running arb, bob & alice nodes as <code>:desktop</code> or <code>:daemon</code> 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.</p>
<p>Warning:  When using <code>:apitest</code> 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 <code>java</code> and <code>bitcoind</code> processes, and starting over.  <em>"Don't touch anything"</em> until all desktop apps are started.</p>
<p>Warning:  When running from the IDE, add the jvm arg</p>
<pre><code>-Dlogback.configurationFile=apitest/build/resources/main/logback.xml
</code></pre>
<p>to your launcher to avoid chatty logback messages due to having multiple logback.xml files in your classpath.</p>
<p>Some additional features and fixes are needed:</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Stabilize the setup task submission -- spinning up background processes</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Exclude <code>:apitest</code> from OS packages (.deb, .rpm, etc.)</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Write test suites</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Build reporting capabilities</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Register a mediator and refund agent for an <code>arbitration</code> node running as a <code>:daemon</code>.</li>
</ul>
<p>More detail is provided in the PR's commits, logically ordered from the bottom up, beggining with configuration related classes.</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/bisq-network/bisq/pull/4366'>https://github.com/bisq-network/bisq/pull/4366</a></p>

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

<h4>File Changes</h4>
<ul>
  <li>
    <strong>A</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4366/files#diff-acab379a780f70d439d393ae0147bb58">apitest/dao-setup.gradle</a>
    (84)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4366/files#diff-0639367defaaab92075e0a1dee96b047">apitest/scripts/get-bisq-pid.sh</a>
    (15)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4366/files#diff-cfb2beb68469f91ad7e79e88755bbd4d">apitest/src/main/java/bisq/apitest/ApiTestMain.java</a>
    (304)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4366/files#diff-cc68b62637c1baa1103f2611b3ef87c2">apitest/src/main/java/bisq/apitest/SetupTask.java</a>
    (85)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4366/files#diff-522c4e837e591aed3f02ecc9c87cabae">apitest/src/main/java/bisq/apitest/SmokeTestBashCommand.java</a>
    (51)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4366/files#diff-22a2d68e98f0b021fe0c18e245e3ec60">apitest/src/main/java/bisq/apitest/SmokeTestBitcoind.java</a>
    (72)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4366/files#diff-258dfd0a8fbc6ff5fc1c68369d4b76a0">apitest/src/main/java/bisq/apitest/config/ApiTestConfig.java</a>
    (416)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4366/files#diff-3d00c8a308ee19de9fe6bf66ac9a6812">apitest/src/main/java/bisq/apitest/config/BisqAppConfig.java</a>
    (122)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4366/files#diff-c59ea89901a5a9f350e34d9317f993ce">apitest/src/main/java/bisq/apitest/config/CompositeOptionSet.java</a>
    (61)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4366/files#diff-d935dc850e58f071ca6287b9461ca13b">apitest/src/main/java/bisq/apitest/linux/AbstractLinuxProcess.java</a>
    (91)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4366/files#diff-7a454899708096411a9eab4bce181c2c">apitest/src/main/java/bisq/apitest/linux/BashCommand.java</a>
    (149)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4366/files#diff-fc6ba16b892341b73714491f514ff95c">apitest/src/main/java/bisq/apitest/linux/BisqApp.java</a>
    (257)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4366/files#diff-e9d80666d0bd5818b431dba0bf0cdb6e">apitest/src/main/java/bisq/apitest/linux/BitcoinCli.java</a>
    (166)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4366/files#diff-abdf0563a887d041ac53df896bc994aa">apitest/src/main/java/bisq/apitest/linux/BitcoinDaemon.java</a>
    (91)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4366/files#diff-a845b0c391c48892800e3f27543e4c6b">apitest/src/main/java/bisq/apitest/linux/LinuxProcess.java</a>
    (30)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4366/files#diff-dbf176d5fdbcb393744ba5dbd1238d2e">apitest/src/main/java/bisq/apitest/linux/SystemCommandExecutor.java</a>
    (119)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4366/files#diff-c66394cde62307904c4dfacf2f711f3b">apitest/src/main/java/bisq/apitest/linux/ThreadedStreamHandler.java</a>
    (128)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4366/files#diff-4fb2e295cbefde70ce4665126ad39540">apitest/src/main/resources/apitest.properties</a>
    (0)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4366/files#diff-5e5ef93bf00fa897d63addc73f67eca2">apitest/src/main/resources/bitcoin.conf</a>
    (16)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4366/files#diff-542637af529dbcad44a2437e5c0c67ee">apitest/src/main/resources/blocknotify</a>
    (20)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4366/files#diff-95f2b413344d04eddfdd094a00998185">apitest/src/main/resources/logback.xml</a>
    (21)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4366/files#diff-c197962302397baf3a4cc36463dce5ea">build.gradle</a>
    (65)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4366/files#diff-88b7c47e47b8ee65263b6784b86fa0a7">settings.gradle</a>
    (1)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/bisq-network/bisq/pull/4366.patch'>https://github.com/bisq-network/bisq/pull/4366.patch</a></li>
  <li><a href='https://github.com/bisq-network/bisq/pull/4366.diff'>https://github.com/bisq-network/bisq/pull/4366.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/bisq-network/bisq/pull/4366">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJFFTNSMLVV4EBAFUCS3XLLR2YMNRANCNFSM4OV5LEEQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AJFFTNVQHAHEIDLTV2VPMZDR2YMNRA5CNFSM4OV5LEE2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4JX73ZTA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/bisq-network/bisq/pull/4366",
"url": "https://github.com/bisq-network/bisq/pull/4366",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>