Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

chore: delete STM #12752

Merged
merged 2 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 0 additions & 5 deletions api/api_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// stm: #unit
package api

import (
Expand Down Expand Up @@ -30,7 +29,6 @@ func goCmd() string {
}

func TestDoesntDependOnFFI(t *testing.T) {
//stm: @OTHER_IMPLEMENTATION_FFI_DEPENDENCE_001
deps, err := exec.Command(goCmd(), "list", "-deps", "github.com/filecoin-project/lotus/api").Output()
if err != nil {
t.Fatal(err)
Expand All @@ -43,7 +41,6 @@ func TestDoesntDependOnFFI(t *testing.T) {
}

func TestDoesntDependOnBuild(t *testing.T) {
//stm: @OTHER_IMPLEMENTATION_FFI_DEPENDENCE_002
deps, err := exec.Command(goCmd(), "list", "-deps", "github.com/filecoin-project/lotus/api").Output()
if err != nil {
t.Fatal(err)
Expand All @@ -56,7 +53,6 @@ func TestDoesntDependOnBuild(t *testing.T) {
}

func TestReturnTypes(t *testing.T) {
//stm: @OTHER_IMPLEMENTATION_001
errType := reflect.TypeOf(new(error)).Elem()
bareIface := reflect.TypeOf(new(interface{})).Elem()
jmarsh := reflect.TypeOf(new(json.Marshaler)).Elem()
Expand Down Expand Up @@ -122,7 +118,6 @@ func TestReturnTypes(t *testing.T) {
}

func TestPermTags(t *testing.T) {
//stm: @OTHER_IMPLEMENTATION_PERM_TAGS_001
_ = PermissionedFullAPI(&FullNodeStruct{})
_ = PermissionedStorMinerAPI(&StorageMinerStruct{})
_ = PermissionedWorkerAPI(&WorkerStruct{})
Expand Down
3 changes: 0 additions & 3 deletions api/proxy_util_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// stm: #unit
package api

import (
Expand Down Expand Up @@ -30,7 +29,6 @@ type StrC struct {
}

func TestGetInternalStructs(t *testing.T) {
//stm: @OTHER_IMPLEMENTATION_API_STRUCTS_001
var proxy StrA

sts := GetInternalStructs(&proxy)
Expand All @@ -46,7 +44,6 @@ func TestGetInternalStructs(t *testing.T) {
}

func TestNestedInternalStructs(t *testing.T) {
//stm: @OTHER_IMPLEMENTATION_API_STRUCTS_001
var proxy StrC

// check that only the top-level internal struct gets picked up
Expand Down
11 changes: 0 additions & 11 deletions blockstore/badger/blockstore_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// stm: #unit
package badgerbs

import (
Expand All @@ -19,8 +18,6 @@ import (
)

func TestBadgerBlockstore(t *testing.T) {
//stm: @SPLITSTORE_BADGER_PUT_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001
//stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001
(&Suite{
NewBlockstore: newBlockstore(DefaultOptions),
OpenBlockstore: openBlockstore(DefaultOptions),
Expand All @@ -39,8 +36,6 @@ func TestBadgerBlockstore(t *testing.T) {
}

func TestStorageKey(t *testing.T) {
//stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001
//stm: @SPLITSTORE_BADGER_STORAGE_KEY_001
bs, _ := newBlockstore(DefaultOptions)(t)
bbs := bs.(*Blockstore)
defer bbs.Close() //nolint:errcheck
Expand Down Expand Up @@ -254,16 +249,10 @@ func testMove(t *testing.T, optsF func(string) Options) {
}

func TestMoveNoPrefix(t *testing.T) {
//stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001
//stm: @SPLITSTORE_BADGER_PUT_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001
//stm: @SPLITSTORE_BADGER_DELETE_001, @SPLITSTORE_BADGER_COLLECT_GARBAGE_001
testMove(t, DefaultOptions)
}

func TestMoveWithPrefix(t *testing.T) {
//stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001
//stm: @SPLITSTORE_BADGER_PUT_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001
//stm: @SPLITSTORE_BADGER_DELETE_001, @SPLITSTORE_BADGER_COLLECT_GARBAGE_001
testMove(t, func(path string) Options {
opts := DefaultOptions(path)
opts.Prefix = "/prefixed/"
Expand Down
33 changes: 0 additions & 33 deletions blockstore/badger/blockstore_test_suite.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// stm: #unit
package badgerbs

import (
Expand Down Expand Up @@ -46,8 +45,6 @@ func (s *Suite) RunTests(t *testing.T, prefix string) {
}

func (s *Suite) TestGetWhenKeyNotPresent(t *testing.T) {
//stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001
//stm: @SPLITSTORE_BADGER_GET_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001
ctx := context.Background()
bs, _ := s.NewBlockstore(t)
if c, ok := bs.(io.Closer); ok {
Expand All @@ -61,8 +58,6 @@ func (s *Suite) TestGetWhenKeyNotPresent(t *testing.T) {
}

func (s *Suite) TestGetWhenKeyIsNil(t *testing.T) {
//stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001
//stm: @SPLITSTORE_BADGER_GET_001
ctx := context.Background()
bs, _ := s.NewBlockstore(t)
if c, ok := bs.(io.Closer); ok {
Expand All @@ -74,9 +69,6 @@ func (s *Suite) TestGetWhenKeyIsNil(t *testing.T) {
}

func (s *Suite) TestPutThenGetBlock(t *testing.T) {
//stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001
//stm: @SPLITSTORE_BADGER_PUT_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001
//stm: @SPLITSTORE_BADGER_GET_001
ctx := context.Background()
bs, _ := s.NewBlockstore(t)
if c, ok := bs.(io.Closer); ok {
Expand All @@ -94,8 +86,6 @@ func (s *Suite) TestPutThenGetBlock(t *testing.T) {
}

func (s *Suite) TestHas(t *testing.T) {
//stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001
//stm: @SPLITSTORE_BADGER_HAS_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001
ctx := context.Background()
bs, _ := s.NewBlockstore(t)
if c, ok := bs.(io.Closer); ok {
Expand All @@ -117,9 +107,6 @@ func (s *Suite) TestHas(t *testing.T) {
}

func (s *Suite) TestCidv0v1(t *testing.T) {
//stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001
//stm: @SPLITSTORE_BADGER_PUT_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001
//stm: @SPLITSTORE_BADGER_GET_001
ctx := context.Background()
bs, _ := s.NewBlockstore(t)
if c, ok := bs.(io.Closer); ok {
Expand All @@ -137,9 +124,6 @@ func (s *Suite) TestCidv0v1(t *testing.T) {
}

func (s *Suite) TestPutThenGetSizeBlock(t *testing.T) {
//stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001
//stm: @SPLITSTORE_BADGER_PUT_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001
//stm: @SPLITSTORE_BADGER_GET_SIZE_001
ctx := context.Background()

bs, _ := s.NewBlockstore(t)
Expand Down Expand Up @@ -172,8 +156,6 @@ func (s *Suite) TestPutThenGetSizeBlock(t *testing.T) {
}

func (s *Suite) TestAllKeysSimple(t *testing.T) {
//stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001
//stm: @SPLITSTORE_BADGER_PUT_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001
bs, _ := s.NewBlockstore(t)
if c, ok := bs.(io.Closer); ok {
defer func() { require.NoError(t, c.Close()) }()
Expand All @@ -190,9 +172,6 @@ func (s *Suite) TestAllKeysSimple(t *testing.T) {
}

func (s *Suite) TestAllKeysRespectsContext(t *testing.T) {
//stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001
//stm: @SPLITSTORE_BADGER_PUT_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001
//stm: @SPLITSTORE_BADGER_ALL_KEYS_CHAN_001
bs, _ := s.NewBlockstore(t)
if c, ok := bs.(io.Closer); ok {
defer func() { require.NoError(t, c.Close()) }()
Expand Down Expand Up @@ -223,7 +202,6 @@ func (s *Suite) TestAllKeysRespectsContext(t *testing.T) {
}

func (s *Suite) TestDoubleClose(t *testing.T) {
//stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001
bs, _ := s.NewBlockstore(t)
c, ok := bs.(io.Closer)
if !ok {
Expand All @@ -234,9 +212,6 @@ func (s *Suite) TestDoubleClose(t *testing.T) {
}

func (s *Suite) TestReopenPutGet(t *testing.T) {
//stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001
//stm: @SPLITSTORE_BADGER_PUT_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001
//stm: @SPLITSTORE_BADGER_GET_001
ctx := context.Background()
bs, path := s.NewBlockstore(t)
c, ok := bs.(io.Closer)
Expand All @@ -263,10 +238,6 @@ func (s *Suite) TestReopenPutGet(t *testing.T) {
}

func (s *Suite) TestPutMany(t *testing.T) {
//stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001
//stm: @SPLITSTORE_BADGER_HAS_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001
//stm: @SPLITSTORE_BADGER_GET_001, @SPLITSTORE_BADGER_PUT_MANY_001
//stm: @SPLITSTORE_BADGER_ALL_KEYS_CHAN_001
ctx := context.Background()
bs, _ := s.NewBlockstore(t)
if c, ok := bs.(io.Closer); ok {
Expand Down Expand Up @@ -299,10 +270,6 @@ func (s *Suite) TestPutMany(t *testing.T) {
}

func (s *Suite) TestDelete(t *testing.T) {
//stm: @SPLITSTORE_BADGER_PUT_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001
//stm: @SPLITSTORE_BADGER_DELETE_001, @SPLITSTORE_BADGER_POOLED_STORAGE_HAS_001
//stm: @SPLITSTORE_BADGER_ALL_KEYS_CHAN_001, @SPLITSTORE_BADGER_HAS_001
//stm: @SPLITSTORE_BADGER_PUT_MANY_001

ctx := context.Background()
bs, _ := s.NewBlockstore(t)
Expand Down
10 changes: 0 additions & 10 deletions blockstore/splitstore/markset_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// stm: #unit
package splitstore

import (
Expand All @@ -9,8 +8,6 @@ import (
)

func TestMapMarkSet(t *testing.T) {
//stm: @SPLITSTORE_MARKSET_CREATE_001, @SPLITSTORE_MARKSET_HAS_001, @@SPLITSTORE_MARKSET_MARK_001
//stm: @SPLITSTORE_MARKSET_CLOSE_001, @SPLITSTORE_MARKSET_CREATE_VISITOR_001
testMarkSet(t, "map")
testMarkSetRecovery(t, "map")
testMarkSetMarkMany(t, "map")
Expand All @@ -19,8 +16,6 @@ func TestMapMarkSet(t *testing.T) {
}

func TestBadgerMarkSet(t *testing.T) {
//stm: @SPLITSTORE_MARKSET_CREATE_001, @SPLITSTORE_MARKSET_HAS_001, @@SPLITSTORE_MARKSET_MARK_001
//stm: @SPLITSTORE_MARKSET_CLOSE_001, @SPLITSTORE_MARKSET_CREATE_VISITOR_001
bs := badgerMarkSetBatchSize
badgerMarkSetBatchSize = 1
t.Cleanup(func() {
Expand All @@ -42,7 +37,6 @@ func testMarkSet(t *testing.T, lsType string) {
}
defer env.Close() //nolint:errcheck

// stm: @SPLITSTORE_MARKSET_CREATE_001
hotSet, err := env.New("hot", 0)
if err != nil {
t.Fatal(err)
Expand All @@ -62,7 +56,6 @@ func testMarkSet(t *testing.T, lsType string) {
return cid.NewCidV1(cid.Raw, h)
}

// stm: @SPLITSTORE_MARKSET_HAS_001
mustHave := func(s MarkSet, cid cid.Cid) {
t.Helper()
has, err := s.Has(cid)
Expand Down Expand Up @@ -92,7 +85,6 @@ func testMarkSet(t *testing.T, lsType string) {
k3 := makeCid("c")
k4 := makeCid("d")

// stm: @SPLITSTORE_MARKSET_MARK_001
hotSet.Mark(k1) //nolint
hotSet.Mark(k2) //nolint
coldSet.Mark(k3) //nolint
Expand Down Expand Up @@ -143,7 +135,6 @@ func testMarkSet(t *testing.T, lsType string) {
mustNotHave(coldSet, k3)
mustNotHave(coldSet, k4)

//stm: @SPLITSTORE_MARKSET_CLOSE_001
err = hotSet.Close()
if err != nil {
t.Fatal(err)
Expand All @@ -164,7 +155,6 @@ func testMarkSetVisitor(t *testing.T, lsType string) {
}
defer env.Close() //nolint:errcheck

//stm: @SPLITSTORE_MARKSET_CREATE_VISITOR_001
visitor, err := env.New("test", 0)
if err != nil {
t.Fatal(err)
Expand Down
10 changes: 0 additions & 10 deletions blockstore/splitstore/splitstore_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// stm: #unit
package splitstore

import (
Expand Down Expand Up @@ -223,16 +222,10 @@ func testSplitStore(t *testing.T, cfg *Config) {
}

func TestSplitStoreCompaction(t *testing.T) {
//stm: @SPLITSTORE_SPLITSTORE_OPEN_001, @SPLITSTORE_SPLITSTORE_CLOSE_001
//stm: @SPLITSTORE_SPLITSTORE_PUT_001, @SPLITSTORE_SPLITSTORE_ADD_PROTECTOR_001
//stm: @SPLITSTORE_SPLITSTORE_CLOSE_001
testSplitStore(t, &Config{MarkSetType: "map", UniversalColdBlocks: true})
}

func TestSplitStoreCompactionWithBadger(t *testing.T) {
//stm: @SPLITSTORE_SPLITSTORE_OPEN_001, @SPLITSTORE_SPLITSTORE_CLOSE_001
//stm: @SPLITSTORE_SPLITSTORE_PUT_001, @SPLITSTORE_SPLITSTORE_ADD_PROTECTOR_001
//stm: @SPLITSTORE_SPLITSTORE_CLOSE_001
bs := badgerMarkSetBatchSize
badgerMarkSetBatchSize = 1
t.Cleanup(func() {
Expand All @@ -242,9 +235,6 @@ func TestSplitStoreCompactionWithBadger(t *testing.T) {
}

func TestSplitStoreSuppressCompactionNearUpgrade(t *testing.T) {
//stm: @SPLITSTORE_SPLITSTORE_OPEN_001, @SPLITSTORE_SPLITSTORE_CLOSE_001
//stm: @SPLITSTORE_SPLITSTORE_PUT_001, @SPLITSTORE_SPLITSTORE_ADD_PROTECTOR_001
//stm: @SPLITSTORE_SPLITSTORE_CLOSE_001
ctx := context.Background()
chain := &mockChain{t: t}

Expand Down
4 changes: 0 additions & 4 deletions blockstore/timed_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// stm: #unit
package blockstore

import (
Expand All @@ -13,9 +12,6 @@ import (
)

func TestTimedCacheBlockstoreSimple(t *testing.T) {
//stm: @SPLITSTORE_TIMED_BLOCKSTORE_START_001
//stm: @SPLITSTORE_TIMED_BLOCKSTORE_PUT_001, @SPLITSTORE_TIMED_BLOCKSTORE_HAS_001, @SPLITSTORE_TIMED_BLOCKSTORE_GET_001
//stm: @SPLITSTORE_TIMED_BLOCKSTORE_ALL_KEYS_CHAN_001
tc := NewTimedCacheBlockstore(10 * time.Millisecond)
mClock := clock.NewMock()
mClock.Set(time.Now())
Expand Down
5 changes: 0 additions & 5 deletions blockstore/union_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// stm: #unit
package blockstore

import (
Expand All @@ -17,7 +16,6 @@ var (
)

func TestUnionBlockstore_Get(t *testing.T) {
//stm: @SPLITSTORE_UNION_BLOCKSTORE_GET_001
ctx := context.Background()
m1 := NewMemory()
m2 := NewMemory()
Expand All @@ -37,9 +35,6 @@ func TestUnionBlockstore_Get(t *testing.T) {
}

func TestUnionBlockstore_Put_PutMany_Delete_AllKeysChan(t *testing.T) {
//stm: @SPLITSTORE_UNION_BLOCKSTORE_PUT_001, @SPLITSTORE_UNION_BLOCKSTORE_HAS_001
//stm: @SPLITSTORE_UNION_BLOCKSTORE_PUT_MANY_001, @SPLITSTORE_UNION_BLOCKSTORE_DELETE_001
//stm: @SPLITSTORE_UNION_BLOCKSTORE_ALL_KEYS_CHAN_001
ctx := context.Background()
m1 := NewMemory()
m2 := NewMemory()
Expand Down
2 changes: 0 additions & 2 deletions build/openrpc_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// stm: #unit
package build

import (
Expand All @@ -8,7 +7,6 @@ import (
)

func TestOpenRPCDiscoverJSON_Version(t *testing.T) {
//stm: @OTHER_IMPLEMENTATION_OPENRPC_VERSION_001
// openRPCDocVersion is the current OpenRPC version of the API docs.
openRPCDocVersion := "1.2.6"

Expand Down
3 changes: 0 additions & 3 deletions chain/actors/adt/diff_adt_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// stm: #unit
package adt

import (
Expand Down Expand Up @@ -43,7 +42,6 @@ func TestDiffAdtArray(t *testing.T) {

changes := new(TestDiffArray)

//stm: @CHAIN_ADT_ARRAY_DIFF_001
assert.NoError(t, DiffAdtArray(arrA, arrB, changes))
assert.NotNil(t, changes)

Expand Down Expand Up @@ -98,7 +96,6 @@ func TestDiffAdtMap(t *testing.T) {

changes := new(TestDiffMap)

//stm: @CHAIN_ADT_MAP_DIFF_001
assert.NoError(t, DiffAdtMap(mapA, mapB, changes))
assert.NotNil(t, changes)

Expand Down
Loading
Loading