lotus/cmd/lotus-miner/allinfo_test.go

47 lines
961 B
Go
Raw Normal View History

2022-08-29 14:25:30 +00:00
// stm: #integration
2020-10-05 12:14:43 +00:00
package main
import (
"flag"
"testing"
"time"
"github.com/stretchr/testify/require"
"github.com/urfave/cli/v2"
"github.com/filecoin-project/lotus/api"
2022-06-14 15:00:51 +00:00
"github.com/filecoin-project/lotus/itests/kit"
2020-10-05 12:14:43 +00:00
"github.com/filecoin-project/lotus/node/repo"
)
func TestMinerAllInfo(t *testing.T) {
if testing.Short() {
t.Skip("skipping test in short mode")
}
_test = true
2021-05-21 13:33:48 +00:00
kit.QuietMiningLogs()
2020-10-05 12:14:43 +00:00
2021-06-21 10:56:10 +00:00
client, miner, ens := kit.EnsembleMinimal(t)
2023-02-20 13:11:49 +00:00
ens.InterconnectAll().BeginMiningMustPost(5 * time.Millisecond)
2020-10-05 12:14:43 +00:00
run := func(t *testing.T) {
app := cli.NewApp()
app.Metadata = map[string]interface{}{
"repoType": repo.StorageMiner,
2021-06-21 10:56:10 +00:00
"testnode-full": client,
"testnode-storage": miner,
2020-10-05 12:14:43 +00:00
}
api.RunningNodeType = api.NodeMiner
2020-10-05 12:14:43 +00:00
cctx := cli.NewContext(app, flag.NewFlagSet("", flag.ContinueOnError), nil)
require.NoError(t, infoAllCmd.Action(cctx))
}
2021-05-21 13:33:48 +00:00
t.Run("pre-info-all", run)
2020-10-05 12:14:43 +00:00
t.Run("post-info-all", run)
}