github.com/filecoin-project/bacalhau@v0.3.23-0.20230228154132-45c989550ace/pkg/test/ipfs/utils.go (about)

     1  package ipfs
     2  
     3  import (
     4  	"context"
     5  	"testing"
     6  
     7  	"github.com/filecoin-project/bacalhau/pkg/devstack"
     8  	"github.com/filecoin-project/bacalhau/pkg/system"
     9  	"github.com/stretchr/testify/require"
    10  )
    11  
    12  func SetupTest(ctx context.Context, t *testing.T, nodes int) (*devstack.DevStackIPFS, *system.CleanupManager) {
    13  	cm := system.NewCleanupManager()
    14  	stack, err := devstack.NewDevStackIPFS(ctx, cm, nodes)
    15  	require.NoError(t, err)
    16  	return stack, cm
    17  }
    18  
    19  func TeardownTest(cm *system.CleanupManager) {
    20  	cm.Cleanup(context.Background())
    21  }