Skip to content
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

revamped integration test kit (aka. Operation Sparks Joy) #6329

Merged
merged 102 commits into from
Jun 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
2bcedcf
initial version of the new itest kit.
raulk May 25, 2021
71cd268
fix.
raulk Jun 4, 2021
bcbbd73
Merge branch 'raulk/itests' into raulk/itests-refactor-kit
raulk Jun 10, 2021
019394b
remove debug statements.
raulk Jun 10, 2021
0303a02
rename DealHarness.{TestRetrieval=>PerformRetrieval}.
raulk Jun 10, 2021
0d69c03
deals harness: use require.
raulk Jun 10, 2021
c27fdc2
deals harness: more improvements.
raulk Jun 10, 2021
cf0150e
deals harness: use require.
raulk Jun 10, 2021
3299709
deals tests: begin migration.
raulk Jun 10, 2021
4f2aaa5
deals tests: refactor/simplify TestDealMining; now TestFirstDealEnabl…
raulk Jun 10, 2021
dcd6fc2
deals tests: migrate TestOfflineDealFlow.
raulk Jun 10, 2021
8b037e2
deals tests: migrate deals cycles tests and add coverage.
raulk Jun 10, 2021
e84b8ab
move new kit into kit2, re-enable unmigrated tests against kit1.
raulk Jun 11, 2021
183814a
finish migrating deals test.
raulk Jun 13, 2021
958b6b5
go mod tidy.
raulk Jun 13, 2021
f1ec0d6
fix lint.
raulk Jun 13, 2021
ac67e46
fix test.
raulk Jun 13, 2021
d94a19f
refactor: cli test with kit2
dirkmc Jun 14, 2021
86cca73
refactor: convert multisig tests to kit2
dirkmc Jun 14, 2021
7b00b18
refactor: convert paych to kit2
dirkmc Jun 14, 2021
d2c35db
refactor: convert tape test to kit2
dirkmc Jun 14, 2021
eb5a263
refactor: convert verifreg test to kit2
dirkmc Jun 14, 2021
6fb31a3
start mining way more in the past.
raulk Jun 14, 2021
8a7dba1
add comment.
raulk Jun 14, 2021
dae8be0
migrate to require; use t.Log* instead of fmt.Print*.
raulk Jun 14, 2021
0bb5fff
refactor: clean up code
dirkmc Jun 15, 2021
c27f3de
start mining way more in the past.
raulk Jun 14, 2021
803a3df
refactor: ccupgrade test
dirkmc Jun 14, 2021
4cd0964
refactor: replace if err with require
dirkmc Jun 15, 2021
2d5b798
refactor: cli test with kit2
dirkmc Jun 14, 2021
16cad0e
refactor: convert gateway tests to kit2
dirkmc Jun 15, 2021
c5b7e48
Merge pull request #6467 from filecoin-project/refactor/itests-paych
raulk Jun 15, 2021
5ce482b
refactor: change network upgrade NodeOption to node.Option
dirkmc Jun 15, 2021
2267d15
refactor: update paych cli tests to use kit2
dirkmc Jun 15, 2021
cd53942
refactor: batch deal test to use kit2
dirkmc Jun 15, 2021
cd903be
refactor: sdr upgrade test to use kit2
dirkmc Jun 15, 2021
f0a8a85
Merge pull request #6486 from filecoin-project/refactor/itest-batch-deal
raulk Jun 16, 2021
a0894a8
Merge pull request #6464 from filecoin-project/refactor/itest-cli
raulk Jun 16, 2021
1d768a8
Merge pull request #6484 from filecoin-project/refactor/itest-paych-cli
raulk Jun 16, 2021
06cb3cf
Merge pull request #6488 from filecoin-project/refactor/itest-sdr-upg…
raulk Jun 16, 2021
fea5afd
Merge pull request #6468 from filecoin-project/refactor/itest-tape
raulk Jun 16, 2021
305e324
Merge branch 'master' into raulk/itests-refactor-kit
raulk Jun 16, 2021
4ea73b4
refactor: use genesis preseals from kit2
dirkmc Jun 16, 2021
3014847
Merge pull request #6470 from filecoin-project/refactor/ccupgrade-test
raulk Jun 16, 2021
d2ff0cd
fix verifreg test; add VerifierRootKey() and Account() ensemble opts.
raulk Jun 16, 2021
a3015ca
Merge branch 'raulk/itests-refactor-kit' into refactor/itest-verifreg
raulk Jun 16, 2021
8ed753a
rename RootVerifier option.
raulk Jun 16, 2021
2c30ac3
Merge pull request #6469 from filecoin-project/refactor/itest-verifreg
raulk Jun 16, 2021
f1bf080
Merge branch 'raulk/itests-refactor-kit' into refactor/itest-multisig
raulk Jun 16, 2021
8f608df
refactor: sector pledge test to use kit2
dirkmc Jun 17, 2021
6567887
refactor: sector terminate test to kit2
dirkmc Jun 17, 2021
e9325fe
refactor: wdpost test to kit2
dirkmc Jun 17, 2021
3de6bea
refactor: wdpost dispute test to use kit2
dirkmc Jun 17, 2021
7a9769b
refactor: deadline toggling test to kit2
dirkmc Jun 17, 2021
6562a23
Merge pull request #6506 from filecoin-project/refactor/itest-sector-…
raulk Jun 17, 2021
9436be5
introduce TestFullNode#WaitTillChain(predicate).
raulk Jun 17, 2021
c4e0ac2
Merge pull request #6507 from filecoin-project/refactor/itest-sector-…
raulk Jun 18, 2021
2184805
Merge branch 'raulk/itests-refactor-kit' into refactor/itest-wdpost
raulk Jun 18, 2021
2548c22
switch to TestFullNode#WaitTillChain.
raulk Jun 18, 2021
572277c
Merge pull request #6509 from filecoin-project/refactor/itest-wdpost
raulk Jun 18, 2021
32327c7
Merge branch 'raulk/itests-refactor-kit' into refactor/itest-deadling…
raulk Jun 18, 2021
e85af3c
fix merge error.
raulk Jun 18, 2021
4c2cc8e
Merge branch 'raulk/itests-refactor-kit' into refactor/itest-deadling…
raulk Jun 18, 2021
5548541
fix default proof type to use for non-genesis miners.
raulk Jun 18, 2021
7c329d4
Merge pull request #6511 from filecoin-project/refactor/itest-deadlin…
raulk Jun 18, 2021
3ae42d4
Merge branch 'raulk/itests-refactor-kit' into refactor/itest-multisig
raulk Jun 18, 2021
3d8eb37
cleaner instantiation of lite and gateway nodes + general cleanup.
raulk Jun 18, 2021
9604be6
Merge branch 'raulk/itests-refactor-kit' into refactor/itest-wdpost-d…
raulk Jun 18, 2021
718babd
use miner owner address when posting proofs.
raulk Jun 18, 2021
83de21e
Merge pull request #6483 from filecoin-project/refactor/itest-multisig
raulk Jun 18, 2021
a8bf7e7
Merge pull request #6510 from filecoin-project/refactor/itest-wdpost-…
raulk Jun 18, 2021
a7d8d15
kill old kit 🎉
raulk Jun 18, 2021
8a418bf
rename {kit2=>kit}.
raulk Jun 18, 2021
7ee184e
fix lotus-storage-miner tests.
raulk Jun 21, 2021
d1b291d
fix proof types.
raulk Jun 21, 2021
83ee345
Merge branch 'master' into raulk/itests-refactor-kit
raulk Jun 21, 2021
0879ac4
uncomment lines in TestDealCyclesConcurrent.
raulk Jun 21, 2021
00fa387
remove debug statement.
raulk Jun 21, 2021
70929a9
speed up test.
raulk Jun 21, 2021
132b497
Merge branch 'master' into raulk/itests-refactor-kit
raulk Jun 21, 2021
c22e10c
use mock proofs in TestQuotePriceForUnsealedRetrieval.
raulk Jun 21, 2021
b7a5e3c
Merge branch 'raulk/worker-disable-resource-filtering' into raulk/ite…
raulk Jun 21, 2021
4fcd0b7
disable resource filtering on scheduler.
raulk Jun 21, 2021
e69335b
Merge branch 'master' into raulk/itests-refactor-kit
raulk Jun 21, 2021
e438ef9
fix merge error in window post dispute tests.
raulk Jun 21, 2021
502e104
typo.
raulk Jun 21, 2021
0e2d06f
switch to http API.
raulk Jun 21, 2021
bb032b5
switch back to ws API.
raulk Jun 21, 2021
da78993
fix: bump blocktime of TestQuotePriceForUnsealedRetrieval to 1 second
dirkmc Jun 22, 2021
2a58f83
fix sector_terminate_test.go flakiness.
raulk Jun 22, 2021
71a7270
cleanup gateway RPC.
raulk Jun 22, 2021
098eb6b
try using bg context on constructor.
raulk Jun 22, 2021
9b2efd5
try to deflake window post itests.
raulk Jun 22, 2021
120dd14
avoid double close.
raulk Jun 22, 2021
2e9e1c2
avoid double BlockMiner instantiation.
raulk Jun 22, 2021
f4d0db8
Merge branch 'raulk/circleci-dynamic' into raulk/itests-refactor-kit
raulk Jun 23, 2021
ef8f355
Merge branch 'master' into raulk/itests-refactor-kit
raulk Jun 23, 2021
779626c
fix circleci.
raulk Jun 23, 2021
9b3188d
split deals tests.
raulk Jun 23, 2021
fa4bcc6
Merge branch 'master' into raulk/itests-refactor-kit
raulk Jun 23, 2021
58f348c
add ability to suspend deal-making until CE is stable.
raulk Jun 23, 2021
6a48fbb
increase suspension threshold to 300.
raulk Jun 23, 2021
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
25 changes: 25 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,31 @@ workflows:
suite: itest-deadlines
target: "./itests/deadlines_test.go"

