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

Controller env test fails if ginkgo is not installed. #1244

Open
AObuchow opened this issue Mar 22, 2024 · 0 comments
Open

Controller env test fails if ginkgo is not installed. #1244

AObuchow opened this issue Mar 22, 2024 · 0 comments
Assignees

Comments

@AObuchow
Copy link
Collaborator

Description

If the ginkgo CLI is not installed when running make test, the test suite will fail to run correctly, reporting that port 8080 is already in use.

How To Reproduce

  1. Open the devworkspace-operator repo in Eclipse Che or on the OpenShift Developer Sandbox instance of DevSpaces
  2. Run make test
  3. See that the test suite fails:
devworkspace-operator (main) $ make test
go: downloading sigs.k8s.io/controller-tools v0.6.1
go: downloading github.com/spf13/cobra v1.1.3
go: downloading golang.org/x/tools v0.1.3
go: downloading sigs.k8s.io/yaml v1.2.0
go: downloading github.com/fatih/color v1.12.0
go: downloading github.com/gobuffalo/flect v0.2.3
go: downloading k8s.io/apiextensions-apiserver v0.21.2
go: downloading k8s.io/apimachinery v0.21.2
go: downloading k8s.io/api v0.21.2
go: downloading gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
go: downloading github.com/mattn/go-colorable v0.1.8
go: downloading github.com/mattn/go-isatty v0.0.12
go: downloading gopkg.in/yaml.v2 v2.4.0
go: downloading github.com/spf13/pflag v1.0.5
go: downloading github.com/gogo/protobuf v1.3.2
go: downloading k8s.io/utils v0.0.0-20201110183641-67b214c5f920
go: downloading github.com/google/gofuzz v1.1.0
go: downloading k8s.io/klog/v2 v2.8.0
go: downloading sigs.k8s.io/structured-merge-diff/v4 v4.1.0
go: downloading golang.org/x/sys v0.0.0-20210510120138-977fb7262007
go: downloading gopkg.in/inf.v0 v0.9.1
go: downloading github.com/google/go-cmp v0.5.6
go: downloading github.com/go-logr/logr v0.4.0
go: downloading github.com/json-iterator/go v1.1.10
go: downloading golang.org/x/net v0.0.0-20210428140749-89ef3d95e781
go: downloading github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd
go: downloading github.com/modern-go/reflect2 v1.0.1
go: downloading golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
go: downloading golang.org/x/mod v0.4.2
go: downloading golang.org/x/text v0.3.6
WARN: goimports is not installed -- formatting using go fmt instead.
      Please install goimports to ensure file imports are consistent.
