Skip to content

itest improvements (docs references and vscode examples) #990

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 94 additions & 0 deletions .vscode-samples/launch.json
Original file line number Diff line number Diff line change
@@ -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
}
]
}
File renamed without changes.
49 changes: 49 additions & 0 deletions .vscode-samples/tasks.json
Original file line number Diff line number Diff line change
@@ -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": []
}
]
}
21 changes: 0 additions & 21 deletions .vscode/launch.json

This file was deleted.

7 changes: 7 additions & 0 deletions itest/README.md
Original file line number Diff line number Diff line change
@@ -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.
Loading