github.com/tilt-dev/tilt@v0.36.0/integration/shortlived_pods_test.go (about)

     1  //go:build integration
     2  // +build integration
     3  
     4  package integration
     5  
     6  import (
     7  	"context"
     8  	"testing"
     9  	"time"
    10  
    11  	"github.com/stretchr/testify/assert"
    12  	v1 "k8s.io/api/core/v1"
    13  )
    14  
    15  func TestShortlivedPods(t *testing.T) {
    16  	f := newK8sFixture(t, "shortlived_pods")
    17  
    18  	f.TiltUp()
    19  
    20  	ctx, cancel := context.WithTimeout(f.ctx, time.Minute)
    21  	defer cancel()
    22  	f.WaitForAllPodsInPhase(ctx, "app=shortlived-pod-fail", v1.PodFailed)
    23  	f.WaitForAllPodsInPhase(ctx, "app=shortlived-pod-success", v1.PodSucceeded)
    24  
    25  	out := f.logs.String()
    26  	assert.Contains(t, out, "this is a successful job")
    27  	assert.Contains(t, out, "this job will fail")
    28  }