lntest+github: add flag temptest to run tests separately

This commit adds a new flag `temptest` so we can run new and old tests
separately. This flag will be removed once the migration from old tests
to new tests is finished.
This commit is contained in:
yyforyongyu committed 2022-10-14 07:25:28 +08:00
1 parent 2e410dd248
commit 55f8a621ae
3 files changed
+125

No files matched your search

+11
View File
@@ -45,6 +45,13 @@ var (
// dbBackendFlag specifies the backend to use.
dbBackendFlag = flag.String("dbbackend", "bbolt", "Database backend "+
"(bbolt, etcd, postgres)")
// tempTest is a flag used to mark whether we should run the old or the
// new test cases. Used here so we can transit smoothly during our new
// itest construction.
//
// TODO(yy): remove temp flag.
tempTest = flag.Bool("temptest", false, "run the new tests(temp)")
)
// getTestCaseSplitTranche returns the sub slice of the test cases that should
@@ -83,6 +90,10 @@ func getTestCaseSplitTranche() ([]*testCase, uint, uint) {
// TestLightningNetworkDaemon performs a series of integration tests amongst a
// programmatically driven network of lnd nodes.
func TestLightningNetworkDaemon(t *testing.T) {
if *tempTest {
t.Skip("Running new tests, old tests are skipped")
}
// If no tests are registered, then we can exit early.
if len(allTestCases) == 0 {
t.Skip("integration tests not selected with flag 'rpctest'")