Git tests in parallel-install take too much time
mjakobczyk opened this issue · comments
Description
Tests from hydroform/parallel-install/pkg/git/
take too long. They are unit tests, so they should take at most a few seconds. On my local machine when they are not cached they take roughly 90-100 seconds. On pipelines it is even 200-300 seconds.
Expected result
These tests should either take at most a few seconds (which is still a lot in comparison to other tests) or be turned off or testes once for a while.
Actual result
Local machine:
Pipeline:
Steps to reproduce
Run go test -v ./...
in parallel-install
or trigger the build on pipeline.
Troubleshooting
As suggested, maybe remote repository that is being downloaded should be changed to the smaller one.
After minor code refactoring it's possible to unit test the package without doing expensive network calls. It now takes around 1 sec to run the package tests.
hydroform/parallel-install on speed-up-git-pkg-tests ➜ go test ./... -count=1
? github.com/kyma-incubator/hydroform/parallel-install/example [no test files]
ok github.com/kyma-incubator/hydroform/parallel-install/pkg/archive 1.897s
ok github.com/kyma-incubator/hydroform/parallel-install/pkg/components 1.032s
ok github.com/kyma-incubator/hydroform/parallel-install/pkg/config 1.174s
ok github.com/kyma-incubator/hydroform/parallel-install/pkg/deployment 3.575s
ok github.com/kyma-incubator/hydroform/parallel-install/pkg/download 1.764s
ok github.com/kyma-incubator/hydroform/parallel-install/pkg/engine 1.349s
ok github.com/kyma-incubator/hydroform/parallel-install/pkg/git 1.222s
ok github.com/kyma-incubator/hydroform/parallel-install/pkg/helm 1.365s
? github.com/kyma-incubator/hydroform/parallel-install/pkg/logger [no test files]
? github.com/kyma-incubator/hydroform/parallel-install/pkg/namespace [no test files]
ok github.com/kyma-incubator/hydroform/parallel-install/pkg/overrides 1.068s
ok github.com/kyma-incubator/hydroform/parallel-install/pkg/preinstaller 0.844s
? github.com/kyma-incubator/hydroform/parallel-install/pkg/preinstaller/mocks [no test files]
? github.com/kyma-incubator/hydroform/parallel-install/pkg/test [no test files]