Example #1
0
func getClusterServices() (models.ECSServices, error) {
	os.Setenv("RACK", "convox-test")
	os.Setenv("CLUSTER", "convox-test")

	stubAws := test.StubAws(
		test.HttpdListServicesCycle(),
		test.HttpdDescribeServicesCycle(),
	)
	defer stubAws.Close()

	return models.ClusterServices()
}
Example #2
0
func TestGetAppServices(t *testing.T) {
	os.Setenv("RACK", "convox-test")
	os.Setenv("CLUSTER", "convox-test")

	aws := test.StubAws(
		test.HttpdDescribeStackResourcesCycle(),
		test.HttpdDescribeServicesCycle(),
	)
	defer aws.Close()

	services, err := models.GetAppServices("httpd")
	assert.Nil(t, err)
	assert.Equal(t, 1, len(services))

	s := services[0]
	assert.Equal(t, "arn:aws:ecs:us-west-2:901416387788:service/httpd-web-SRZPVERKQOL", *s.ServiceArn)
}