/usr/lib/golang/bin/gofmt -l -w main.go apis/controller/v1alpha1/attributes.go apis/controller/v1alpha1/common.go apis/controller/v1alpha1/devfile.go apis/controller/v1alpha1/devworkspaceoperatorconfig_types.go apis/controller/v1alpha1/devworkspacerouting_types.go apis/controller/v1alpha1/doc.go apis/controller/v1alpha1/errors.go apis/controller/v1alpha1/groupversion_info.go apis/controller/v1alpha1/zz_generated.deepcopy.go controllers/controller/devworkspacerouting/devworkspacerouting_controller.go controllers/controller/devworkspacerouting/devworkspacerouting_controller_test.go controllers/controller/devworkspacerouting/predicates.go controllers/controller/devworkspacerouting/suite_test.go controllers/controller/devworkspacerouting/sync_ingresses.go controllers/controller/devworkspacerouting/sync_routes.go controllers/controller/devworkspacerouting/sync_services.go controllers/controller/devworkspacerouting/util_test.go controllers/controller/devworkspacerouting/conversion/conversion.go controllers/controller/devworkspacerouting/solvers/basic_solver.go controllers/controller/devworkspacerouting/solvers/cluster_solver.go controllers/controller/devworkspacerouting/solvers/common.go controllers/controller/devworkspacerouting/solvers/errors.go controllers/controller/devworkspacerouting/solvers/resolve_endpoints.go controllers/controller/devworkspacerouting/solvers/resolve_endpoints_test.go controllers/controller/devworkspacerouting/solvers/solver.go controllers/workspace/cleanup.go controllers/workspace/condition.go controllers/workspace/devworkspace_controller.go controllers/workspace/devworkspace_controller_test.go controllers/workspace/eventhandlers.go controllers/workspace/finalize.go controllers/workspace/http.go controllers/workspace/http_test.go controllers/workspace/predicates.go controllers/workspace/status.go controllers/workspace/suite_test.go controllers/workspace/util_test.go controllers/workspace/validation.go controllers/workspace/internal/testutil/http.go controllers/workspace/metrics/deployment_provisioning.go controllers/workspace/metrics/failure_reason.go controllers/workspace/metrics/metrics.go controllers/workspace/metrics/update.go internal/images/image.go internal/map/map.go pkg/cache/cache.go pkg/common/naming.go pkg/common/types.go pkg/conditions/conditions.go pkg/config/common_test.go pkg/config/defaults.go pkg/config/env.go pkg/config/migrate.go pkg/config/migrate_test.go pkg/config/predicates.go pkg/config/sync.go pkg/config/sync_test.go pkg/config/configmap/config.go pkg/config/configmap/doc.go pkg/config/configmap/property.go pkg/config/proxy/openshift.go pkg/config/proxy/openshift_test.go pkg/constants/attributes.go pkg/constants/constants.go pkg/constants/env.go pkg/constants/finalizers.go pkg/constants/metadata.go pkg/dwerrors/errors.go pkg/infrastructure/cluster.go pkg/infrastructure/namespace.go pkg/infrastructure/webhook.go pkg/library/annotate/annotations.go pkg/library/annotate/plugins.go pkg/library/annotate/urls.go pkg/library/constants/constants.go pkg/library/container/container.go pkg/library/container/container_test.go pkg/library/container/conversion.go pkg/library/container/mountSources.go pkg/library/defaults/helper.go pkg/library/env/workspaceenv.go pkg/library/env/workspaceenv_test.go pkg/library/flatten/common.go pkg/library/flatten/flatten.go pkg/library/flatten/flatten_test.go pkg/library/flatten/helper.go pkg/library/flatten/merge.go pkg/library/flatten/internal/testutil/common.go pkg/library/flatten/internal/testutil/http.go pkg/library/flatten/internal/testutil/k8sClient.go pkg/library/flatten/network/devfile.go pkg/library/flatten/network/fetch.go pkg/library/home/persistentHome.go pkg/library/home/persistentHome_test.go pkg/library/kubernetes/common_test.go pkg/library/kubernetes/deserialize.go pkg/library/kubernetes/deserialize_test.go pkg/library/kubernetes/provision.go pkg/library/kubernetes/provision_test.go pkg/library/kubernetes/util.go pkg/library/lifecycle/command.go pkg/library/lifecycle/common.go pkg/library/lifecycle/poststart.go pkg/library/lifecycle/poststart_test.go pkg/library/lifecycle/prestart.go pkg/library/lifecycle/prestart_test.go pkg/library/lifecycle/prestop.go pkg/library/lifecycle/prestop_test.go pkg/library/lifecycle/util.go pkg/library/overrides/containers.go pkg/library/overrides/containers_test.go pkg/library/overrides/pods.go pkg/library/overrides/pods_test.go pkg/library/projects/clone.go pkg/library/resources/helper.go pkg/library/resources/helper_test.go pkg/library/status/check.go pkg/provision/automount/common.go pkg/provision/automount/common_test.go pkg/provision/automount/configmap.go pkg/provision/automount/gitconfig.go pkg/provision/automount/gitconfig_test.go pkg/provision/automount/projected.go pkg/provision/automount/projected_test.go pkg/provision/automount/pvcs.go pkg/provision/automount/secret.go pkg/provision/automount/templates.go pkg/provision/config/config.go pkg/provision/metadata/envvar.go pkg/provision/metadata/metadata.go pkg/provision/storage/asyncStorage.go pkg/provision/storage/cleanup.go pkg/provision/storage/commonStorage.go pkg/provision/storage/commonStorage_test.go pkg/provision/storage/doc.go pkg/provision/storage/ephemeralStorage.go pkg/provision/storage/ephemeralStorage_test.go pkg/provision/storage/perWorkspaceStorage.go pkg/provision/storage/perWorkspaceStorage_test.go pkg/provision/storage/provisioner.go pkg/provision/storage/shared.go pkg/provision/storage/asyncstorage/cleanup.go pkg/provision/storage/asyncstorage/configmap.go pkg/provision/storage/asyncstorage/configuration.go pkg/provision/storage/asyncstorage/constants.go pkg/provision/storage/asyncstorage/deployment.go pkg/provision/storage/asyncstorage/errors.go pkg/provision/storage/asyncstorage/secret.go pkg/provision/storage/asyncstorage/service.go pkg/provision/storage/asyncstorage/sidecar.go pkg/provision/storage/asyncstorage/ssh.go pkg/provision/storage/asyncstorage/volume.go pkg/provision/sync/cluster_api.go pkg/provision/sync/diff.go pkg/provision/sync/diffopts.go pkg/provision/sync/sync.go pkg/provision/sync/update.go pkg/provision/workspace/deployment.go pkg/provision/workspace/pull_secret.go pkg/provision/workspace/routing.go pkg/provision/workspace/serviceaccount.go pkg/provision/workspace/tokens.go pkg/provision/workspace/tokens_test.go pkg/provision/workspace/rbac/common.go pkg/provision/workspace/rbac/common_test.go pkg/provision/workspace/rbac/finalize.go pkg/provision/workspace/rbac/finalize_test.go pkg/provision/workspace/rbac/migrate.go pkg/provision/workspace/rbac/migrate_test.go pkg/provision/workspace/rbac/role.go pkg/provision/workspace/rbac/role_test.go pkg/provision/workspace/rbac/rolebinding.go pkg/provision/workspace/rbac/rolebinding_test.go pkg/webhook/cluster_role_bindings.go pkg/webhook/cluster_roles.go pkg/webhook/create.go pkg/webhook/deployment.go pkg/webhook/info.go pkg/webhook/init_cfg.go pkg/webhook/service_account.go pkg/webhook/kubernetes/tls.go pkg/webhook/openshift/tls.go pkg/webhook/service/log.go pkg/webhook/service/service.go project-clone/main.go project-clone/internal/devfile.go project-clone/internal/global.go project-clone/internal/utils.go project-clone/internal/bootstrap/bootstrap.go project-clone/internal/bootstrap/cluster.go project-clone/internal/bootstrap/util.go project-clone/internal/git/operations.go project-clone/internal/git/setup.go project-clone/internal/shell/execute.go project-clone/internal/zip/setup.go test/e2e/cmd/workspaces_test.go test/e2e/pkg/client/client.go test/e2e/pkg/client/devws.go test/e2e/pkg/client/namespace.go test/e2e/pkg/client/oc.go test/e2e/pkg/client/pod.go test/e2e/pkg/client/rbac.go test/e2e/pkg/client/webhooks.go test/e2e/pkg/config/config.go test/e2e/pkg/metadata/metadata.go test/e2e/pkg/tests/devworkspaces_tests.go version/version.go webhook/main.go webhook/server/server.go webhook/workspace/config.go webhook/workspace/log.go webhook/workspace/mutate.go webhook/workspace/mutating_cfg.go webhook/workspace/validate.go webhook/workspace/validating_cfg.go webhook/workspace/handler/access_control.go webhook/workspace/handler/attributes.go webhook/workspace/handler/deployment.go webhook/workspace/handler/exec.go webhook/workspace/handler/handler.go webhook/workspace/handler/immutable.go webhook/workspace/handler/kind.go webhook/workspace/handler/kubernetes.go webhook/workspace/handler/log.go webhook/workspace/handler/metadata.go webhook/workspace/handler/pod.go webhook/workspace/handler/template.go webhook/workspace/handler/validate.go webhook/workspace/handler/warning.go webhook/workspace/handler/warning_test.go webhook/workspace/handler/workspace.go
WARN: goimports is not installed -- formatting using go fmt instead.
      Please install goimports to ensure file imports are consistent.
