github.com/tilt-dev/tilt@v0.36.0/integration/imagetags_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  
    12  func TestImageTags(t *testing.T) {
    13  	f := newK8sFixture(t, "imagetags")
    14  
    15  	f.TiltUp()
    16  
    17  	timePerStage := time.Minute
    18  	ctx, cancel := context.WithTimeout(f.ctx, timePerStage)
    19  	defer cancel()
    20  	f.WaitForAllPodsReady(ctx, "app=imagetags")
    21  	f.WaitForAllPodsReady(ctx, "app=imagetags-stretch")
    22  
    23  	ctx, cancel = context.WithTimeout(f.ctx, timePerStage)
    24  	defer cancel()
    25  	f.CurlUntil(ctx, "http://localhost:31000/message.txt", "Hello from regular")
    26  	f.CurlUntil(ctx, "http://localhost:31001/message.txt", "Hello from stretch")
    27  
    28  	f.ReplaceContents("common/message.txt", "regular", "super unleaded")
    29  
    30  	ctx, cancel = context.WithTimeout(f.ctx, timePerStage)
    31  	defer cancel()
    32  	f.CurlUntil(ctx, "http://localhost:31000/message.txt", "Hello from super unleaded")
    33  	f.CurlUntil(ctx, "http://localhost:31001/message.txt", "Hello from stretch")
    34  
    35  	f.ReplaceContents("common-stretch/message.txt", "stretch", "armstrong")
    36  
    37  	ctx, cancel = context.WithTimeout(f.ctx, timePerStage)
    38  	defer cancel()
    39  	f.CurlUntil(ctx, "http://localhost:31001/message.txt", "Hello from armstrong")
    40  	f.CurlUntil(ctx, "http://localhost:31000/message.txt", "Hello from super unleaded")
    41  }