Skip to content

Conversation

@Hosshii
Copy link
Member

@Hosshii Hosshii commented Mar 10, 2022

What this PR does / why we need it:
Add t.Parallel to execute tests in parallel. And delete unused test files.

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?:

NONE

Copy link
Collaborator

@pipecd-bot pipecd-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GO_LINTER

Some issues were detected while linting go source files in your changes.

Copy link
Collaborator

@pipecd-bot pipecd-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GO_LINTER

Some issues were detected while linting go source files in your changes.

@pipecd-bot
Copy link
Collaborator

GO_LINTER

The golinter build is completed with FAILURE. The build will be triggered again when you push any other commits. Or you can trigger it manually by /golinter trigger command right now.

You can check the build log from here.

Copy link
Collaborator

@pipecd-bot pipecd-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GO_LINTER

Some issues were detected while linting go source files in your changes.

@Hosshii Hosshii marked this pull request as draft March 10, 2022 04:38
@pipecd-bot

This comment was marked as duplicate.

@Hosshii Hosshii marked this pull request as ready for review March 10, 2022 04:56
@Hosshii Hosshii marked this pull request as draft March 10, 2022 05:24
@Hosshii
Copy link
Member Author

Hosshii commented Mar 10, 2022

/close

@pipecd-bot pipecd-bot closed this Mar 10, 2022
@pipecd-bot
Copy link
Collaborator

LIFE_CYCLE

@Hosshii: Closed this pull request in response to this comment.

@pipecd-bot pipecd-bot deleted the add_parallel2 branch March 10, 2022 05:42
@Hosshii Hosshii restored the add_parallel2 branch March 10, 2022 08:34
@Hosshii Hosshii reopened this Mar 10, 2022
@pipecd-bot

This comment was marked as duplicate.

@Hosshii Hosshii marked this pull request as ready for review March 10, 2022 09:22
@Hosshii
Copy link
Member Author

Hosshii commented Mar 10, 2022

This is more faster than others (add t.parallel to all test and add t.parallel to slow test).
So could you review this PR?

Copy link
Member

@knanao knanao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!
Let me check one point.
If we run cases of table driven tests sequentially, the tests will be extremely slow?

@Hosshii
Copy link
Member Author

Hosshii commented Mar 11, 2022

I think If each case of the table is slow, parallelization would speed it up. Otherwise, the cost of parallelization would be more expensive.

@Hosshii
Copy link
Member Author

Hosshii commented Mar 11, 2022

I wrote these tests before #3370 (comment). So these tests uses t.Parallel in sub tests. But it might be good to remove it.

@knanao
Copy link
Member

knanao commented Mar 11, 2022

Thanks.
It seems good to decide the coding policy of our team and decide which one to use.

we can use parallel on test function level or test cases level only, wdyt?

That's why, let us apply this!

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 34.75%. This pull request increases coverage by 2.34%.