/usr/lib/golang/bin/gofmt -l -w main.go apis/controller/v1alpha1/attributes.go apis/controller/v1alpha1/common.go apis/controller/v1alpha1/devfile.go apis/controller/v1alpha1/devworkspaceoperatorconfig_types.go apis/controller/v1alpha1/devworkspacerouting_types.go apis/controller/v1alpha1/doc.go apis/controller/v1alpha1/errors.go apis/controller/v1alpha1/groupversion_info.go apis/controller/v1alpha1/zz_generated.deepcopy.go controllers/controller/devworkspacerouting/devworkspacerouting_controller.go controllers/controller/devworkspacerouting/devworkspacerouting_controller_test.go controllers/controller/devworkspacerouting/predicates.go controllers/controller/devworkspacerouting/suite_test.go controllers/controller/devworkspacerouting/sync_ingresses.go controllers/controller/devworkspacerouting/sync_routes.go controllers/controller/devworkspacerouting/sync_services.go controllers/controller/devworkspacerouting/util_test.go controllers/controller/devworkspacerouting/conversion/conversion.go controllers/controller/devworkspacerouting/solvers/basic_solver.go controllers/controller/devworkspacerouting/solvers/cluster_solver.go controllers/controller/devworkspacerouting/solvers/common.go controllers/controller/devworkspacerouting/solvers/errors.go controllers/controller/devworkspacerouting/solvers/resolve_endpoints.go controllers/controller/devworkspacerouting/solvers/resolve_endpoints_test.go controllers/controller/devworkspacerouting/solvers/solver.go controllers/workspace/cleanup.go controllers/workspace/condition.go controllers/workspace/devworkspace_controller.go controllers/workspace/devworkspace_controller_test.go controllers/workspace/eventhandlers.go controllers/workspace/finalize.go controllers/workspace/http.go controllers/workspace/http_test.go controllers/workspace/predicates.go controllers/workspace/status.go controllers/workspace/suite_test.go controllers/workspace/util_test.go controllers/workspace/validation.go controllers/workspace/internal/testutil/http.go controllers/workspace/metrics/deployment_provisioning.go controllers/workspace/metrics/failure_reason.go controllers/workspace/metrics/metrics.go controllers/workspace/metrics/update.go internal/images/image.go internal/map/map.go pkg/cache/cache.go pkg/common/naming.go pkg/common/types.go pkg/conditions/conditions.go pkg/config/common_test.go pkg/config/defaults.go pkg/config/env.go pkg/config/migrate.go pkg/config/migrate_test.go pkg/config/predicates.go pkg/config/sync.go pkg/config/sync_test.go pkg/config/configmap/config.go pkg/config/configmap/doc.go pkg/config/configmap/property.go pkg/config/proxy/openshift.go pkg/config/proxy/openshift_test.go pkg/constants/attributes.go pkg/constants/constants.go pkg/constants/env.go pkg/constants/finalizers.go pkg/constants/metadata.go pkg/dwerrors/errors.go pkg/infrastructure/cluster.go pkg/infrastructure/namespace.go pkg/infrastructure/webhook.go pkg/library/annotate/annotations.go pkg/library/annotate/plugins.go pkg/library/annotate/urls.go pkg/library/constants/constants.go pkg/library/container/container.go pkg/library/container/container_test.go pkg/library/container/conversion.go pkg/library/container/mountSources.go pkg/library/defaults/helper.go pkg/library/env/workspaceenv.go pkg/library/env/workspaceenv_test.go pkg/library/flatten/common.go pkg/library/flatten/flatten.go pkg/library/flatten/flatten_test.go pkg/library/flatten/helper.go pkg/library/flatten/merge.go pkg/library/flatten/internal/testutil/common.go pkg/library/flatten/internal/testutil/http.go pkg/library/flatten/internal/testutil/k8sClient.go pkg/library/flatten/network/devfile.go pkg/library/flatten/network/fetch.go pkg/library/home/persistentHome.go pkg/library/home/persistentHome_test.go pkg/library/kubernetes/common_test.go pkg/library/kubernetes/deserialize.go pkg/library/kubernetes/deserialize_test.go pkg/library/kubernetes/provision.go pkg/library/kubernetes/provision_test.go pkg/library/kubernetes/util.go pkg/library/lifecycle/command.go pkg/library/lifecycle/common.go pkg/library/lifecycle/poststart.go pkg/library/lifecycle/poststart_test.go pkg/library/lifecycle/prestart.go pkg/library/lifecycle/prestart_test.go pkg/library/lifecycle/prestop.go pkg/library/lifecycle/prestop_test.go pkg/library/lifecycle/util.go pkg/library/overrides/containers.go pkg/library/overrides/containers_test.go pkg/library/overrides/pods.go pkg/library/overrides/pods_test.go pkg/library/projects/clone.go pkg/library/resources/helper.go pkg/library/resources/helper_test.go pkg/library/status/check.go pkg/provision/automount/common.go pkg/provision/automount/common_test.go pkg/provision/automount/configmap.go pkg/provision/automount/gitconfig.go pkg/provision/automount/gitconfig_test.go pkg/provision/automount/projected.go pkg/provision/automount/projected_test.go pkg/provision/automount/pvcs.go pkg/provision/automount/secret.go pkg/provision/automount/templates.go pkg/provision/config/config.go pkg/provision/metadata/envvar.go pkg/provision/metadata/metadata.go pkg/provision/storage/asyncStorage.go pkg/provision/storage/cleanup.go pkg/provision/storage/commonStorage.go pkg/provision/storage/commonStorage_test.go pkg/provision/storage/doc.go pkg/provision/storage/ephemeralStorage.go pkg/provision/storage/ephemeralStorage_test.go pkg/provision/storage/perWorkspaceStorage.go pkg/provision/storage/perWorkspaceStorage_test.go pkg/provision/storage/provisioner.go pkg/provision/storage/shared.go pkg/provision/storage/asyncstorage/cleanup.go pkg/provision/storage/asyncstorage/configmap.go pkg/provision/storage/asyncstorage/configuration.go pkg/provision/storage/asyncstorage/constants.go pkg/provision/storage/asyncstorage/deployment.go pkg/provision/storage/asyncstorage/errors.go pkg/provision/storage/asyncstorage/secret.go pkg/provision/storage/asyncstorage/service.go pkg/provision/storage/asyncstorage/sidecar.go pkg/provision/storage/asyncstorage/ssh.go pkg/provision/storage/asyncstorage/volume.go pkg/provision/sync/cluster_api.go pkg/provision/sync/diff.go pkg/provision/sync/diffopts.go pkg/provision/sync/sync.go pkg/provision/sync/update.go pkg/provision/workspace/deployment.go pkg/provision/workspace/pull_secret.go pkg/provision/workspace/routing.go pkg/provision/workspace/serviceaccount.go pkg/provision/workspace/tokens.go pkg/provision/workspace/tokens_test.go pkg/provision/workspace/rbac/common.go pkg/provision/workspace/rbac/common_test.go pkg/provision/workspace/rbac/finalize.go pkg/provision/workspace/rbac/finalize_test.go pkg/provision/workspace/rbac/migrate.go pkg/provision/workspace/rbac/migrate_test.go pkg/provision/workspace/rbac/role.go pkg/provision/workspace/rbac/role_test.go pkg/provision/workspace/rbac/rolebinding.go pkg/provision/workspace/rbac/rolebinding_test.go pkg/webhook/cluster_role_bindings.go pkg/webhook/cluster_roles.go pkg/webhook/create.go pkg/webhook/deployment.go pkg/webhook/info.go pkg/webhook/init_cfg.go pkg/webhook/service_account.go pkg/webhook/kubernetes/tls.go pkg/webhook/openshift/tls.go pkg/webhook/service/log.go pkg/webhook/service/service.go project-clone/main.go project-clone/internal/devfile.go project-clone/internal/global.go project-clone/internal/utils.go project-clone/internal/bootstrap/bootstrap.go project-clone/internal/bootstrap/cluster.go project-clone/internal/bootstrap/util.go project-clone/internal/git/operations.go project-clone/internal/git/setup.go project-clone/internal/shell/execute.go project-clone/internal/zip/setup.go test/e2e/cmd/workspaces_test.go test/e2e/pkg/client/client.go test/e2e/pkg/client/devws.go test/e2e/pkg/client/namespace.go test/e2e/pkg/client/oc.go test/e2e/pkg/client/pod.go test/e2e/pkg/client/rbac.go test/e2e/pkg/client/webhooks.go test/e2e/pkg/config/config.go test/e2e/pkg/metadata/metadata.go test/e2e/pkg/tests/devworkspaces_tests.go version/version.go webhook/main.go webhook/server/server.go webhook/workspace/config.go webhook/workspace/log.go webhook/workspace/mutate.go webhook/workspace/mutating_cfg.go webhook/workspace/validate.go webhook/workspace/validating_cfg.go webhook/workspace/handler/access_control.go webhook/workspace/handler/attributes.go webhook/workspace/handler/deployment.go webhook/workspace/handler/exec.go webhook/workspace/handler/handler.go webhook/workspace/handler/immutable.go webhook/workspace/handler/kind.go webhook/workspace/handler/kubernetes.go webhook/workspace/handler/log.go webhook/workspace/handler/metadata.go webhook/workspace/handler/pod.go webhook/workspace/handler/template.go webhook/workspace/handler/validate.go webhook/workspace/handler/warning.go webhook/workspace/handler/warning_test.go webhook/workspace/handler/workspace.go
go: downloading github.com/stretchr/testify v1.8.4
go: downloading github.com/pmezard/go-difflib v1.0.0
/usr/local/bin/yq
Patched containers in CRD deploy/templates/crd/bases/controller.devfile.io_devworkspaceroutings.yaml
Patched initContainers in CRD deploy/templates/crd/bases/controller.devfile.io_devworkspaceroutings.yaml
go: downloading sigs.k8s.io/controller-runtime v0.17.2
go: downloading sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20240320141353-395cfc7486e6
go: downloading go.uber.org/zap v1.26.0
go: downloading github.com/go-logr/zapr v1.2.4
go: downloading github.com/spf13/afero v1.6.0
go: downloading golang.org/x/text v0.12.0
go: downloading go.uber.org/multierr v1.10.0
?       github.com/devfile/devworkspace-operator        [no test files]
?       github.com/devfile/devworkspace-operator/apis/controller/v1alpha1       [no test files]
?       github.com/devfile/devworkspace-operator/controllers/controller/devworkspacerouting/conversion  [no test files]
?       github.com/devfile/devworkspace-operator/controllers/workspace/internal/testutil        [no test files]
?       github.com/devfile/devworkspace-operator/controllers/workspace/metrics  [no test files]
?       github.com/devfile/devworkspace-operator/internal/images        [no test files]
?       github.com/devfile/devworkspace-operator/internal/map   [no test files]
?       github.com/devfile/devworkspace-operator/pkg/cache      [no test files]
?       github.com/devfile/devworkspace-operator/pkg/common     [no test files]
?       github.com/devfile/devworkspace-operator/pkg/conditions [no test files]
?       github.com/devfile/devworkspace-operator/pkg/config/configmap   [no test files]
?       github.com/devfile/devworkspace-operator/pkg/constants  [no test files]
?       github.com/devfile/devworkspace-operator/pkg/dwerrors   [no test files]
?       github.com/devfile/devworkspace-operator/pkg/infrastructure     [no test files]
?       github.com/devfile/devworkspace-operator/pkg/library/annotate   [no test files]
?       github.com/devfile/devworkspace-operator/pkg/library/constants  [no test files]
?       github.com/devfile/devworkspace-operator/pkg/library/defaults   [no test files]
?       github.com/devfile/devworkspace-operator/pkg/library/flatten/internal/testutil  [no test files]
?       github.com/devfile/devworkspace-operator/pkg/library/flatten/network    [no test files]
?       github.com/devfile/devworkspace-operator/pkg/library/projects   [no test files]
?       github.com/devfile/devworkspace-operator/pkg/library/status     [no test files]
?       github.com/devfile/devworkspace-operator/pkg/provision/config   [no test files]
?       github.com/devfile/devworkspace-operator/pkg/provision/metadata [no test files]
?       github.com/devfile/devworkspace-operator/pkg/provision/storage/asyncstorage     [no test files]
?       github.com/devfile/devworkspace-operator/pkg/provision/sync     [no test files]
ok      github.com/devfile/devworkspace-operator/controllers/controller/devworkspacerouting     12.775s coverage: 63.4% of statements
ok      github.com/devfile/devworkspace-operator/controllers/controller/devworkspacerouting/solvers     0.031s      coverage: 12.0% of statements
Running Suite: DevWorkspace Controller Suite - /projects/devworkspace-operator/controllers/workspace
====================================================================================================
Random Seed: 1711051840

