github.com/olli-ai/jx/v2@v2.0.400-0.20210921045218-14731b4dd448/pkg/builds/helpers_test.go (about)

     1  // +build unit
     2  
     3  package builds
     4  
     5  import (
     6  	"path"
     7  	"testing"
     8  
     9  	"github.com/olli-ai/jx/v2/pkg/tekton/tekton_helpers_test"
    10  	"github.com/stretchr/testify/assert"
    11  	kubeMocks "k8s.io/client-go/kubernetes/fake"
    12  )
    13  
    14  func TestGetPipelineRunPods(t *testing.T) {
    15  	testCaseDir := path.Join("test_data", "get_pipelinerun_pods")
    16  
    17  	podsList := tekton_helpers_test.AssertLoadPods(t, testCaseDir)
    18  	kubeClient := kubeMocks.NewSimpleClientset(podsList)
    19  
    20  	prPods, err := GetPipelineRunPods(kubeClient, "jx", "abayer-js-test-repo-master-1")
    21  	assert.NoError(t, err)
    22  	assert.Len(t, prPods, 2)
    23  }