Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tech-debt] reduce unit-test execution time #3553

Closed
vdemeester opened this issue Nov 23, 2020 · 6 comments
Closed

[tech-debt] reduce unit-test execution time #3553

vdemeester opened this issue Nov 23, 2020 · 6 comments
Assignees
Labels
area/testing Issues or PRs related to testing good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@vdemeester
Copy link
Member

A full unit-test run is currently around the mine (63.786s). This is not that bad but unit tests should be really quick, a go test shouldn't spend more than a second or two to run all the unit tests of a package. This is not the case now, some packages are quite the offender 😅.

  • cmd/entrypoint (4.12s)
  • pkg/reconciler/events/cloudevent (3.147s)
  • pkg/reconciler/events (6.176s)
  • pkg/reconciler/pipelinerun/resources (6.519s)
  • pkg/reconciler/taskrun/resources (6.515s)
  • pkg/reconciler/taskrun (25.578s)
  • pkg/reconciler/pipelinerun (39.779s)

/area testing
/kind cleanup


Full run

$ gotestsum --format=pkgname-and-test-fails -- -count=1 ./...
✓  cmd/imagedigestexporter (209ms)
✓  pkg/apis/pipeline (34ms)
✓  pkg/apis/config (186ms)
∅  cmd/controller
∅  cmd/creds-init
✓  pkg/apis/resource/v1alpha1 (97ms)
✓  internal/builder/v1beta1 (179ms)
✓  pkg/apis/resource/v1alpha1/cloudevent (62ms)
✓  cmd/entrypoint (4.12s)
∅  cmd/git-init
∅  cmd/kubeconfigwriter
∅  cmd/nop
∅  cmd/pullrequest-init
∅  cmd/webhook
∅  config
∅  hack/spec-gen
∅  internal/builder/v1alpha1
∅  pkg/apis/pipeline/pod
✓  pkg/apis/resource/v1alpha1/cluster (127ms)
✓  pkg/apis/resource/v1alpha1/git (183ms)
✓  pkg/apis/pipeline/v1alpha1 (276ms)
✓  pkg/apis/pipeline/v1beta1 (290ms)
∅  pkg/apis/resource
✓  pkg/apis/validate (71ms)
✓  pkg/apis/resource/v1alpha1/pullrequest (85ms)
✓  pkg/apis/resource/v1alpha1/image (161ms)
✓  pkg/contexts (32ms)
✓  pkg/apis/resource/v1alpha1/storage (93ms)
✓  pkg/git (44ms)
✓  pkg/credentials/dockercreds (33ms)
✓  pkg/jsonpath (34ms)
✓  pkg/credentials (40ms)
✓  pkg/list (46ms)
✓  pkg/names (43ms)
✓  pkg/credentials/gitcreds (47ms)
✓  pkg/pullrequest (72ms)
✓  pkg/artifacts (88ms)
∅  pkg/client/clientset/versioned (2ms)
∅  pkg/client/clientset/versioned/fake
∅  pkg/client/clientset/versioned/scheme
∅  pkg/client/clientset/versioned/typed/pipeline/v1alpha1
∅  pkg/client/clientset/versioned/typed/pipeline/v1alpha1/fake
∅  pkg/client/clientset/versioned/typed/pipeline/v1beta1
∅  pkg/client/clientset/versioned/typed/pipeline/v1beta1/fake
∅  pkg/client/informers/externalversions
∅  pkg/client/informers/externalversions/internalinterfaces
∅  pkg/client/informers/externalversions/pipeline
∅  pkg/client/informers/externalversions/pipeline/v1alpha1
∅  pkg/client/informers/externalversions/pipeline/v1beta1
∅  pkg/client/injection/client
∅  pkg/client/injection/client/fake
∅  pkg/client/injection/informers/factory
∅  pkg/client/injection/informers/factory/fake
∅  pkg/client/injection/informers/pipeline/v1alpha1/clustertask
∅  pkg/client/injection/informers/pipeline/v1alpha1/clustertask/fake
∅  pkg/client/injection/informers/pipeline/v1alpha1/condition
∅  pkg/client/injection/informers/pipeline/v1alpha1/condition/fake
∅  pkg/client/injection/informers/pipeline/v1alpha1/pipeline
∅  pkg/client/injection/informers/pipeline/v1alpha1/pipeline/fake
∅  pkg/client/injection/informers/pipeline/v1alpha1/pipelinerun
∅  pkg/client/injection/informers/pipeline/v1alpha1/pipelinerun/fake
∅  pkg/client/injection/informers/pipeline/v1alpha1/run
∅  pkg/client/injection/informers/pipeline/v1alpha1/run/fake
∅  pkg/client/injection/informers/pipeline/v1alpha1/task
∅  pkg/client/injection/informers/pipeline/v1alpha1/task/fake
∅  pkg/client/injection/informers/pipeline/v1alpha1/taskrun
∅  pkg/client/injection/informers/pipeline/v1alpha1/taskrun/fake
∅  pkg/client/injection/informers/pipeline/v1beta1/clustertask
∅  pkg/client/injection/informers/pipeline/v1beta1/clustertask/fake
∅  pkg/client/injection/informers/pipeline/v1beta1/pipeline
∅  pkg/client/injection/informers/pipeline/v1beta1/pipeline/fake
∅  pkg/client/injection/informers/pipeline/v1beta1/pipelinerun
∅  pkg/client/injection/informers/pipeline/v1beta1/pipelinerun/fake
∅  pkg/client/injection/informers/pipeline/v1beta1/task
∅  pkg/client/injection/informers/pipeline/v1beta1/task/fake
∅  pkg/client/injection/informers/pipeline/v1beta1/taskrun
∅  pkg/client/injection/informers/pipeline/v1beta1/taskrun/fake
∅  pkg/client/injection/reconciler/pipeline/v1alpha1/run
∅  pkg/client/injection/reconciler/pipeline/v1alpha1/run/stub
∅  pkg/client/injection/reconciler/pipeline/v1beta1/pipelinerun
∅  pkg/client/injection/reconciler/pipeline/v1beta1/pipelinerun/stub
∅  pkg/client/injection/reconciler/pipeline/v1beta1/taskrun
∅  pkg/client/injection/reconciler/pipeline/v1beta1/taskrun/stub
∅  pkg/client/listers/pipeline/v1alpha1
∅  pkg/client/listers/pipeline/v1beta1
∅  pkg/client/resource/clientset/versioned
∅  pkg/client/resource/clientset/versioned/fake
∅  pkg/client/resource/clientset/versioned/scheme
∅  pkg/client/resource/clientset/versioned/typed/resource/v1alpha1
∅  pkg/client/resource/clientset/versioned/typed/resource/v1alpha1/fake
∅  pkg/client/resource/informers/externalversions
∅  pkg/client/resource/informers/externalversions/internalinterfaces
∅  pkg/client/resource/informers/externalversions/resource
∅  pkg/client/resource/informers/externalversions/resource/v1alpha1
∅  pkg/client/resource/injection/client
∅  pkg/client/resource/injection/client/fake
∅  pkg/client/resource/injection/informers/factory
∅  pkg/client/resource/injection/informers/factory/fake
∅  pkg/client/resource/injection/informers/resource/v1alpha1/pipelineresource
∅  pkg/client/resource/injection/informers/resource/v1alpha1/pipelineresource/fake
∅  pkg/client/resource/listers/resource/v1alpha1
✓  pkg/reconciler (62ms)
✓  pkg/entrypoint (342ms)
✓  pkg/controller (431ms)
✓  pkg/reconciler/pipeline/dag (162ms)
✓  pkg/pod (165ms)
✓  pkg/reconciler/events/cloudevent (3.147s)
✓  pkg/reconciler/volumeclaim (39ms)
✓  pkg/system (2ms)
✓  pkg/substitution (27ms)
✓  pkg/remote/oci (342ms)
✓  pkg/reconciler/events (6.176s)
✓  pkg/termination (126ms)
✓  pkg/reconciler/pipelinerun/resources (6.519s)
✓  pkg/workspace (135ms)
✓  pkg/reconciler/taskrun/resources (6.515s)
✓  test (44ms)
✓  test/v1alpha1 (36ms)
✓  pkg/reconciler/taskrun (25.578s)
✓  pkg/reconciler/pipelinerun (39.779s)
∅  pkg/reconciler/testing
∅  pkg/remote
∅  pkg/version
∅  test/diff
∅  test/gohelloworld
∅  test/internal/clients
∅  test/internal/environment
∅  test/internal/logs
∅  test/names
∅  test/pullrequest

DONE 2082 tests in 63.786s
@tekton-robot tekton-robot added area/testing Issues or PRs related to testing kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Nov 23, 2020
@vdemeester vdemeester added good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. labels Nov 23, 2020
@souleb
Copy link
Contributor

souleb commented Dec 22, 2020

I can work on that.

@souleb
Copy link
Contributor

souleb commented Dec 22, 2020

/assign

@tekton-robot
Copy link
Collaborator

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale with a justification.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/lifecycle stale

Send feedback to tektoncd/plumbing.

@tekton-robot tekton-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Mar 22, 2021
@tekton-robot
Copy link
Collaborator

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten with a justification.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/lifecycle rotten

Send feedback to tektoncd/plumbing.

@tekton-robot tekton-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Apr 21, 2021
@tekton-robot
Copy link
Collaborator

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen with a justification.
Mark the issue as fresh with /remove-lifecycle rotten with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/close

Send feedback to tektoncd/plumbing.

@tekton-robot
Copy link
Collaborator

@tekton-robot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen with a justification.
Mark the issue as fresh with /remove-lifecycle rotten with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/close

Send feedback to tektoncd/plumbing.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/testing Issues or PRs related to testing good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

3 participants