Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ import (
)

func TestProviderQueryPoints(t *testing.T) {
t.Parallel()

toInt64Pointer := func(i int64) *int64 { return &i }
type queryResponse struct {
res datadog.MetricsQueryResponse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,15 @@ import (
)

func TestType(t *testing.T) {
t.Parallel()

p := Provider{}
assert.Equal(t, ProviderType, p.Type())
}

func TestProviderQueryPoints(t *testing.T) {
t.Parallel()

testcases := []struct {
name string
client client
Expand Down
9 changes: 1 addition & 8 deletions pkg/app/piped/apistore/analysisresultstore/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
name = "go_default_library",
Expand All @@ -14,10 +14,3 @@ go_library(
"@org_uber_go_zap//:go_default_library",
],
)

go_test(
name = "go_default_test",
size = "small",
srcs = ["store_test.go"],
embed = [":go_default_library"],
)
15 changes: 0 additions & 15 deletions pkg/app/piped/apistore/analysisresultstore/store_test.go

This file was deleted.

9 changes: 1 addition & 8 deletions pkg/app/piped/apistore/applicationstore/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
name = "go_default_library",
Expand All @@ -12,10 +12,3 @@ go_library(
"@org_uber_go_zap//:go_default_library",
],
)

go_test(
name = "go_default_test",
size = "small",
srcs = ["store_test.go"],
embed = [":go_default_library"],
)
15 changes: 0 additions & 15 deletions pkg/app/piped/apistore/applicationstore/store_test.go

This file was deleted.

9 changes: 1 addition & 8 deletions pkg/app/piped/apistore/commandstore/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
name = "go_default_library",
Expand All @@ -12,10 +12,3 @@ go_library(
"@org_uber_go_zap//:go_default_library",
],
)

go_test(
name = "go_default_test",
size = "small",
srcs = ["store_test.go"],
embed = [":go_default_library"],
)
15 changes: 0 additions & 15 deletions pkg/app/piped/apistore/commandstore/store_test.go

This file was deleted.

9 changes: 1 addition & 8 deletions pkg/app/piped/apistore/deploymentstore/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
name = "go_default_library",
Expand All @@ -12,10 +12,3 @@ go_library(
"@org_uber_go_zap//:go_default_library",
],
)

go_test(
name = "go_default_test",
size = "small",
srcs = ["store_test.go"],
embed = [":go_default_library"],
)
15 changes: 0 additions & 15 deletions pkg/app/piped/apistore/deploymentstore/store_test.go

This file was deleted.

9 changes: 1 addition & 8 deletions pkg/app/piped/apistore/eventstore/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
name = "go_default_library",
Expand All @@ -12,10 +12,3 @@ go_library(
"@org_uber_go_zap//:go_default_library",
],
)

go_test(
name = "go_default_test",
size = "small",
srcs = ["store_test.go"],
embed = [":go_default_library"],
)
15 changes: 0 additions & 15 deletions pkg/app/piped/apistore/eventstore/store_test.go

This file was deleted.

4 changes: 4 additions & 0 deletions pkg/app/piped/appconfigreporter/appconfigreporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ func (f *fakeApplicationLister) List() []*model.Application {
}

func TestReporter_findRegisteredApps(t *testing.T) {
t.Parallel()

type args struct {
repoPath string
repoID string
Expand Down Expand Up @@ -162,6 +164,8 @@ spec:
}

func TestReporter_findUnregisteredApps(t *testing.T) {
t.Parallel()

type args struct {
registeredAppPaths map[string]string
repoPath, repoID string
Expand Down
6 changes: 6 additions & 0 deletions pkg/app/piped/cloudprovider/cloudrun/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,17 @@ import (
)

func TestMakeCloudRunParent(t *testing.T) {
t.Parallel()

const projectID = "projectID"
got := makeCloudRunParent(projectID)
want := "namespaces/projectID"
assert.Equal(t, want, got)
}

func TestMakeCloudRunServiceName(t *testing.T) {
t.Parallel()

const (
projectID = "projectID"
serviceID = "serviceID"
Expand All @@ -38,6 +42,8 @@ func TestMakeCloudRunServiceName(t *testing.T) {
}

func TestMakeCloudRunRevisionName(t *testing.T) {
t.Parallel()

const (
projectID = "projectID"
revisionID = "revisionID"
Expand Down
14 changes: 14 additions & 0 deletions pkg/app/piped/cloudprovider/cloudrun/cloudrun_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import (
)

func TestLoadServiceManifest(t *testing.T) {
t.Parallel()

const (
appDir = "testdata"
serviceFile = "new_manifest.yaml"
Expand All @@ -39,19 +41,25 @@ func TestLoadServiceManifest(t *testing.T) {
}

func TestMakeManagedByPipedSelector(t *testing.T) {
t.Parallel()

want := "pipecd-dev-managed-by=piped"
got := MakeManagedByPipedSelector()
assert.Equal(t, want, got)
}

func TestMakeRevisionNamesSelector(t *testing.T) {
t.Parallel()

names := []string{"test-1", "test-2", "test-3"}
got := MakeRevisionNamesSelector(names)
want := "pipecd-dev-revision-name in (test-1,test-2,test-3)"
assert.Equal(t, want, got)
}

func TestService(t *testing.T) {
t.Parallel()

sm, err := ParseServiceManifest([]byte(serviceManifest))
require.NoError(t, err)

Expand All @@ -75,6 +83,8 @@ func TestService(t *testing.T) {
}

func TestService_HealthStatus(t *testing.T) {
t.Parallel()

testcases := []struct {
name string
manifest string
Expand Down Expand Up @@ -309,6 +319,8 @@ status:
}

func TestRevision(t *testing.T) {
t.Parallel()

rm, err := ParseRevisionManifest([]byte(revisionManifest))
require.NoError(t, err)
require.NotEmpty(t, rm)
Expand All @@ -323,6 +335,8 @@ func TestRevision(t *testing.T) {
}

func TestRevision_HealthStatus(t *testing.T) {
t.Parallel()

testcases := []struct {
name string
manifest string
Expand Down
6 changes: 6 additions & 0 deletions pkg/app/piped/cloudprovider/cloudrun/diff_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import (
)

func TestDiff(t *testing.T) {
t.Parallel()

old, err := loadServiceManifest("testdata/old_manifest.yaml")
require.NoError(t, err)
require.NotEmpty(t, old)
Expand All @@ -42,6 +44,8 @@ func TestDiff(t *testing.T) {
}

func TestDiffResult_NoChange(t *testing.T) {
t.Parallel()

old, err := loadServiceManifest("testdata/old_manifest.yaml")
require.NoError(t, err)
require.NotEmpty(t, old)
Expand Down Expand Up @@ -100,6 +104,8 @@ func TestDiffResult_Render(t *testing.T) {
}

func TestDiffByCommand(t *testing.T) {
t.Parallel()

testcases := []struct {
name string
command string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ status:
`

func TestRevisionManifest(t *testing.T) {
t.Parallel()

rm, err := ParseRevisionManifest([]byte(revisionManifest))
require.NoError(t, err)
require.NotEmpty(t, rm)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ status:
`

func TestServiceManifest(t *testing.T) {
t.Parallel()

sm, err := ParseServiceManifest([]byte(serviceManifest))
require.NoError(t, err)
require.NotEmpty(t, sm)
Expand Down Expand Up @@ -143,6 +145,8 @@ func TestServiceManifest(t *testing.T) {
}

func TestParseServiceManifest(t *testing.T) {
t.Parallel()

// Success
data := []byte(serviceManifest)
sm, err := ParseServiceManifest(data)
Expand All @@ -156,6 +160,8 @@ func TestParseServiceManifest(t *testing.T) {
}

func TestDecideRevisionName(t *testing.T) {
t.Parallel()

data := []byte(serviceManifest)
sm, err := ParseServiceManifest(data)
require.NoError(t, err)
Expand All @@ -166,6 +172,8 @@ func TestDecideRevisionName(t *testing.T) {
}

func TestFindImageTag(t *testing.T) {
t.Parallel()

testcases := []struct {
name string
manifest string
Expand Down
2 changes: 2 additions & 0 deletions pkg/app/piped/cloudprovider/cloudrun/state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import (
)

func TestMakeResourceStates(t *testing.T) {
t.Parallel()

sm, err := ParseServiceManifest([]byte(serviceManifest))
require.NoError(t, err)

Expand Down
2 changes: 2 additions & 0 deletions pkg/app/piped/cloudprovider/ecs/servce_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import (
)

func TestParseServiceDefinition(t *testing.T) {
t.Parallel()

testcases := []struct {
name string
input string
Expand Down
2 changes: 2 additions & 0 deletions pkg/app/piped/cloudprovider/ecs/task_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import (
)

func TestParseTaskDefinition(t *testing.T) {
t.Parallel()

testcases := []struct {
name string
input string
Expand Down
Loading