- test:
name: test-itest-deals_concurrent
suite: itest-deals_concurrent
target: "./itests/deals_concurrent_test.go"

- test:
name: test-itest-deals_offline
suite: itest-deals_offline
target: "./itests/deals_offline_test.go"

- test:
name: test-itest-deals_power
suite: itest-deals_power
target: "./itests/deals_power_test.go"

- test:
name: test-itest-deals_pricing
suite: itest-deals_pricing
target: "./itests/deals_pricing_test.go"

- test:
name: test-itest-deals_publish
suite: itest-deals_publish
target: "./itests/deals_publish_test.go"

- test:
name: test-itest-deals
suite: itest-deals
Expand Down
62 changes: 11 additions & 51 deletions cmd/lotus-storage-miner/actor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@ import (
"testing"
"time"

logging "github.com/ipfs/go-log/v2"
"github.com/filecoin-project/go-state-types/network"
"github.com/stretchr/testify/require"
"github.com/urfave/cli/v2"

"github.com/filecoin-project/go-state-types/abi"

"github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/actors/policy"
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/itests/kit"
Expand All @@ -32,36 +31,21 @@ func TestWorkerKeyChange(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()

_ = logging.SetLogLevel("*", "INFO")

policy.SetConsensusMinerMinPower(abi.NewStoragePower(2048))
policy.SetSupportedProofTypes(abi.RegisteredSealProof_StackedDrg2KiBV1)
policy.SetMinVerifiedDealSize(abi.NewStoragePower(256))

kit.QuietMiningLogs()

blocktime := 1 * time.Millisecond

clients, miners := kit.MockMinerBuilder(t,
[]kit.FullNodeOpts{kit.FullNodeWithLatestActorsAt(-1), kit.FullNodeWithLatestActorsAt(-1)},
kit.OneMiner)

client1 := clients[0]
client2 := clients[1]

// Connect the nodes.
addrinfo, err := client1.NetAddrsListen(ctx)
require.NoError(t, err)
err = client2.NetConnect(ctx, addrinfo)
require.NoError(t, err)
client1, client2, miner, ens := kit.EnsembleTwoOne(t, kit.MockProofs(),
kit.ConstructorOpts(kit.InstantaneousNetworkVersion(network.Version13)),
)
ens.InterconnectAll().BeginMining(blocktime)

output := bytes.NewBuffer(nil)
run := func(cmd *cli.Command, args ...string) error {
app := cli.NewApp()
app.Metadata = map[string]interface{}{
"repoType": repo.StorageMiner,
"testnode-full": clients[0],
"testnode-storage": miners[0],
"testnode-full": client1,
"testnode-storage": miner,
}
app.Writer = output
api.RunningNodeType = api.NodeMiner
Expand All @@ -78,9 +62,6 @@ func TestWorkerKeyChange(t *testing.T) {
return cmd.Action(cctx)
}

// start mining
kit.ConnectAndStartMining(t, blocktime, miners[0], client1, client2)

newKey, err := client1.WalletNew(ctx, types.KTBLS)
require.NoError(t, err)

Expand All @@ -105,14 +86,8 @@ func TestWorkerKeyChange(t *testing.T) {
require.Error(t, run(actorConfirmChangeWorker, "--really-do-it", newKey.String()))
output.Reset()

for {
head, err := client1.ChainHead(ctx)
require.NoError(t, err)
if head.Height() >= abi.ChainEpoch(targetEpoch) {
break
}
build.Clock.Sleep(10 * blocktime)
}
client1.WaitTillChain(ctx, kit.HeightAtLeast(abi.ChainEpoch(targetEpoch)))

require.NoError(t, run(actorConfirmChangeWorker, "--really-do-it", newKey.String()))
output.Reset()

Expand All @@ -121,23 +96,8 @@ func TestWorkerKeyChange(t *testing.T) {

// Wait for finality (worker key switch).
targetHeight := head.Height() + policy.ChainFinality
for {
head, err := client1.ChainHead(ctx)
require.NoError(t, err)
if head.Height() >= targetHeight {
break
}
build.Clock.Sleep(10 * blocktime)
}
client1.WaitTillChain(ctx, kit.HeightAtLeast(targetHeight))

// Make sure the other node can catch up.
for i := 0; i < 20; i++ {
head, err := client2.ChainHead(ctx)
require.NoError(t, err)
if head.Height() >= targetHeight {
return
}
build.Clock.Sleep(10 * blocktime)
}
t.Fatal("failed to reach target epoch on the second miner")
client2.WaitTillChain(ctx, kit.HeightAtLeast(targetHeight))
}
30 changes: 7 additions & 23 deletions cmd/lotus-storage-miner/allinfo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,9 @@ import (
"time"

"github.com/filecoin-project/lotus/itests/kit"
"github.com/filecoin-project/lotus/node/impl"
logging "github.com/ipfs/go-log/v2"
"github.com/stretchr/testify/require"
"github.com/urfave/cli/v2"

"github.com/filecoin-project/go-state-types/abi"

"github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/chain/actors/policy"
"github.com/filecoin-project/lotus/node/repo"
Expand All @@ -24,12 +20,6 @@ func TestMinerAllInfo(t *testing.T) {
t.Skip("skipping test in short mode")
}

_ = logging.SetLogLevel("*", "INFO")

policy.SetConsensusMinerMinPower(abi.NewStoragePower(2048))
policy.SetSupportedProofTypes(abi.RegisteredSealProof_StackedDrg2KiBV1)
policy.SetMinVerifiedDealSize(abi.NewStoragePower(256))

_test = true

kit.QuietMiningLogs()
Expand All @@ -40,16 +30,15 @@ func TestMinerAllInfo(t *testing.T) {
policy.SetPreCommitChallengeDelay(oldDelay)
})

n, sn := kit.Builder(t, kit.OneFull, kit.OneMiner)
client, miner := n[0].FullNode, sn[0]
kit.ConnectAndStartMining(t, time.Second, miner, client.(*impl.FullNodeAPI))
client, miner, ens := kit.EnsembleMinimal(t)
ens.InterconnectAll().BeginMining(time.Second)

run := func(t *testing.T) {
app := cli.NewApp()
app.Metadata = map[string]interface{}{
"repoType": repo.StorageMiner,
"testnode-full": n[0],
"testnode-storage": sn[0],
"testnode-full": client,
"testnode-storage": miner,
}
api.RunningNodeType = api.NodeMiner

Expand All @@ -61,14 +50,9 @@ func TestMinerAllInfo(t *testing.T) {
t.Run("pre-info-all", run)

dh := kit.NewDealHarness(t, client, miner)
_, _, _ = dh.MakeFullDeal(kit.MakeFullDealParams{
Ctx: context.Background(),
Rseed: 6,
CarExport: false,
FastRet: false,
StartEpoch: 0,
DoRetrieval: true,
})
deal, res, inPath := dh.MakeOnlineDeal(context.Background(), kit.MakeFullDealParams{Rseed: 6})
outPath := dh.PerformRetrieval(context.Background(), deal, res.Root, false)
kit.AssertFilesEqual(t, inPath, outPath)

t.Run("post-info-all", run)
}
Loading