multi: add sqlite option to itests and github job

This commit is contained in:
Chris Geihsler 2022-12-14 11:54:47 +02:00 committed by Elle Mouton
parent 8c4d3345e9
commit a5eaabf548
No known key found for this signature in database
GPG Key ID: D7D916376026F177
12 changed files with 37 additions and 2 deletions

View File

@ -158,6 +158,7 @@ jobs:
- btcd unit-cover - btcd unit-cover
- unit tags="kvdb_etcd" - unit tags="kvdb_etcd"
- unit tags="kvdb_postgres" - unit tags="kvdb_postgres"
- unit tags="kvdb_sqlite"
- btcd unit-race - btcd unit-race
steps: steps:
- name: git checkout - name: git checkout
@ -204,6 +205,8 @@ jobs:
args: backend=bitcoind dbbackend=etcd args: backend=bitcoind dbbackend=etcd
- name: bitcoind-postgres - name: bitcoind-postgres
args: backend=bitcoind dbbackend=postgres args: backend=bitcoind dbbackend=postgres
- name: bitcoind-sqlite
args: backend=bitcoind dbbackend=sqlite
- name: neutrino - name: neutrino
args: backend=neutrino args: backend=neutrino
steps: steps:
@ -287,6 +290,8 @@ jobs:
args: backend=bitcoind dbbackend=etcd args: backend=bitcoind dbbackend=etcd
- name: bitcoind-postgres - name: bitcoind-postgres
args: backend=bitcoind dbbackend=postgres args: backend=bitcoind dbbackend=postgres
- name: bitcoind-sqlite
args: backend=bitcoind dbbackend=sqlite
- name: neutrino - name: neutrino
args: backend=neutrino args: backend=neutrino
steps: steps:

View File

@ -94,7 +94,7 @@ jobs:
Our release binaries are fully reproducible. Third parties are able to verify that the release binaries were produced properly without having to trust the release manager(s). See our [reproducible builds guide](https://github.com/lightningnetwork/lnd/tree/master/build/release) for how this can be achieved. Our release binaries are fully reproducible. Third parties are able to verify that the release binaries were produced properly without having to trust the release manager(s). See our [reproducible builds guide](https://github.com/lightningnetwork/lnd/tree/master/build/release) for how this can be achieved.
The release binaries are compiled with `go${{ env.GO_VERSION }}`, which is required by verifiers to arrive at the same ones. The release binaries are compiled with `go${{ env.GO_VERSION }}`, which is required by verifiers to arrive at the same ones.
They include the following build tags: `autopilotrpc`, `signrpc`, `walletrpc`, `chainrpc`, `invoicesrpc`, `neutrinorpc`, `routerrpc`, `watchtowerrpc`, `monitoring`, `peersrpc`, `kvdb_postrgres`, and `kvdb_etcd`. Note that these are already included in the release script, so they do not need to be provided. They include the following build tags: `autopilotrpc`, `signrpc`, `walletrpc`, `chainrpc`, `invoicesrpc`, `neutrinorpc`, `routerrpc`, `watchtowerrpc`, `monitoring`, `peersrpc`, `kvdb_postrgres`, `kvdb_etcd` and `kvdb_sqlite`. Note that these are already included in the release script, so they do not need to be provided.
The `make release` command can be used to ensure one rebuilds with all the same flags used for the release. If one wishes to build for only a single platform, then `make release sys=<OS-ARCH> tag=<tag>` can be used. The `make release` command can be used to ensure one rebuilds with all the same flags used for the release. If one wishes to build for only a single platform, then `make release sys=<OS-ARCH> tag=<tag>` can be used.

View File

@ -24,6 +24,7 @@ run:
- watchtowerrpc - watchtowerrpc
- kvdb_etcd - kvdb_etcd
- kvdb_postgres - kvdb_postgres
- kvdb_sqlite
linters-settings: linters-settings:
govet: govet:

View File

@ -109,6 +109,9 @@ func prepareDbBackend(t *testing.T,
case "postgres": case "postgres":
dbBackend = lntest.BackendPostgres dbBackend = lntest.BackendPostgres
case "sqlite":
dbBackend = lntest.BackendSqlite
default: default:
require.Fail(t, "unknown db backend") require.Fail(t, "unknown db backend")
} }

