github.com/in4it/ecs-deploy@v0.0.42-0.20240508120354-ed77ff16df25/provider/ecs/ecr_test.go (about)

     1  package ecs
     2  
     3  import (
     4  	"fmt"
     5  	"testing"
     6  
     7  	"github.com/in4it/ecs-deploy/util"
     8  )
     9  
    10  func TestListImages(t *testing.T) {
    11  	if accountId == nil {
    12  		t.Skip(noAWSMsg)
    13  	}
    14  	ecr := ECR{}
    15  	imageName := util.GetEnv("TEST_IMAGENAME", "ecs-deploy")
    16  	_, err := ecr.ListImagesWithTag(imageName)
    17  	if err != nil {
    18  		t.Errorf("Error: %v", err)
    19  		return
    20  	}
    21  }
    22  func TestRepositoryExists(t *testing.T) {
    23  	if accountId == nil {
    24  		t.Skip(noAWSMsg)
    25  	}
    26  	ecr := ECR{}
    27  	imageName := util.GetEnv("TEST_IMAGENAME", "ecs-deploy")
    28  	res, err := ecr.RepositoryExists(imageName)
    29  	fmt.Printf("Repository %v exists: %v\n", imageName, res)
    30  	if err != nil {
    31  		t.Errorf("Error: %v", err)
    32  		return
    33  	}
    34  }