mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-10-08 03:47:51 +00:00
add MustRunMainWithCluster test func to have api compatibility with cluster resize
this will allow some pdk code which only works with cluster-resize to work against master (i think)
This commit is contained in:
parent
5b95c04594
commit
82592adf64
1 changed files with 21 additions and 0 deletions
|
|
@ -101,6 +101,27 @@ func MustNewServerCluster(t *testing.T, size int) *Cluster {
|
|||
return cluster
|
||||
}
|
||||
|
||||
// **** below exists to have interface compatibility with cluster-resize,
|
||||
// **** we can remove when cluster resize gets merged *****************//
|
||||
|
||||
type M struct {
|
||||
*server.Command
|
||||
Stdin bytes.Buffer
|
||||
Stdout bytes.Buffer
|
||||
Stderr bytes.Buffer
|
||||
}
|
||||
|
||||
func MustRunMainWithCluster(t *testing.T, size int) []*M {
|
||||
cluster := MustNewServerCluster(t, size)
|
||||
mains := make([]*M, 0)
|
||||
for _, s := range cluster.Servers {
|
||||
mains = append(mains, &M{Command: s})
|
||||
}
|
||||
return mains
|
||||
}
|
||||
|
||||
// ***********************************************************************************//
|
||||
|
||||
func NewServerCluster(size int) (cluster *Cluster, err error) {
|
||||
cluster = &Cluster{
|
||||
Servers: make([]*server.Command, size),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue