Fix tests

This commit is contained in:
Łukasz Magiera 2020-01-31 02:27:38 +01:00
parent ee9060aa14
commit 95f344540e
5 changed files with 13 additions and 7 deletions

View File

@ -232,7 +232,7 @@ func builder(t *testing.T, nFull int, storage []int) ([]test.TestNode, []test.Te
SectorSize: 1024,
WorkerThreads: 2,
Miner: genMiner,
Dir: psd,
Paths: sectorbuilder.SimplePath(psd),
}, namespace.Wrap(mds, datastore.NewKey("/sectorbuilder")))
if err != nil {
t.Fatal(err)

View File

@ -311,11 +311,11 @@ func (sb *SBMock) StageFakeData() (uint64, []sectorbuilder.PublicPieceInfo, erro
}
func (sb *SBMock) FinalizeSector(context.Context, uint64) error {
panic("implement me")
return nil
}
func (sb *SBMock) DropStaged(context.Context, uint64) error {
panic("implement me")
return nil
}
func (sb *SBMock) SectorPath(typ fs.DataType, sectorID uint64) (fs.SectorPath, error) {

View File

@ -50,6 +50,9 @@ func TestHappyPath(t *testing.T) {
require.Equal(m.t, m.state.State, api.CommitWait)
m.planSingle(SectorProving{})
require.Equal(m.t, m.state.State, api.FinalizeSector)
m.planSingle(SectorFinalized{})
require.Equal(m.t, m.state.State, api.Proving)
}
@ -81,6 +84,9 @@ func TestSeedRevert(t *testing.T) {
require.Equal(m.t, m.state.State, api.CommitWait)
m.planSingle(SectorProving{})
require.Equal(m.t, m.state.State, api.FinalizeSector)
m.planSingle(SectorFinalized{})
require.Equal(m.t, m.state.State, api.Proving)
}