github.com/pf-qiu/concourse/v6@v6.7.3-0.20201207032516-1f455d73275f/atc/exec/exec_suite_test.go (about)

     1  package exec_test
     2  
     3  import (
     4  	"testing"
     5  
     6  	"code.cloudfoundry.org/lager/lagertest"
     7  	. "github.com/onsi/ginkgo"
     8  	. "github.com/onsi/gomega"
     9  
    10  	"github.com/pf-qiu/concourse/v6/atc"
    11  	"github.com/pf-qiu/concourse/v6/atc/exec"
    12  	"github.com/pf-qiu/concourse/v6/atc/policy"
    13  	"github.com/pf-qiu/concourse/v6/atc/policy/policyfakes"
    14  	"github.com/pf-qiu/concourse/v6/atc/util"
    15  )
    16  
    17  func init() {
    18  	util.PanicSink = GinkgoWriter
    19  }
    20  
    21  func TestExec(t *testing.T) {
    22  	RegisterFailHandler(Fail)
    23  	RunSpecs(t, "Exec Suite")
    24  }
    25  
    26  type testMetadata []string
    27  
    28  func (m testMetadata) Env() []string { return m }
    29  
    30  var (
    31  	testLogger = lagertest.NewTestLogger("test")
    32  
    33  	fakePolicyAgent        *policyfakes.FakeAgent
    34  	fakePolicyAgentFactory *policyfakes.FakeAgentFactory
    35  )
    36  
    37  var _ = BeforeSuite(func() {
    38  	fakePolicyAgentFactory = new(policyfakes.FakeAgentFactory)
    39  	fakePolicyAgentFactory.IsConfiguredReturns(true)
    40  	fakePolicyAgentFactory.DescriptionReturns("fakeAgent")
    41  
    42  	policy.RegisterAgent(fakePolicyAgentFactory)
    43  
    44  	atc.EnablePipelineInstances = true
    45  })
    46  
    47  var noopStepper exec.Stepper = func(atc.Plan) exec.Step {
    48  	Fail("cannot create substep")
    49  	return nil
    50  }