autopilot: improve test_main that is disabled for CI

The old skipIf annotation doesn't seem to work correctly:

```
PytestUnknownMarkWarning: Unknown pytest.mark.skipIf - is this a typo?
You can register custom marks to avoid this warning -
for details, see https://docs.pytest.org/en/stable/mark.html
    @pytest.mark.skipIf(True, "Test autopilot is hanging on DNS request")
```
This commit is contained in:
Michael Schmoock
2022-02-21 13:27:19 +01:00
parent 8d6248573d
commit e1c063b293

View File

@@ -1,6 +1,8 @@
import os
from pyln.testing.fixtures import * # noqa: F401,F403
import pytest
import unittest
CI = os.environ.get('CI') in ('True', 'true')
plugin_path = os.path.join(os.path.dirname(__file__), "autopilot.py")
plugin_opt = {'plugin': plugin_path}
@@ -17,8 +19,10 @@ def test_starts(node_factory):
l1.daemon.opts["plugin"] = plugin_path
l1.start()
@pytest.mark.skipIf(True, "Test autopilot is hanging on DNS request")
@unittest.skipIf(CI, "Test autopilot is hanging on DNS request")
def test_main(node_factory):
l1, l2 = node_factory.line_graph(2, wait_for_announce=True, opts=plugin_opt)
# just call main function
#assert l1.rpc.autopilot_run_once()
l1.rpc.autopilot_run_once(dryrun=True)
l1.daemon.wait_for_log("I'd like to open [0-9]* new channels with [0-9]* satoshis each")