Skip to content

Commit f80562e

Browse files
committed
fix: adding unit tests as a convention so that they only run with naming
1 parent 929e644 commit f80562e

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

.github/workflows/terraform_provider_main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ jobs:
188188
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
189189
with:
190190
go-version-file: go.mod
191-
- run: go test ./... -short
191+
- run: go test ./... -run="^TestUnit" # Runs tests starting with TestUnit
192192

193193
tfproviderlint:
194194
name: tfproviderlint

.github/workflows/terraform_provider_pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ jobs:
192192
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
193193
with:
194194
go-version-file: go.mod
195-
- run: go test ./... -short
195+
- run: go test ./... -run="^TestUnit" # Runs tests starting with TestUnit
196196

197197
tfproviderlint:
198198
name: tfproviderlint

provider/privatelink/utils_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"github.com/stretchr/testify/assert"
99
)
1010

11-
func TestFlattenConnections(t *testing.T) {
11+
func TestUnitFlattenConnections(t *testing.T) {
1212
// Test that flattenConnections produces keys that match the schema
1313
connections := []*pl.PrivateLinkConnection{
1414
{
@@ -38,12 +38,12 @@ func TestFlattenConnections(t *testing.T) {
3838
assert.Equal(t, "2024-01-01", conn["association_date"])
3939
}
4040

41-
func TestFlattenConnectionsEmpty(t *testing.T) {
41+
func TestUnitFlattenConnectionsEmpty(t *testing.T) {
4242
result := flattenConnections([]*pl.PrivateLinkConnection{})
4343
assert.Len(t, result, 0)
4444
}
4545

46-
func TestFlattenDatabases(t *testing.T) {
46+
func TestUnitFlattenDatabases(t *testing.T) {
4747
databases := []*pl.PrivateLinkDatabase{
4848
{
4949
DatabaseId: redis.Int(12345),
@@ -66,7 +66,7 @@ func TestFlattenDatabases(t *testing.T) {
6666
assert.Equal(t, "endpoint.example.com", db["resource_link_endpoint"])
6767
}
6868

69-
func TestFlattenPrincipals(t *testing.T) {
69+
func TestUnitFlattenPrincipals(t *testing.T) {
7070
principals := []*pl.PrivateLinkPrincipal{
7171
{
7272
Principal: redis.String("arn:aws:iam::123456789012:root"),

0 commit comments

Comments
 (0)