github.com/cilium/cilium@v1.16.2/operator/cmd/root_test.go (about)

     1  // SPDX-License-Identifier: Apache-2.0
     2  // Copyright Authors of Cilium
     3  
     4  package cmd
     5  
     6  import (
     7  	"testing"
     8  
     9  	"github.com/cilium/hive/hivetest"
    10  	"github.com/stretchr/testify/assert"
    11  	"go.uber.org/goleak"
    12  
    13  	"github.com/cilium/cilium/pkg/hive"
    14  )
    15  
    16  // TestOperatorHive verifies that the Operator hive can be instantiated with
    17  // default configuration and thus the Operator hive can be inspected with
    18  // the hive commands and documentation can be generated from it.
    19  func TestOperatorHive(t *testing.T) {
    20  	defer goleak.VerifyNone(t,
    21  		// Ignore all the currently running goroutines spawned
    22  		// by prior tests or by package init() functions (like the
    23  		// client-go logger).
    24  		goleak.IgnoreCurrent(),
    25  	)
    26  
    27  	err := hive.New(Operator).Populate(hivetest.Logger(t))
    28  	assert.NoError(t, err, "Populate()")
    29  }