diff --git a/.vscode-samples/launch.json b/.vscode-samples/launch.json new file mode 100644 index 000000000..5c50b4efc --- /dev/null +++ b/.vscode-samples/launch.json @@ -0,0 +1,94 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + + //////////////////////////////// + // golang itest example + //////////////////////////////// + { + "name": "single itest example (test_custom_channels)", + "type": "go", + "request": "launch", + "mode": "test", + "preLaunchTask": "reset before itest", + "program": "${workspaceFolder}/itest", + "env": { + "CGO_ENABLED": "0", + }, + "args": [ + "-test.v", + + // Find itest names to run in `itest/litd_test_list_on_test.go` and + // then replace ` ` (spaces) with `_` (underscores). + // i.e. "test custom channels" --> "test_custom_channels" + // Some related examples of how to choose multiple itests to run at the + // same time as well as how to run itests outside of vscode can be + // found at: + // https://github.com/lightningnetwork/lnd/blob/master/itest/README.md + "-test.run=TestLightningTerminal/test_custom_channels", + + "-logoutput", + "-logdir=${workspaceFolder}/itest/.logs", + "-litdexec=${workspaceFolder}/itest/litd-itest", + ], + "buildFlags": [ + "-ldflags=-X github.com/lightningnetwork/lnd/build.RawTags=chainrpc,walletrpc,signrpc,invoicesrpc,autopilotrpc,watchtowerrpc,twclientrpc -X github.com/lightningnetwork/lnd/build.Commit=lightning-terminal-v0.4.0-alpha -X github.com/lightninglabs/loop.Commit=localbuild -X github.com/lightninglabs/pool.Commit=localbuild -X github.com/lightninglabs/lightning-terminal.Commit=localbuild", + "-tags=dev integration itest lowscrypt litd autopilotrpc signrpc walletrpc chainrpc invoicesrpc watchtowerrpc neutrinorpc peersrpc", + ], + }, + + + //////////////////////////////// + // run all golang itests + //////////////////////////////// + { + "name": "run all itests", + "type": "go", + "request": "launch", + "mode": "test", + "preLaunchTask": "reset before itest", + "program": "${workspaceFolder}/itest", + "env": { + "CGO_ENABLED": "0", + }, + "args": [ + "-test.v", + "-logoutput", + "-logdir=${workspaceFolder}/itest/.logs", + "-litdexec=${workspaceFolder}/itest/litd-itest", + ], + "buildFlags": [ + "-ldflags=-X github.com/lightningnetwork/lnd/build.RawTags=chainrpc,walletrpc,signrpc,invoicesrpc,autopilotrpc,watchtowerrpc,twclientrpc -X github.com/lightningnetwork/lnd/build.Commit=lightning-terminal-v0.4.0-alpha -X github.com/lightninglabs/loop.Commit=localbuild -X github.com/lightninglabs/pool.Commit=localbuild -X github.com/lightninglabs/lightning-terminal.Commit=localbuild", + "-tags=dev integration itest lowscrypt litd autopilotrpc signrpc walletrpc chainrpc invoicesrpc watchtowerrpc neutrinorpc peersrpc", + ], + }, + + + //////////////////////////////// + // react GUI tests + //////////////////////////////// + { + "name": "react Debug Tests", + "type": "node", + "request": "launch", + "runtimeExecutable": "${workspaceRoot}/app/node_modules/.bin/react-scripts", + "args": [ + "test", + "--runInBand", + "--no-cache", + "--watchAll=false" + ], + "cwd": "${workspaceRoot}/app/", + "protocol": "inspector", + "console": "integratedTerminal", + "internalConsoleOptions": "neverOpen", + "env": { + "CI": "true" + }, + "disableOptimisticBPs": true + } + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode-samples/settings.json similarity index 100% rename from .vscode/settings.json rename to .vscode-samples/settings.json diff --git a/.vscode-samples/tasks.json b/.vscode-samples/tasks.json new file mode 100644 index 000000000..3a0d6e6d6 --- /dev/null +++ b/.vscode-samples/tasks.json @@ -0,0 +1,49 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "type": "shell", + "label": "build itest", + "command": "make build-itest", + "presentation": { + "echo": true, + "reveal": "always", + "focus": false, + "panel": "shared", + "clear": false + }, + "problemMatcher": [] + }, + { + "type": "shell", + "label": "clear itest logs", + "options": { + "cwd": "${workspaceFolder}/itest" + }, + "command": "rm -rf ./*.log .logs*", + "presentation": { + "echo": true, + "reveal": "always", + "focus": false, + "panel": "shared", + "clear": false + }, + "problemMatcher": [] + }, + { + "label": "reset before itest", + "dependsOn": [ + "build itest", + "clear itest logs" + ], + "presentation": { + "echo": true, + "reveal": "always", + "focus": false, + "panel": "shared", + "clear": false + }, + "problemMatcher": [] + } + ] +} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index 6e0f47159..000000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Debug Tests", - "type": "node", - "request": "launch", - "runtimeExecutable": "${workspaceRoot}/app/node_modules/.bin/react-scripts", - "args": ["test", "--runInBand", "--no-cache", "--watchAll=false"], - "cwd": "${workspaceRoot}/app/", - "protocol": "inspector", - "console": "integratedTerminal", - "internalConsoleOptions": "neverOpen", - "env": { "CI": "true" }, - "disableOptimisticBPs": true - } - ] -} diff --git a/itest/README.md b/itest/README.md new file mode 100644 index 000000000..8a0ea687b --- /dev/null +++ b/itest/README.md @@ -0,0 +1,7 @@ +## itest ## + +itests are Integration Tests for Lightning Terminal. + +For more information see +- https://github.com/lightningnetwork/lnd/blob/master/itest/README.md for an overview of the itest framework used by all Lightning Labs products. +- `./.vscode-samples/` for example files for configuring vscode to run itests with the debugger.