Will run 23 of 23 specs
------------------------------
[BeforeSuite] [FAILED] [6.884 seconds]
[BeforeSuite] 
/projects/devworkspace-operator/controllers/workspace/suite_test.go:78

  Timeline >>
  STEP: setting up controller environment @ 03/21/24 20:10:40.649
  STEP: bootstrapping test environment @ 03/21/24 20:10:40.656
  2024-03-21T20:10:40Z  DEBUG   controller-runtime.test-env     starting control plane
  2024-03-21T20:10:46Z  DEBUG   controller-runtime.test-env     installing CRDs
  2024-03-21T20:10:46Z  DEBUG   controller-runtime.test-env     reading CRDs from path  {"path": "../../deploy/templates/crd/bases"}
  2024-03-21T20:10:46Z  DEBUG   controller-runtime.test-env     read CRDs from file     {"file": "controller.devfile.io_devworkspaceoperatorconfigs.yaml"}
  2024-03-21T20:10:46Z  DEBUG   controller-runtime.test-env     read CRDs from file     {"file": "controller.devfile.io_devworkspaceroutings.yaml"}
  2024-03-21T20:10:46Z  DEBUG   controller-runtime.test-env     installing CRD  {"crd": "devworkspaceroutings.controller.devfile.io"}
  2024-03-21T20:10:46Z  DEBUG   controller-runtime.test-env     installing CRD  {"crd": "devworkspaceoperatorconfigs.controller.devfile.io"}
  2024-03-21T20:10:46Z  DEBUG   controller-runtime.test-env     adding API in waitlist  {"GV": "controller.devfile.io/v1alpha1"}
  2024-03-21T20:10:46Z  DEBUG   controller-runtime.test-env     adding API in waitlist  {"GV": "controller.devfile.io/v1alpha1"}
  2024-03-21T20:10:47Z  DEBUG   controller-runtime.test-env     installing webhooks
  2024-03-21T20:10:47Z  INFO    controller-runtime.metrics      Metrics server is starting to listen    {"addr": ":8080"}
  2024-03-21T20:10:47Z  ERROR   controller-runtime.metrics      metrics server failed to listen. You may want to disable the metrics server or use another port if it is due to conflicts   {"error": "error listening on :8080: listen tcp :8080: bind: address already in use"}
  sigs.k8s.io/controller-runtime/pkg/metrics.NewListener
        /home/user/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/metrics/listener.go:48
  sigs.k8s.io/controller-runtime/pkg/manager.New
        /home/user/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/manager/manager.go:415
  github.com/devfile/devworkspace-operator/controllers/workspace_test.glob..func2
        /projects/devworkspace-operator/controllers/workspace/suite_test.go:118
  github.com/onsi/ginkgo/v2/internal.extractBodyFunction.func3
        /home/user/go/pkg/mod/github.com/onsi/ginkgo/[email protected]/internal/node.go:463
  github.com/onsi/ginkgo/v2/internal.(*Suite).runNode.func3
        /home/user/go/pkg/mod/github.com/onsi/ginkgo/[email protected]/internal/suite.go:865
  [FAILED] in [BeforeSuite] - /projects/devworkspace-operator/controllers/workspace/suite_test.go:123 @ 03/21/24 20:10:47.533
  << Timeline

  [FAILED] Unexpected error:
      <*fmt.wrapError | 0xc000d4b080>: 
      error listening on :8080: listen tcp :8080: bind: address already in use
      {
          msg: "error listening on :8080: listen tcp :8080: bind: address already in use",
          err: <*net.OpError | 0xc000d49e00>{
              Op: "listen",
              Net: "tcp",
              Source: nil,
              Addr: <*net.TCPAddr | 0xc000d6b020>{IP: nil, Port: 8080, Zone: ""},
              Err: <*os.SyscallError | 0xc000d4b060>{
                  Syscall: "bind",
                  Err: <syscall.Errno>0x62,
              },
          },
      }
  occurred
  In [BeforeSuite] at: /projects/devworkspace-operator/controllers/workspace/suite_test.go:123 @ 03/21/24 20:10:47.533
