redhat-developer / odo

odo - Developer-focused CLI for fast & iterative container-based application development on Podman and Kubernetes. Implementation of the open Devfile standard.
https://odo.dev
Apache License 2.0
792 stars 244 forks source link

Test script fails due to path separator // in registry/directory on windows platform #3389

Closed prietyc123 closed 3 years ago

prietyc123 commented 4 years ago

/kind bug

What versions of software are you using?

Operating System: Win10

Output of odo version: master

How did you run odo exactly?

Ran make test-e2e-images on windows.

Actual behavior

> make test-e2e-images
[...]
SSSSSSSCreated dir: C:\Users\Admin\AppData\Local\Temp\108651876
Creating a new project: asigcqzcof
Running odo.exe with args [odo project create asigcqzcof -w -v4]
[odo]  -  Waiting for project to come up  ...
[odo] I0619 06:50:12.739836    3816 occlient.go:543] Status of creation of project asigcqzcof is Active
[odo] I0619 06:50:12.788612    3816 occlient.go:548] Project asigcqzcof now exists
[odo] I0619 06:50:12.827575    3816 occlient.go:583] Status of creation of service account &ServiceAccount{ObjectMeta:{default  asigcqzcof /api/v1/namespaces/asigcqzcof/serviceaccounts/default 10fa5fca-0585-4a1b-b823-a84cdc72fbf3 103419 0 2020-06-19 06:50:13 +0000 GMT <nil> <nil> map[] map[] [] []  []},Secrets:[]ObjectReference{ObjectReference{Kind:,Namespace:,Name:default-token-6289w,UID:,APIVersion:,ResourceVersion:,FieldPath:,},ObjectReference{Kind:,Namespace:,Name:default-dockercfg-qmhhx,UID:,APIVersion:,ResourceVersion:,FieldPath:,},},ImagePullSecrets:[]LocalObjectReference{LocalObjectReference{Name:default-dockercfg-qmhhx,},},AutomountServiceAccountToken:nil,} is ready
 V  Waiting for project to come up [808ms]
[odo]  V  Project 'asigcqzcof' is ready for use
[odo]  V  New project created and now using project: asigcqzcof
[odo] I0619 06:50:12.852064    3816 odo.go:72] Could not get the latest release information in time. Never mind, exiting gracefully :)

Running oc.exe with args [oc --request-timeout 5m import-image nodejs:latest --namespace=asigcqzcof 
--from=registry.access.redhat.com\rhscl\nodejs-8-rhel7:latest --confirm]

[oc] The ImageStreamImport "nodejs" is invalid: spec.images[0].from.name: Invalid value: 
"registry.access.redhat.com\\rhscl\\nodejs-8-rhel7:latest": invalid reference format

Deleting project: asigcqzcof
Running odo.exe with args [odo project delete asigcqzcof -f]
[odo] I0619 06:50:13.864599   10320 application.go:49] Unable to list Service Catalog instances: unable to list ServiceInstances: the server could not find 
the requested resource (get serviceinstances.servicecatalog.k8s.io)
[odo]  V  Deleted project : asigcqzcof
[odo]  !  Warning! Projects are deleted from the cluster asynchronously. Odo does its best to delete the project. Due to multi-tenant clusters, the project 
may still exist on a different node.
[odo] I0619 06:50:13.989486   10320 odo.go:72] Could not get the latest release information in time. Never mind, exiting gracefully :)
Deleting dir: C:\Users\Admin\AppData\Local\Temp\108651876
------------------------------
+ Failure [2.245 seconds]
odo supported images e2e tests
C:/Users/Admin/go/src/github.com/openshift/odo/tests/e2escenarios/e2e_images_test.go:14
  odo supported images deployment
  C:/Users/Admin/go/src/github.com/openshift/odo/tests/e2escenarios/e2e_images_test.go:83
    Should be able to verify the nodejs-8-rhel7 image [It]
    C:/Users/Admin/go/src/github.com/openshift/odo/tests/e2escenarios/e2e_images_test.go:94
    No future change is possible.  Bailing out early after 0.378s.
    Running oc.exe with args [oc --request-timeout 5m import-image nodejs:latest --namespace=asigcqzcof --from=registry.access.redhat.com\rhscl\nodejs-8-rhel7:latest --confirm]
    Expected
        <int>: 1
    to match exit code:
        <int>: 0
    C:/Users/Admin/go/src/github.com/openshift/odo/tests/helper/helper_run.go:34
------------------------------
[...]
SSS
Summarizing 8 Failures:
[Fail] odo supported images e2e tests odo supported images deployment [It] Should be able to verify the nodejs-8-rhel7 image 
C:/Users/Admin/go/src/github.com/openshift/odo/tests/helper/helper_run.go:34
[...]
Ran 8 of 23 Specs in 20.037 seconds
FAIL! -- 0 Passed | 8 Failed | 0 Pending | 15 Skipped
--- FAIL: TestE2eScenarios (20.52s)
FAIL

Failure : The ImageStreamImport "nodejs" is invalid: spec.images[0].from.name: Invalid value: "registry.access.redhat.com\rhscl\nodejs-8-rhel7:latest": invalid reference format

Expected behavior

Image import path should be registry.access.redhat.com\rhscl\nodejs-8-rhel7:latest

Any logs, error output, etc?

prietyc123 commented 4 years ago

/kind test

openshift-ci-robot commented 4 years ago

@prietyc123: The label(s) kind/test cannot be applied, because the repository doesn't have them

In response to [this](https://github.com/openshift/odo/issues/3389#issuecomment-658127381): >/kind test Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
prietyc123 commented 4 years ago

I have changes the priority to high because we have already set up our periodic job on PSI for fedora, windows and macOS. However the platform specific issues are acting as hindrance for the test run, so IMO its high time we fix these bugs or test script issues.

Assigning @anandrkskd for this.

anandrkskd commented 4 years ago

The test for e2e test creates image names and uses filepath.Join("string", "string:latest") , which creates an issue in case of tests running on Windows platform, as in case of Winodws filepath.Join("string", "string:latest") uses "\" to join the two strings and thus the correct image name is not generated.

https://github.com/openshift/odo/blob/aa28203096dd7c3b189734181494c1207fcb77c4/tests/e2escenarios/e2e_images_test.go#L109

To resolve this issue we will require tests to uses a custom function that uses "/" to join and create the expected image name.

This change is required on multiple location in the test for e2e-images to resolve this issue for Windows platform.