File Function Base Head Diff
pkg/app/piped/executor/analysis/analysis.go Register 66.67% 0.00% -66.67%
pkg/app/piped/executor/cloudrun/cloudrun.go Register 66.67% 0.00% -66.67%
pkg/app/piped/executor/kubernetes/kubernetes.go Register 81.82% 0.00% -81.82%
pkg/app/piped/executor/lambda/lambda.go Register 71.43% 0.00% -71.43%
pkg/app/piped/executor/waitapproval/waitapproval.go Register 66.67% 0.00% -66.67%
pkg/app/piped/apistore/analysisresultstore/store.go NewStore 0.00% -- +-0.00%
pkg/app/piped/apistore/analysisresultstore/store.go store.GetLatestAnalysisResult 0.00% -- +-0.00%
pkg/app/piped/apistore/analysisresultstore/store.go store.PutLatestAnalysisResult 0.00% -- +-0.00%
pkg/app/piped/apistore/applicationstore/store.go NewStore 0.00% -- +-0.00%
pkg/app/piped/apistore/applicationstore/store.go store.Run 0.00% -- +-0.00%
pkg/app/piped/apistore/applicationstore/store.go store.Lister 0.00% -- +-0.00%
pkg/app/piped/apistore/applicationstore/store.go store.sync 0.00% -- +-0.00%
pkg/app/piped/apistore/applicationstore/store.go store.List 0.00% -- +-0.00%
pkg/app/piped/apistore/applicationstore/store.go store.ListByCloudProvider 0.00% -- +-0.00%
pkg/app/piped/apistore/applicationstore/store.go store.Get 0.00% -- +-0.00%
pkg/app/piped/apistore/commandstore/store.go NewStore 0.00% -- +-0.00%
pkg/app/piped/apistore/commandstore/store.go store.Run 0.00% -- +-0.00%
pkg/app/piped/apistore/commandstore/store.go store.Lister 0.00% -- +-0.00%
pkg/app/piped/apistore/commandstore/store.go store.sync 0.00% -- +-0.00%
pkg/app/piped/apistore/commandstore/store.go store.cleanHandledCommands 0.00% -- +-0.00%
pkg/app/piped/apistore/commandstore/store.go store.ListApplicationCommands 0.00% -- +-0.00%
pkg/app/piped/apistore/commandstore/store.go store.ListDeploymentCommands 0.00% -- +-0.00%
pkg/app/piped/apistore/commandstore/store.go store.ListStageCommands 0.00% -- +-0.00%
pkg/app/piped/apistore/commandstore/store.go store.ListBuildPlanPreviewCommands 0.00% -- +-0.00%
pkg/app/piped/apistore/commandstore/store.go store.makeReportableCommand 0.00% -- +-0.00%
pkg/app/piped/apistore/commandstore/store.go store.reportCommandHandled 0.00% -- +-0.00%
pkg/app/piped/apistore/deploymentstore/store.go NewStore 0.00% -- +-0.00%
pkg/app/piped/apistore/deploymentstore/store.go store.Run 0.00% -- +-0.00%
pkg/app/piped/apistore/deploymentstore/store.go store.Lister 0.00% -- +-0.00%
pkg/app/piped/apistore/deploymentstore/store.go store.sync 0.00% -- +-0.00%
pkg/app/piped/apistore/deploymentstore/store.go store.ListPendings 0.00% -- +-0.00%
pkg/app/piped/apistore/deploymentstore/store.go store.ListPlanneds 0.00% -- +-0.00%
pkg/app/piped/apistore/deploymentstore/store.go store.ListRunnings 0.00% -- +-0.00%
pkg/app/piped/apistore/deploymentstore/store.go store.ListAppHeadDeployments 0.00% -- +-0.00%
pkg/app/piped/apistore/eventstore/store.go NewStore 0.00% -- +-0.00%
pkg/app/piped/apistore/eventstore/store.go store.Run 0.00% -- +-0.00%
pkg/app/piped/apistore/eventstore/store.go store.sync 0.00% -- +-0.00%
pkg/app/piped/apistore/eventstore/store.go store.ListNotHandled 0.00% -- +-0.00%
pkg/app/piped/apistore/eventstore/store.go store.Lister 0.00% -- +-0.00%
pkg/app/piped/cloudprovider/terraform/terraform.go WithoutColor 0.00% -- +-0.00%
pkg/app/piped/cloudprovider/terraform/terraform.go WithVars 0.00% -- +-0.00%
pkg/app/piped/cloudprovider/terraform/terraform.go WithVarFiles 0.00% -- +-0.00%
pkg/app/piped/cloudprovider/terraform/terraform.go WithAdditionalFlags 0.00% -- +-0.00%
pkg/app/piped/cloudprovider/terraform/terraform.go WithAdditionalEnvs 0.00% -- +-0.00%
pkg/app/piped/cloudprovider/terraform/terraform.go NewTerraform 0.00% -- +-0.00%
pkg/app/piped/cloudprovider/terraform/terraform.go Terraform.Version 0.00% -- +-0.00%
pkg/app/piped/cloudprovider/terraform/terraform.go Terraform.Init 0.00% -- +-0.00%
pkg/app/piped/cloudprovider/terraform/terraform.go Terraform.SelectWorkspace 0.00% -- +-0.00%
pkg/app/piped/cloudprovider/terraform/terraform.go PlanResult.NoChanges 0.00% -- +-0.00%
pkg/app/piped/cloudprovider/terraform/terraform.go GetExitCode 0.00% -- +-0.00%
pkg/app/piped/cloudprovider/terraform/terraform.go Terraform.Plan 0.00% -- +-0.00%
pkg/app/piped/cloudprovider/terraform/terraform.go Terraform.makeCommonCommandArgs 0.00% -- +-0.00%
pkg/app/piped/cloudprovider/terraform/terraform.go stripAnsiCodes 0.00% -- +-0.00%
pkg/app/piped/cloudprovider/terraform/terraform.go parsePlanResult 0.00% -- +-0.00%
pkg/app/piped/cloudprovider/terraform/terraform.go Terraform.Apply 0.00% -- +-0.00%
pkg/app/piped/controller/controller.go NewController 0.00% -- +-0.00%
pkg/app/piped/controller/controller.go controller.Run 0.00% -- +-0.00%
pkg/app/piped/controller/controller.go controller.shutdown 0.00% -- +-0.00%
pkg/app/piped/controller/controller.go controller.checkCommands 0.00% -- +-0.00%
pkg/app/piped/controller/controller.go controller.syncPlanners 0.00% -- +-0.00%
pkg/app/piped/controller/controller.go controller.startNewPlanner 0.00% -- +-0.00%
pkg/app/piped/controller/controller.go controller.syncSchedulers 0.00% -- +-0.00%
pkg/app/piped/controller/controller.go controller.startNewScheduler 0.00% -- +-0.00%
pkg/app/piped/controller/controller.go controller.getMostRecentlySuccessfulDeployment 0.00% -- +-0.00%
pkg/app/piped/controller/controller.go controller.shouldStartPlanningDeployment 0.00% -- +-0.00%
pkg/app/piped/controller/controller.go controller.cancelDeployment 0.00% -- +-0.00%
pkg/app/piped/controller/controller.go appLiveResourceLister.ListKubernetesResources 0.00% -- +-0.00%
pkg/app/piped/controller/controller.go reportApplicationDeployingStatus 0.00% -- +-0.00%
pkg/app/piped/controller/planner.go newPlanner 0.00% -- +-0.00%
pkg/app/piped/controller/planner.go planner.ID 0.00% -- +-0.00%
pkg/app/piped/controller/planner.go planner.IsDone 0.00% -- +-0.00%
pkg/app/piped/controller/planner.go planner.DoneTimestamp 0.00% -- +-0.00%
pkg/app/piped/controller/planner.go planner.DoneDeploymentStatus 0.00% -- +-0.00%
pkg/app/piped/controller/planner.go planner.Cancel 0.00% -- +-0.00%
pkg/app/piped/controller/planner.go planner.Run 0.00% -- +-0.00%
pkg/app/piped/controller/planner.go planner.reportDeploymentPlanned 0.00% -- +-0.00%
pkg/app/piped/controller/planner.go planner.reportDeploymentFailed 0.00% -- +-0.00%
pkg/app/piped/controller/planner.go planner.reportDeploymentCancelled 0.00% -- +-0.00%
pkg/app/piped/controller/planner.go planner.getMentionedAccounts 0.00% -- +-0.00%
pkg/app/piped/controller/scheduler.go newScheduler 0.00% -- +-0.00%
pkg/app/piped/controller/scheduler.go scheduler.ID 0.00% -- +-0.00%
pkg/app/piped/controller/scheduler.go scheduler.CommitHash 0.00% -- +-0.00%
pkg/app/piped/controller/scheduler.go scheduler.ConfigFilename 0.00% -- +-0.00%
pkg/app/piped/controller/scheduler.go scheduler.IsDone 0.00% -- +-0.00%
pkg/app/piped/controller/scheduler.go scheduler.DoneTimestamp 0.00% -- +-0.00%
pkg/app/piped/controller/scheduler.go scheduler.DoneDeploymentStatus 0.00% -- +-0.00%
pkg/app/piped/controller/scheduler.go scheduler.Cancel 0.00% -- +-0.00%
pkg/app/piped/controller/scheduler.go scheduler.Run 0.00% -- +-0.00%
pkg/app/piped/controller/scheduler.go scheduler.executeStage 0.00% -- +-0.00%
pkg/app/piped/controller/scheduler.go scheduler.reportStageStatus 0.00% -- +-0.00%
pkg/app/piped/controller/scheduler.go scheduler.reportDeploymentStatusChanged 0.00% -- +-0.00%
pkg/app/piped/controller/scheduler.go scheduler.reportDeploymentCompleted 0.00% -- +-0.00%
pkg/app/piped/controller/scheduler.go scheduler.getMentionedAccounts 0.00% -- +-0.00%
pkg/app/piped/controller/scheduler.go scheduler.reportMostRecentlySuccessfulDeployment 0.00% -- +-0.00%
pkg/app/piped/controller/scheduler.go stageCommandLister.ListCommands 0.00% -- +-0.00%
pkg/app/piped/controller/scheduler.go appAnalysisResultStore.GetLatestAnalysisResult 0.00% -- +-0.00%
pkg/app/piped/controller/scheduler.go appAnalysisResultStore.PutLatestAnalysisResult 0.00% -- +-0.00%
pkg/app/piped/deploysource/deploysource.go NewProvider 0.00% -- +-0.00%
pkg/app/piped/deploysource/deploysource.go provider.Revision 0.00% -- +-0.00%
pkg/app/piped/deploysource/deploysource.go provider.Get 0.00% -- +-0.00%
pkg/app/piped/deploysource/deploysource.go provider.GetReadOnly 0.00% -- +-0.00%
pkg/app/piped/deploysource/deploysource.go provider.prepare 0.00% -- +-0.00%
pkg/app/piped/deploysource/deploysource.go provider.copy 0.00% -- +-0.00%
pkg/app/piped/deploysource/sourcecloner.go NewGitSourceCloner 0.00% -- +-0.00%
pkg/app/piped/deploysource/sourcecloner.go gitSourceCloner.Revision 0.00% -- +-0.00%
pkg/app/piped/deploysource/sourcecloner.go gitSourceCloner.RevisionName 0.00% -- +-0.00%
pkg/app/piped/deploysource/sourcecloner.go gitSourceCloner.Clone 0.00% -- +-0.00%
pkg/app/piped/deploysource/sourcecloner.go NewLocalSourceCloner 0.00% -- +-0.00%
pkg/app/piped/deploysource/sourcecloner.go localSourceCloner.Revision 0.00% -- +-0.00%
pkg/app/piped/deploysource/sourcecloner.go localSourceCloner.RevisionName 0.00% -- +-0.00%
pkg/app/piped/deploysource/sourcecloner.go localSourceCloner.Clone 0.00% -- +-0.00%
pkg/app/piped/executor/terraform/deploy.go deployExecutor.Execute 0.00% -- +-0.00%
pkg/app/piped/executor/terraform/deploy.go deployExecutor.ensureSync 0.00% -- +-0.00%
pkg/app/piped/executor/terraform/deploy.go deployExecutor.ensurePlan 0.00% -- +-0.00%
pkg/app/piped/executor/terraform/deploy.go deployExecutor.ensureApply 0.00% -- +-0.00%
pkg/app/piped/executor/terraform/rollback.go rollbackExecutor.Execute 0.00% -- +-0.00%
pkg/app/piped/executor/terraform/rollback.go rollbackExecutor.ensureRollback 0.00% -- +-0.00%
pkg/app/piped/executor/terraform/terraform.go Register 71.43% -- -71.43%
pkg/app/piped/executor/terraform/terraform.go showUsingVersion 0.00% -- +-0.00%
pkg/app/piped/executor/terraform/terraform.go selectWorkspace 0.00% -- +-0.00%
pkg/app/piped/executor/terraform/terraform.go findTerraform 0.00% -- +-0.00%
pkg/app/piped/executor/terraform/terraform.go findCloudProvider 0.00% -- +-0.00%
pkg/app/piped/statsreporter/reporter.go NewReporter 0.00% -- +-0.00%
pkg/app/piped/statsreporter/reporter.go reporter.Run 0.00% -- +-0.00%
pkg/app/piped/statsreporter/reporter.go reporter.report 0.00% -- +-0.00%
pkg/app/piped/toolregistry/install.go registry.installKubectl 0.00% -- +-0.00%
pkg/app/piped/toolregistry/install.go registry.installKustomize 70.59% -- -70.59%
pkg/app/piped/toolregistry/install.go registry.installHelm 70.59% -- -70.59%
pkg/app/piped/toolregistry/install.go registry.installTerraform 0.00% -- +-0.00%
pkg/app/piped/toolregistry/registry.go DefaultRegistry 100.00% -- -100.00%
pkg/app/piped/toolregistry/registry.go InitDefaultRegistry 77.78% -- -77.78%
pkg/app/piped/toolregistry/registry.go loadPreinstalledTool 43.75% -- -43.75%
pkg/app/piped/toolregistry/registry.go registry.Kubectl 0.00% -- +-0.00%
pkg/app/piped/toolregistry/registry.go registry.Kustomize 82.35% -- -82.35%
pkg/app/piped/toolregistry/registry.go registry.Helm 88.24% -- -88.24%
pkg/app/piped/toolregistry/registry.go registry.Terraform 0.00% -- +-0.00%

@Hosshii
Copy link
Member Author

Hosshii commented Mar 11, 2022

Thank you! I removed sub-level t.parallel

@knanao
Copy link
Member

knanao commented Mar 11, 2022

Awesome!
/lgtm

@khanhtc1202
Copy link
Member

Here you go 🙌
/approve

@pipecd-bot
Copy link
Collaborator

APPROVE

This pull request is APPROVED by khanhtc1202.

Approvers can cancel the approval by writing /approve cancel in a comment. Any additional commits also will change this pull request to be not-approved.

@pipecd-bot pipecd-bot merged commit 3e5884f into master Mar 14, 2022
@pipecd-bot pipecd-bot deleted the add_parallel2 branch March 14, 2022 04:57
@pipecd-bot
Copy link
Collaborator

TEMPLATE

failed to handle template rule examples

Details
Error: unabled to get files: [examples]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants