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
1 change: 1 addition & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ linters:
- staticcheck
- testifylint
- thelper
- tparallel
- unparam
- usestdlibvars
- usetesting
Expand Down
14 changes: 14 additions & 0 deletions applicationset/generators/git_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ foo:
}

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

cases := []struct {
name string
directories []v1alpha1.GitDirectoryGeneratorItem
Expand Down Expand Up @@ -362,6 +364,8 @@ func TestGitGenerateParamsFromDirectories(t *testing.T) {
}

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

cases := []struct {
name string
directories []v1alpha1.GitDirectoryGeneratorItem
Expand Down Expand Up @@ -663,6 +667,8 @@ func TestGitGenerateParamsFromDirectoriesGoTemplate(t *testing.T) {
}

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

cases := []struct {
name string
// files is the list of paths/globs to match
Expand Down Expand Up @@ -1029,6 +1035,8 @@ cluster:
// TestGitGeneratorParamsFromFilesWithExcludeOptionWithNewGlobbing tests the params values generated by git file generator
// when exclude option is set to true. It gives the result files based on new globbing pattern - doublestar package
func TestGitGeneratorParamsFromFilesWithExcludeOptionWithNewGlobbing(t *testing.T) {
t.Parallel()

cases := []struct {
name string
// files is the list of paths/globs to match
Expand Down Expand Up @@ -1373,6 +1381,8 @@ env: testing
// TestGitGeneratorParamsFromFilesWithExcludeOptionWithOldGlobbing tests the params values generated by git file generator
// // when exclude option is set to true. It gives the result files based on old globbing pattern - git ls-files
func TestGitGeneratorParamsFromFilesWithExcludeOptionWithOldGlobbing(t *testing.T) {
t.Parallel()

cases := []struct {
name string
// files is the list of paths/globs to match
Expand Down Expand Up @@ -1712,6 +1722,8 @@ env: testing
// TestGitGeneratorParamsFromFilesWithExcludeOption tests the params values generated by git file generator
// when exclude option is set to true. It gives the result files based on new globbing pattern - doublestar package
func TestGitGeneratorParamsFromFilesWithExcludeOptionGoTemplate(t *testing.T) {
t.Parallel()

cases := []struct {
name string
// files is the list of paths/globs to match
Expand Down Expand Up @@ -1943,6 +1955,8 @@ func TestGitGeneratorParamsFromFilesWithExcludeOptionGoTemplate(t *testing.T) {
}

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

cases := []struct {
name string
// files is the list of paths/globs to match
Expand Down
4 changes: 4 additions & 0 deletions applicationset/generators/merge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ func listOfMapsToSet(maps []map[string]any) (map[string]bool, error) {
}

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

testCases := []struct {
name string
baseGenerators []argoprojiov1alpha1.ApplicationSetNestedGenerator
Expand Down Expand Up @@ -210,6 +212,8 @@ func toAPIExtensionsJSON(t *testing.T, g any) *apiextensionsv1.JSON {
}

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

testCases := []struct {
name string
mergeKeys []string
Expand Down
2 changes: 2 additions & 0 deletions applicationset/generators/pull_request_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,8 @@ func TestPullRequestGithubGenerateParams(t *testing.T) {
}

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

cases := []struct {
name string
providerConfig *argoprojiov1alpha1.PullRequestGenerator
Expand Down
4 changes: 4 additions & 0 deletions applicationset/generators/scm_provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import (
)

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

cases := []struct {
name string
repos []*scm_provider.Repository
Expand Down Expand Up @@ -185,6 +187,8 @@ func TestSCMProviderGenerateParams(t *testing.T) {
}

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

cases := []struct {
name string
providerConfig *argoprojiov1alpha1.SCMProviderGenerator
Expand Down
2 changes: 2 additions & 0 deletions applicationset/utils/createOrUpdate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import (
)

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

appMeta := metav1.TypeMeta{
APIVersion: v1alpha1.ApplicationSchemaGroupVersionKind.GroupVersion().String(),
Kind: v1alpha1.ApplicationSchemaGroupVersionKind.Kind,
Expand Down
2 changes: 2 additions & 0 deletions applicationset/utils/map_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
)

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

testCases := []struct {
name string
left map[string]any
Expand Down
2 changes: 2 additions & 0 deletions cmd/argocd-k8s-auth/commands/aws_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import (
)

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

ctx := t.Context()

t.Run("will return signed request on first attempt", func(t *testing.T) {
Expand Down
2 changes: 2 additions & 0 deletions cmd/argocd/commands/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1218,6 +1218,8 @@ func Test_unset(t *testing.T) {
}

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

testCases := []struct {
name string
source v1alpha1.ApplicationSource
Expand Down
6 changes: 6 additions & 0 deletions cmpserver/plugin/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import (
)

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

testCases := []struct {
name string
discover Discover
Expand Down Expand Up @@ -76,6 +78,8 @@ func Test_IsDefined(t *testing.T) {
}

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

testCases := []struct {
name string
fileContents string
Expand Down Expand Up @@ -169,6 +173,8 @@ spec:
}

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

testCases := []struct {
name string
config *PluginConfig
Expand Down
2 changes: 2 additions & 0 deletions controller/state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1301,6 +1301,8 @@ func TestComparisonResult_GetSyncStatus(t *testing.T) {
}

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

managedObj := kube.MustToUnstructured(&corev1.ConfigMap{
TypeMeta: metav1.TypeMeta{
APIVersion: "v1",
Expand Down
8 changes: 8 additions & 0 deletions controller/sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ func TestSyncComparisonError(t *testing.T) {
}

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

type fixture struct {
application *v1alpha1.Application
controller *ApplicationController
Expand Down Expand Up @@ -255,6 +257,8 @@ func TestAppStateManager_SyncAppState(t *testing.T) {
}

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

type fixture struct {
application *v1alpha1.Application
controller *ApplicationController
Expand Down Expand Up @@ -642,6 +646,8 @@ func TestNormalizeTargetResourcesWithList(t *testing.T) {
}

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

type fixture struct {
project *v1alpha1.AppProject
application *v1alpha1.Application
Expand Down Expand Up @@ -988,6 +994,8 @@ func TestDeriveServiceAccountMatchingNamespaces(t *testing.T) {
}

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

type fixture struct {
project *v1alpha1.AppProject
application *v1alpha1.Application
Expand Down
16 changes: 16 additions & 0 deletions pkg/apis/application/v1alpha1/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -947,6 +947,8 @@ func TestAppSourceEquality(t *testing.T) {
}

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

defaultKV := "999.999.999"
cases := []struct {
name string
Expand Down Expand Up @@ -996,6 +998,8 @@ func TestAppSource_GetKubeVersionOrDefault(t *testing.T) {
}

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

defaultAPIVersions := []string{"v1", "v2"}
cases := []struct {
name string
Expand Down Expand Up @@ -1045,6 +1049,8 @@ func TestAppSource_GetAPIVersionsOrDefault(t *testing.T) {
}

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

defaultNS := "default"
cases := []struct {
name string
Expand Down Expand Up @@ -2465,6 +2471,8 @@ func TestSyncWindows_Matches_AND_Operator(t *testing.T) {
}

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

t.Run("will allow manual sync if inactive-deny-window set with manual true", func(t *testing.T) {
// given
t.Parallel()
Expand Down Expand Up @@ -4073,6 +4081,8 @@ func getApplicationSpec() *ApplicationSpec {
}

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

tests := []struct {
name string
hasSources bool
Expand Down Expand Up @@ -4102,6 +4112,8 @@ func TestGetSource(t *testing.T) {
}

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

tests := []struct {
name string
hasSources bool
Expand Down Expand Up @@ -4139,6 +4151,8 @@ func TestGetSources(t *testing.T) {
}

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

// Demonstrate that the JSON unmarshalling of an empty array parameter is an OptionalArray with the array field set
// to an empty array.
presentButEmpty := `{"array":[]}`
Expand Down Expand Up @@ -4182,6 +4196,8 @@ func TestOptionalArrayEquality(t *testing.T) {
}

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

// Demonstrate that the JSON unmarshalling of an empty map parameter is an OptionalMap with the map field set
// to an empty map.
presentButEmpty := `{"map":{}}`
Expand Down
4 changes: 4 additions & 0 deletions reposerver/repository/repository_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ func TestGenerateYamlManifestInDir(t *testing.T) {
}

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

testCases := []struct {
name string
outOfBoundsFilename string
Expand Down Expand Up @@ -3312,6 +3314,8 @@ func TestGetHelmRepo_NamedReposAlias(t *testing.T) {
}

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

tempDir := t.TempDir()
paths := utilio.NewRandomizedTempPaths(tempDir)

Expand Down
2 changes: 2 additions & 0 deletions server/application/terminal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ func TestIsValidContainerNameName(t *testing.T) {
}

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

testKeys := []string{
"pod",
"container",
Expand Down
4 changes: 4 additions & 0 deletions server/cluster/cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ func newEnforcer() *rbac.Enforcer {
}

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

testCases := []struct {
name string
request cluster.ClusterUpdateRequest
Expand Down Expand Up @@ -605,6 +607,8 @@ func getClientset(config map[string]string, ns string, objects ...runtime.Object
}

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

db := &dbmocks.ArgoDB{}

fooCluster := v1alpha1.Cluster{
Expand Down
2 changes: 2 additions & 0 deletions server/deeplinks/deeplinks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ type deepLinkTC struct {
}

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

appObj, err := kube.ToUnstructured(&v1alpha1.Application{
ObjectMeta: metav1.ObjectMeta{
Name: "test",
Expand Down
4 changes: 4 additions & 0 deletions server/extension/extension_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ func TestValidateHeaders(t *testing.T) {
}

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

type fixture struct {
settingsGetterMock *mocks.SettingsGetter
manager *extension.Manager
Expand Down Expand Up @@ -231,6 +233,8 @@ func TestRegisterExtensions(t *testing.T) {
}

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

type fixture struct {
mux *http.ServeMux
appGetterMock *mocks.ApplicationGetter
Expand Down
Loading
Loading