View File

@ -220,6 +220,11 @@ func (cfg *BaseNodeConfig) GenArgs() []string {
case lntest.BackendPostgres: case lntest.BackendPostgres:
args = append(args, "--db.backend=postgres") args = append(args, "--db.backend=postgres")
args = append(args, "--db.postgres.dsn="+cfg.PostgresDsn) args = append(args, "--db.postgres.dsn="+cfg.PostgresDsn)
case lntest.BackendSqlite:
args = append(args, "--db.backend=sqlite")
args = append(args, fmt.Sprintf("--db.sqlite.busytimeout=%v",
lntest.SqliteBusyTimeout))
} }
if cfg.FeeURL != "" { if cfg.FeeURL != "" {

View File

@ -278,6 +278,11 @@ func (cfg *BaseNodeConfig) GenArgs() []string {
case BackendPostgres: case BackendPostgres:
args = append(args, "--db.backend=postgres") args = append(args, "--db.backend=postgres")
args = append(args, "--db.postgres.dsn="+cfg.PostgresDsn) args = append(args, "--db.postgres.dsn="+cfg.PostgresDsn)
case BackendSqlite:
args = append(args, "--db.backend=sqlite")
args = append(args, fmt.Sprintf("--db.sqlite.busytimeout=%v",
SqliteBusyTimeout))
} }
if cfg.FeeURL != "" { if cfg.FeeURL != "" {

View File

@ -131,6 +131,9 @@ func TestLightningNetworkDaemon(t *testing.T) {
case "postgres": case "postgres":
dbBackend = lntest.BackendPostgres dbBackend = lntest.BackendPostgres
case "sqlite":
dbBackend = lntest.BackendSqlite
default: default:
require.Fail(t, "unknown db backend") require.Fail(t, "unknown db backend")
} }

View File

@ -49,7 +49,7 @@ var (
// dbBackendFlag specifies the backend to use. // dbBackendFlag specifies the backend to use.
dbBackendFlag = flag.String("dbbackend", "bbolt", "Database backend "+ dbBackendFlag = flag.String("dbbackend", "bbolt", "Database backend "+
"(bbolt, etcd, postgres)") "(bbolt, etcd, postgres, sqlite)")
) )
// TestLightningNetworkDaemonTemp performs a series of integration tests // TestLightningNetworkDaemonTemp performs a series of integration tests

View File

@ -33,6 +33,7 @@ const (
BackendBbolt DatabaseBackend = iota BackendBbolt DatabaseBackend = iota
BackendEtcd BackendEtcd
BackendPostgres BackendPostgres
BackendSqlite
) )
var ( var (

View File

@ -29,4 +29,8 @@ const (
// NodeStartTimeout is the timeout value when waiting for a node to // NodeStartTimeout is the timeout value when waiting for a node to
// become fully started. // become fully started.
NodeStartTimeout = time.Second * 120 NodeStartTimeout = time.Second * 120
// SqliteBusyTimeout is the maximum time that a call to the sqlite db
// will wait for the connection to become available.
SqliteBusyTimeout = time.Second * 10
) )

View File

@ -30,4 +30,8 @@ const (
// NodeStartTimeout is the timeout value when waiting for a node to // NodeStartTimeout is the timeout value when waiting for a node to
// become fully started. // become fully started.
NodeStartTimeout = time.Second * 120 NodeStartTimeout = time.Second * 120
// SqliteBusyTimeout is the maximum time that a call to the sqlite db
// will wait for the connection to become available.
SqliteBusyTimeout = time.Second * 10
) )

View File

@ -29,4 +29,8 @@ const (
// NodeStartTimeout is the timeout value when waiting for a node to // NodeStartTimeout is the timeout value when waiting for a node to
// become fully started. // become fully started.
NodeStartTimeout = time.Second * 120 NodeStartTimeout = time.Second * 120
// SqliteBusyTimeout is the maximum time that a call to the sqlite db
// will wait for the connection to become available.
SqliteBusyTimeout = time.Second * 10
) )