Skip to content

Commit 6fb8605

Browse files
author
Andrew Ellison
authored
fix formatting and imports (#1202)
* fix formatting and imports * bump circleci ubuntu version use built in docker compose
1 parent e25292e commit 6fb8605

File tree

17 files changed

+95
-95
lines changed

17 files changed

+95
-95
lines changed

.circleci/config.yml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,11 @@ env: &env
1414
HELM_VERSION: v3.8.0
1515
KUBECONFIG: /home/circleci/.kube/config
1616
BIN_BUILD_PARALLELISM: 3
17-
DOCKER_COMPOSE_VERSION: v2.5.0
1817

1918
defaults: &defaults
2019
machine:
2120
enabled: true
22-
image: ubuntu-2004:202111-02
21+
image: ubuntu-2004:2022.10.1
2322
<<: *env
2423

2524
setup_minikube: &setup_minikube
@@ -75,16 +74,6 @@ install_docker_buildx: &install_docker_buildx
7574
# Verify buildx is available
7675
docker buildx create --use
7776
78-
# Installation script for the docker compose plugin. See: https://docs.docker.com/compose/install/#install-compose-on-linux-systems
79-
install_docker_compose: &install_docker_compose
80-
name: install docker compose
81-
command: |
82-
curl -sLO https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-linux-x86_64
83-
mkdir -p ~/.docker/cli-plugins
84-
mv docker-compose-linux-x86_64 ~/.docker/cli-plugins/docker-compose
85-
chmod a+x ~/.docker/cli-plugins/docker-compose
86-
docker compose version
87-
8877
configure_environment_for_gcp: &configure_environment_for_gcp
8978
name: configure environment for gcp
9079
command: |
@@ -180,8 +169,6 @@ jobs:
180169
<<: *install_gruntwork_utils
181170
- run:
182171
<<: *install_docker_buildx
183-
- run:
184-
<<: *install_docker_compose
185172

186173
# The weird way you have to set PATH in Circle 2.0
187174
- run: |

modules/aws/s3.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func GetS3BucketTags(t testing.TestingT, awsRegion string, bucket string) map[st
7070
return tags
7171
}
7272

73-
// GetS3BucketTagsE fetches the given bucket's tags and returns them as a string map of strings.
73+
// GetS3BucketTagsE fetches the given bucket's tags and returns them as a string map of strings.
7474
func GetS3BucketTagsE(t testing.TestingT, awsRegion string, bucket string) (map[string]string, error) {
7575
s3Client, err := NewS3ClientE(t, awsRegion)
7676
if err != nil {

modules/azure/mysql.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func GetMYSQLDBClientE(subscriptionID string) (*mysql.DatabasesClient, error) {
8282
return &mysqlDBClient, nil
8383
}
8484

85-
//GetMYSQLDB is a helper function that gets the database.
85+
// GetMYSQLDB is a helper function that gets the database.
8686
// This function would fail the test if there is an error.
8787
func GetMYSQLDB(t testing.TestingT, resGroupName string, serverName string, dbName string, subscriptionID string) *mysql.Database {
8888
database, err := GetMYSQLDBE(t, subscriptionID, resGroupName, serverName, dbName)
@@ -91,7 +91,7 @@ func GetMYSQLDB(t testing.TestingT, resGroupName string, serverName string, dbNa
9191
return database
9292
}
9393

94-
//GetMYSQLDBE is a helper function that gets the database.
94+
// GetMYSQLDBE is a helper function that gets the database.
9595
func GetMYSQLDBE(t testing.TestingT, subscriptionID string, resGroupName string, serverName string, dbName string) (*mysql.Database, error) {
9696
// Create a mySQl db client
9797
mysqldbClient, err := GetMYSQLDBClientE(subscriptionID)
@@ -109,15 +109,15 @@ func GetMYSQLDBE(t testing.TestingT, subscriptionID string, resGroupName string,
109109
return &mysqlDb, nil
110110
}
111111

112-
//ListMySQLDB is a helper function that gets all databases per server.
112+
// ListMySQLDB is a helper function that gets all databases per server.
113113
func ListMySQLDB(t testing.TestingT, resGroupName string, serverName string, subscriptionID string) []mysql.Database {
114114
dblist, err := ListMySQLDBE(t, subscriptionID, resGroupName, serverName)
115115
require.NoError(t, err)
116116

117117
return dblist
118118
}
119119

120-
//ListMySQLDBE is a helper function that gets all databases per server.
120+
// ListMySQLDBE is a helper function that gets all databases per server.
121121
func ListMySQLDBE(t testing.TestingT, subscriptionID string, resGroupName string, serverName string) ([]mysql.Database, error) {
122122
// Create a mySQl db client
123123
mysqldbClient, err := GetMYSQLDBClientE(subscriptionID)

modules/azure/postgresql.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func GetPostgreSQLDBClientE(subscriptionID string) (*postgresql.DatabasesClient,
8181
return &postgresqlDBClient, nil
8282
}
8383

84-
//GetPostgreSQLDB is a helper function that gets the database.
84+
// GetPostgreSQLDB is a helper function that gets the database.
8585
// This function would fail the test if there is an error.
8686
func GetPostgreSQLDB(t testing.TestingT, resGroupName string, serverName string, dbName string, subscriptionID string) *postgresql.Database {
8787
database, err := GetPostgreSQLDBE(t, subscriptionID, resGroupName, serverName, dbName)
@@ -90,7 +90,7 @@ func GetPostgreSQLDB(t testing.TestingT, resGroupName string, serverName string,
9090
return database
9191
}
9292

93-
//GetPostgreSQLDBE is a helper function that gets the database.
93+
// GetPostgreSQLDBE is a helper function that gets the database.
9494
func GetPostgreSQLDBE(t testing.TestingT, subscriptionID string, resGroupName string, serverName string, dbName string) (*postgresql.Database, error) {
9595
// Create a postgresql db client
9696
postgresqldbClient, err := GetPostgreSQLDBClientE(subscriptionID)
@@ -108,15 +108,15 @@ func GetPostgreSQLDBE(t testing.TestingT, subscriptionID string, resGroupName st
108108
return &postgresqlDb, nil
109109
}
110110

111-
//ListPostgreSQLDB is a helper function that gets all databases per server.
111+
// ListPostgreSQLDB is a helper function that gets all databases per server.
112112
func ListPostgreSQLDB(t testing.TestingT, subscriptionID string, resGroupName string, serverName string) []postgresql.Database {
113113
dblist, err := ListPostgreSQLDBE(t, subscriptionID, resGroupName, serverName)
114114
require.NoError(t, err)
115115

116116
return dblist
117117
}
118118

119-
//ListPostgreSQLDBE is a helper function that gets all databases per server.
119+
// ListPostgreSQLDBE is a helper function that gets all databases per server.
120120
func ListPostgreSQLDBE(t testing.TestingT, subscriptionID string, resGroupName string, serverName string) ([]postgresql.Database, error) {
121121
// Create a postgresql db client
122122
postgresqldbClient, err := GetPostgreSQLDBClientE(subscriptionID)

modules/azure/sql.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,15 @@ func GetDatabaseClient(subscriptionID string) (*sql.DatabasesClient, error) {
8383
return &sqlDBClient, nil
8484
}
8585

86-
//ListSQLServerDatabases is a helper function that gets a list of databases on a sql server
86+
// ListSQLServerDatabases is a helper function that gets a list of databases on a sql server
8787
func ListSQLServerDatabases(t testing.TestingT, resGroupName string, serverName string, subscriptionID string) *[]sql.Database {
8888
dbList, err := ListSQLServerDatabasesE(t, resGroupName, serverName, subscriptionID)
8989
require.NoError(t, err)
9090

9191
return dbList
9292
}
9393

94-
//ListSQLServerDatabasesE is a helper function that gets a list of databases on a sql server
94+
// ListSQLServerDatabasesE is a helper function that gets a list of databases on a sql server
9595
func ListSQLServerDatabasesE(t testing.TestingT, resGroupName string, serverName string, subscriptionID string) (*[]sql.Database, error) {
9696
// Create a SQl db client
9797
sqlClient, err := CreateDatabaseClient(subscriptionID)

modules/docker/docker_compose_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
package docker
22

33
import (
4-
"github.com/stretchr/testify/require"
54
"testing"
5+
6+
"github.com/stretchr/testify/require"
67
)
78

89
func TestDockerComposeWithBuildKit(t *testing.T) {

modules/docker/inspect.go

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -187,14 +187,15 @@ func transformContainer(t *testing.T, container inspectOutput) (*ContainerInspec
187187
}
188188

189189
// transformContainerPorts converts Docker's ports from the following json into a more testable format
190-
// {
191-
// "80/tcp": [
192-
// {
193-
// "HostIp": ""
194-
// "HostPort": "8080"
195-
// }
196-
// ]
197-
// }
190+
//
191+
// {
192+
// "80/tcp": [
193+
// {
194+
// "HostIp": ""
195+
// "HostPort": "8080"
196+
// }
197+
// ]
198+
// }
198199
func transformContainerPorts(container inspectOutput) ([]Port, error) {
199200
var ports []Port
200201

modules/k8s/service.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,12 @@ func GetServiceEndpoint(t testing.TestingT, options *KubectlOptions, service *co
109109
}
110110

111111
// GetServiceEndpointE will return the service access point using the following logic:
112-
// - For ClusterIP service type, return the URL that maps to ClusterIP and Service Port
113-
// - For NodePort service type, identify the public IP of the node (if it exists, otherwise return the bound hostname),
114-
// and the assigned node port for the provided service port, and return the URL that maps to node ip and node port.
115-
// - For LoadBalancer service type, return the publicly accessible hostname of the load balancer.
116-
// If the hostname is empty, it will return the public IP of the LoadBalancer.
117-
// - All other service types are not supported.
112+
// - For ClusterIP service type, return the URL that maps to ClusterIP and Service Port
113+
// - For NodePort service type, identify the public IP of the node (if it exists, otherwise return the bound hostname),
114+
// and the assigned node port for the provided service port, and return the URL that maps to node ip and node port.
115+
// - For LoadBalancer service type, return the publicly accessible hostname of the load balancer.
116+
// If the hostname is empty, it will return the public IP of the LoadBalancer.
117+
// - All other service types are not supported.
118118
func GetServiceEndpointE(t testing.TestingT, options *KubectlOptions, service *corev1.Service, servicePort int) (string, error) {
119119
switch service.Spec.Type {
120120
case corev1.ServiceTypeClusterIP:

modules/logger/logger.go

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,17 @@ func (_ terratestLogger) Logf(t testing.TestingT, format string, args ...interfa
108108
// immediately, rather than buffering all log output and only displaying it at the very end of the test. This is useful
109109
// because:
110110
//
111-
// 1. It allows you to iterate faster locally, as you get feedback on whether your code changes are working as expected
112-
// right away, rather than at the very end of the test run.
111+
// 1. It allows you to iterate faster locally, as you get feedback on whether your code changes are working as expected
112+
// right away, rather than at the very end of the test run.
113113
//
114-
// 2. If you have a bug in your code that causes a test to never complete or if the test code crashes, t.Logf would
115-
// show you no log output whatsoever, making debugging very hard, where as this method will show you all the log
116-
// output available.
114+
// 2. If you have a bug in your code that causes a test to never complete or if the test code crashes, t.Logf would
115+
// show you no log output whatsoever, making debugging very hard, where as this method will show you all the log
116+
// output available.
117+
//
118+
// 3. If you have a test that takes a long time to complete, some CI systems will kill the test suite prematurely
119+
// because there is no log output with t.Logf (e.g., CircleCI kills tests after 10 minutes of no log output). With
120+
// this log method, you get log output continuously.
117121
//
118-
// 3. If you have a test that takes a long time to complete, some CI systems will kill the test suite prematurely
119-
// because there is no log output with t.Logf (e.g., CircleCI kills tests after 10 minutes of no log output). With
120-
// this log method, you get log output continuously.
121122
// Although t.Logf now supports streaming output since Go 1.14, this is kept for compatibility purposes.
122123
func Logf(t testing.TestingT, format string, args ...interface{}) {
123124
if tt, ok := t.(helper); ok {

modules/logger/parser/failed_test_marker.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ package parser
44
// TestResultMarker tracks the indentation level of a test result line in go test output.
55
// Example:
66
// --- FAIL: TestSnafu
7-
// --- PASS: TestSnafu/Situation
8-
// --- FAIL: TestSnafu/Normal
7+
//
8+
// --- PASS: TestSnafu/Situation
9+
// --- FAIL: TestSnafu/Normal
10+
//
911
// The three markers for the above in order are:
1012
// TestResultMarker{TestName: "TestSnafu", IndentLevel: 0}
1113
// TestResultMarker{TestName: "TestSnafu/Situation", IndentLevel: 4}

0 commit comments

Comments
 (0)