------------------------------

Summarizing 1 Failure:
  [FAIL] [BeforeSuite] 
  /projects/devworkspace-operator/controllers/workspace/suite_test.go:123

Ran 0 of 23 Specs in 7.974 seconds
FAIL! -- A BeforeSuite node failed so all tests were skipped.
--- FAIL: TestAPIs (7.98s)
FAIL
        github.com/devfile/devworkspace-operator/controllers/workspace  coverage: 0.0% of statements
FAIL    github.com/devfile/devworkspace-operator/controllers/workspace  8.019s
--- FAIL: TestMigrateConfigErrorWhenConfigAndConfigMapPresent (0.00s)
    migrate_test.go:68: 
                Error Trace:    /projects/devworkspace-operator/pkg/config/migrate_test.go:68
                Error:          An error is expected but got nil.
                Test:           TestMigrateConfigErrorWhenConfigAndConfigMapPresent
                Messages:       Should return error
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
        panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x14afbd3]

goroutine 11 [running]:
testing.tRunner.func1.2({0x15e5820, 0x26ad7d0})
        /usr/lib/golang/src/testing/testing.go:1526 +0x24e
testing.tRunner.func1()
        /usr/lib/golang/src/testing/testing.go:1529 +0x39f
panic({0x15e5820, 0x26ad7d0})
        /usr/lib/golang/src/runtime/panic.go:884 +0x213
github.com/devfile/devworkspace-operator/pkg/config.TestMigrateConfigErrorWhenConfigAndConfigMapPresent(0x40c5d9?)
        /projects/devworkspace-operator/pkg/config/migrate_test.go:69 +0x393
testing.tRunner(0xc000583860, 0x18a3270)
        /usr/lib/golang/src/testing/testing.go:1576 +0x10b
created by testing.(*T).Run
        /usr/lib/golang/src/testing/testing.go:1629 +0x3ea
FAIL    github.com/devfile/devworkspace-operator/pkg/config     0.040s
ok      github.com/devfile/devworkspace-operator/pkg/config/proxy       0.027s  coverage: 68.4% of statements
ok      github.com/devfile/devworkspace-operator/pkg/library/container  0.065s  coverage: 78.1% of statements
ok      github.com/devfile/devworkspace-operator/pkg/library/env        0.013s  coverage: 36.2% of statements
ok      github.com/devfile/devworkspace-operator/pkg/library/flatten    1.724s  coverage: 89.0% of statements
ok      github.com/devfile/devworkspace-operator/pkg/library/home       0.029s  coverage: 96.0% of statements
ok      github.com/devfile/devworkspace-operator/pkg/library/kubernetes 0.059s  coverage: 90.2% of statements
ok      github.com/devfile/devworkspace-operator/pkg/library/lifecycle  0.019s  coverage: 93.1% of statements
ok      github.com/devfile/devworkspace-operator/pkg/library/overrides  0.036s  coverage: 78.8% of statements
ok      github.com/devfile/devworkspace-operator/pkg/library/resources  0.011s  coverage: 99.0% of statements
ok      github.com/devfile/devworkspace-operator/pkg/provision/automount        0.210s  coverage: 80.8% of statements
ok      github.com/devfile/devworkspace-operator/pkg/provision/storage  0.057s  coverage: 43.5% of statements
ok      github.com/devfile/devworkspace-operator/pkg/provision/workspace        0.031s  coverage: 16.0% of statements
?       github.com/devfile/devworkspace-operator/pkg/webhook    [no test files]
?       github.com/devfile/devworkspace-operator/pkg/webhook/kubernetes [no test files]
?       github.com/devfile/devworkspace-operator/pkg/webhook/openshift  [no test files]
?       github.com/devfile/devworkspace-operator/pkg/webhook/service    [no test files]
?       github.com/devfile/devworkspace-operator/project-clone  [no test files]
?       github.com/devfile/devworkspace-operator/project-clone/internal [no test files]
?       github.com/devfile/devworkspace-operator/project-clone/internal/bootstrap       [no test files]
?       github.com/devfile/devworkspace-operator/project-clone/internal/git     [no test files]
?       github.com/devfile/devworkspace-operator/project-clone/internal/shell   [no test files]
?       github.com/devfile/devworkspace-operator/project-clone/internal/zip     [no test files]
?       github.com/devfile/devworkspace-operator/version        [no test files]
ok      github.com/devfile/devworkspace-operator/pkg/provision/workspace/rbac   0.055s  coverage: 91.0% of statements
?       github.com/devfile/devworkspace-operator/webhook        [no test files]
?       github.com/devfile/devworkspace-operator/webhook/server [no test files]
?       github.com/devfile/devworkspace-operator/webhook/workspace      [no test files]
ok      github.com/devfile/devworkspace-operator/webhook/workspace/handler      0.023s  coverage: 10.8% of statements
FAIL
make: *** [Makefile:104: test] Error 1

Expected behavior

The test suite should succeed when make test is run. Ideally, we should probably just download ginkgo and not run the test suitei if the ginkgo CLI is not installed.

Additional context

Thanks to @mkuznyetsov for finding this bug :)

@AObuchow AObuchow self-assigned this Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant