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

Add "pretty" library for testing #2122

Merged
merged 2 commits into from Sep 19, 2019

Conversation

@cdrage
Copy link
Collaborator

commented Sep 12, 2019

Adds the "pretty" library for easier debugging.

See below:

--- FAIL: TestListWithDetailedStatus (0.00s)
    service_test.go:482:  [
          {
           TypeMeta: {
            Kind: "Service",
            APIVersion: "odo.openshift.io/v1alpha1",
           },
           ObjectMeta: {
            Name: "mysql-persistent",
            GenerateName: "",
            Namespace: "",
            SelfLink: "",
            UID: "",
            ResourceVersion: "",
            Generation: 0,
            CreationTimestamp: {
             Time: 0001-01-01 00:00:00 +0000 UTC,
            },
            DeletionTimestamp: nil,
            DeletionGracePeriodSeconds: nil,
            Labels: {
            },
            Annotations: {
            },
            OwnerReferences: [
            ],
            Initializers: nil,
            Finalizers: [
            ],
            ClusterName: "",
           },
           Spec: {
            Type: "mysql-persistent",
            Plan: "default",
           },
           Status: {
        -   Status: "ProvisionedSuccessfully",
        +   Status: "ProvisionedAndLinked",
           },

Vs:

--- FAIL: TestListWithDetailedStatus (0.00s)
    service_test.go:481: expected output: []service.Service{service.Service{TypeMeta:v1.TypeMeta{Kind:"Service", APIVersion:"odo.openshift.io/v1alpha1"}, ObjectMeta:v1.ObjectMeta{Name:"mysql-persistent", GenerateName:"", Namespace:"", SelfLink:"", UID:"", ResourceVersion:"", Generation:0, CreationTimestamp:v1.Time{Time:time.Time{wall:0x0, ext:0, loc:(*time.Locati
on)(nil)}}, DeletionTimestamp:(*v1.Time)(nil), DeletionGracePeriodSeconds:(*int64)(nil), Labels:map[string]string(nil), Annotations:map[string]string(nil), OwnerReferences:[]v1.OwnerReference(nil), Initializers:(*v1.Initializers)(nil), Finalizers:[]string(nil), ClusterName:""}, Spec:service.ServiceSpec{Type:"mysql-persistent", Plan:"default"}, Status:service.Serv
iceStatus{Status:"ProvisionedSuccessfully"}}, service.Service{TypeMeta:v1.TypeMeta{Kind:"Service", APIVersion:"odo.openshift.io/v1alpha1"}, ObjectMeta:v1.ObjectMeta{Name:"postgresql-ephemeral", GenerateName:"", Namespace:"", SelfLink:"", UID:"", ResourceVersion:"", Generation:0, CreationTimestamp:v1.Time{Time:time.Time{wall:0x0, ext:0, loc:(*time.Location)(nil)}}
, DeletionTimestamp:(*v1.Time)(nil), DeletionGracePeriodSeconds:(*int64)(nil), Labels:map[string]string(nil), Annotations:map[string]string(nil), OwnerReferences:[]v1.OwnerReference(nil), Initializers:(*v1.Initializers)(nil), Finalizers:[]string(nil), ClusterName:""}, Spec:service.ServiceSpec{Type:"postgresql-ephemeral", Plan:"default"}, Status:service.ServiceSta
tus{Status:"ProvisionedSuccessfully"}}, service.Service{TypeMeta:v1.TypeMeta{Kind:"Service", APIVersion:"odo.openshift.io/v1alpha1"}, ObjectMeta:v1.ObjectMeta{Name:"mongodb", GenerateName:"", Namespace:"", SelfLink:"", UID:"", ResourceVersion:"", Generation:0, CreationTimestamp:v1.Time{Time:time.Time{wall:0x0, ext:0, loc:(*time.Location)(nil)}}, DeletionTimestamp
:(*v1.Time)(nil), DeletionGracePeriodSeconds:(*int64)(nil), Labels:map[string]string(nil), Annotations:map[string]string(nil), OwnerReferences:[]v1.OwnerReference(nil), Initializers:(*v1.Initializers)(nil), Finalizers:[]string(nil), ClusterName:""}, Spec:service.ServiceSpec{Type:"mongodb", Plan:"default"}, Status:service.ServiceStatus{Status:"ProvisionedSuccessfu
lly"}}, service.Service{TypeMeta:v1.TypeMeta{Kind:"Service", APIVersion:"odo.openshift.io/v1alpha1"}, ObjectMeta:v1.ObjectMeta{Name:"jenkins-persistent", GenerateName:"", Namespace:"", SelfLink:"", UID:"", ResourceVersion:"", Generation:0, CreationTimestamp:v1.Time{Time:time.Time{wall:0x0, ext:0, loc:(*time.Location)(nil)}}, DeletionTimestamp:(*v1.Time)(nil), Del
etionGracePeriodSeconds:(*int64)(nil), Labels:map[string]string(nil), Annotations:map[string]string(nil), OwnerReferences:[]v1.OwnerReference(nil), Initializers:(*v1.Initializers)(nil), Finalizers:[]string(nil), ClusterName:""}, Spec:service.ServiceSpec{Type:"jenkins-persistent", Plan:"default"}, Status:service.ServiceStatus{Status:"Provisioning"}}},got: []servic
e.Service{service.Service{TypeMeta:v1.TypeMeta{Kind:"Service", APIVersion:"odo.openshift.io/v1alpha1"}, ObjectMeta:v1.ObjectMeta{Name:"mysql-persistent", GenerateName:"", Namespace:"", SelfLink:"", UID:"", ResourceVersion:"", Generation:0, CreationTimestamp:v1.Time{Time:time.Time{wall:0x0, ext:0, loc:(*time.Location)(nil)}}, DeletionTimestamp:(*v1.Time)(nil), Del
etionGracePeriodSeconds:(*int64)(nil), Labels:map[string]string(nil), Annotations:map[string]string(nil), OwnerReferences:[]v1.OwnerReference(nil), Initializers:(*v1.Initializers)(nil), Finalizers:[]string(nil), ClusterName:""}, Spec:service.ServiceSpec{Type:"mysql-persistent", Plan:"default"}, Status:service.ServiceStatus{Status:"ProvisionedAndLinked"}}, service
.Service{TypeMeta:v1.TypeMeta{Kind:"Service", APIVersion:"odo.openshift.io/v1alpha1"}, ObjectMeta:v1.ObjectMeta{Name:"postgresql-ephemeral", GenerateName:"", Namespace:"", SelfLink:"", UID:"", ResourceVersion:"", Generation:0, CreationTimestamp:v1.Time{Time:time.Time{wall:0x0, ext:0, loc:(*time.Location)(nil)}}, DeletionTimestamp:(*v1.Time)(nil), DeletionGracePer
iodSeconds:(*int64)(nil), Labels:map[string]string(nil), Annotations:map[string]string(nil), OwnerReferences:[]v1.OwnerReference(nil), Initializers:(*v1.Initializers)(nil), Finalizers:[]string(nil), ClusterName:""}, Spec:service.ServiceSpec{Type:"postgresql-ephemeral", Plan:"default"}, Status:service.ServiceStatus{Status:"ProvisionedAndBound"}}, service.Service{T
ypeMeta:v1.TypeMeta{Kind:"Service", APIVersion:"odo.openshift.io/v1alpha1"}, ObjectMeta:v1.ObjectMeta{Name:"mongodb", GenerateName:"", Namespace:"", SelfLink:"", UID:"", ResourceVersion:"", Generation:0, CreationTimestamp:v1.Time{Time:time.Time{wall:0x0, ext:0, loc:(*time.Location)(nil)}}, DeletionTimestamp:(*v1.Time)(nil), DeletionGracePeriodSeconds:(*int64)(nil
), Labels:map[string]string(nil), Annotations:map[string]string(nil), OwnerReferences:[]v1.OwnerReference(nil), Initializers:(*v1.Initializers)(nil), Finalizers:[]string(nil), ClusterName:""}, Spec:service.ServiceSpec{Type:"mongodb", Plan:"default"}, Status:service.ServiceStatus{Status:"ProvisionedSuccessfully"}}, service.Service{TypeMeta:v1.TypeMeta{Kind:"Servic
e", APIVersion:"odo.openshift.io/v1alpha1"}, ObjectMeta:v1.ObjectMeta{Name:"jenkins-persistent", GenerateName:"", Namespace:"", SelfLink:"", UID:"", ResourceVersion:"", Generation:0, CreationTimestamp:v1.Time{Time:time.Time{wall:0x0, ext:0, loc:(*time.Location)(nil)}}, DeletionTimestamp:(*v1.Time)(nil), DeletionGracePeriodSeconds:(*int64)(nil), Labels:map[string]
string(nil), Annotations:map[string]string(nil), OwnerReferences:[]v1.OwnerReference(nil), Initializers:(*v1.Initializers)(nil), Finalizers:[]string(nil), ClusterName:""}, Spec:service.ServiceSpec{Type:"jenkins-persistent", Plan:"default"}, Status:service.ServiceStatus{Status:"Provisioning"}}}

Closes: #2120

version: origin-3.11-kubernetes-1.11.1
repo: https://github.com/openshift/kubernetes-api.git

This comment has been minimized.

Copy link
@cdrage

cdrage Sep 12, 2019

Author Collaborator

No idea what happened here, this above was done by glide itself.

@@ -57,3 +57,8 @@ import:
version: efa589957cd060542a26d2dd7832fd6a6c6c3ade
- package: github.com/Benjamintf1/unmarshalledmatchers
version: bb1c1f34eaeac620307d94a2371c514fbaf6ec7f
- package: github.com/apcera/gssapi
version: release-2.6.3
repo: https://github.com/openshift/gssapi.git

This comment has been minimized.

Copy link
@cdrage

cdrage Sep 12, 2019

Author Collaborator

This fixed the issue with entering your "credentials" for gssapi @kadel

@cdrage

This comment has been minimized.

Copy link
Collaborator Author

commented Sep 16, 2019

/retest all

@kadel

This comment has been minimized.

Copy link
Member

commented Sep 17, 2019

/retest

[oc] 'Running oc with args [oc get is java -n openshift -o jsonpath='{range .spec.tags[*]}{.name}{"\n"}{end}']
[oc] '8
[oc] latest
[oc] 'Running oc with args [oc --request-timeout 5m import-image java:8 --namespace=wdjfwaeark --from=registry.access.redhat.com/redhat-openjdk-18/openjdk18-openshift:1.5 --confirm]
[oc] error: tag 1.5 failed: Internal error occurred: received unexpected HTTP status: 503 Service Unavailable
[oc] imagestream.image.openshift.io/java imported with errors
[oc] 
[oc] Name:			java
[oc] Namespace:		wdjfwaeark
[oc] Created:		Less than a second ago
[oc] Labels:			<none>
[oc] Annotations:		openshift.io/image.dockerRepositoryCheck=2019-09-12T18:35:30Z
[oc] Image Repository:	image-registry.openshift-image-registry.svc:5000/wdjfwaeark/java
[oc] Image Lookup:		local=false
[oc] Unique Images:		0
[oc] Tags:			1
[oc] 
[oc] 8
[oc]   tagged from registry.access.redhat.com/redhat-openjdk-18/openjdk18-openshift:1.5
[oc] 
[oc]   ! error: Import failed (InternalError): Internal error occurred: received unexpected HTTP status: 503 Service Unavailable
[oc]       Less than a second ago
[oc] 
[oc] 
Copy link
Collaborator

left a comment

glide.yaml looks pretty different, no? Does the changing of order have any impact? I don't have much idea about Go's dependency tools. I'd LGTM if this looks good to, say, @kadel or @girishramnani

@cdrage

This comment has been minimized.

Copy link
Collaborator Author

commented Sep 18, 2019

@dharmit
Yeah, order doesn't matter :)

cdrage added 2 commits Sep 12, 2019
Adds the "pretty" library for easier debugging.

See below:

```sh
--- FAIL: TestListWithDetailedStatus (0.00s)
    service_test.go:482:  [
          {
           TypeMeta: {
            Kind: "Service",
            APIVersion: "odo.openshift.io/v1alpha1",
           },
           ObjectMeta: {
            Name: "mysql-persistent",
            GenerateName: "",
            Namespace: "",
            SelfLink: "",
            UID: "",
            ResourceVersion: "",
            Generation: 0,
            CreationTimestamp: {
             Time: 0001-01-01 00:00:00 +0000 UTC,
            },
            DeletionTimestamp: nil,
            DeletionGracePeriodSeconds: nil,
            Labels: {
            },
            Annotations: {
            },
            OwnerReferences: [
            ],
            Initializers: nil,
            Finalizers: [
            ],
            ClusterName: "",
           },
           Spec: {
            Type: "mysql-persistent",
            Plan: "default",
           },
           Status: {
        -   Status: "ProvisionedSuccessfully",
        +   Status: "ProvisionedAndLinked",
           },
```

Vs:

```
--- FAIL: TestListWithDetailedStatus (0.00s)
    service_test.go:481: expected output: []service.Service{service.Service{TypeMeta:v1.TypeMeta{Kind:"Service", APIVersion:"odo.openshift.io/v1alpha1"}, ObjectMeta:v1.ObjectMeta{Name:"mysql-persistent", GenerateName:"", Namespace:"", SelfLink:"", UID:"", ResourceVersion:"", Generation:0, CreationTimestamp:v1.Time{Time:time.Time{wall:0x0, ext:0, loc:(*time.Locati
on)(nil)}}, DeletionTimestamp:(*v1.Time)(nil), DeletionGracePeriodSeconds:(*int64)(nil), Labels:map[string]string(nil), Annotations:map[string]string(nil), OwnerReferences:[]v1.OwnerReference(nil), Initializers:(*v1.Initializers)(nil), Finalizers:[]string(nil), ClusterName:""}, Spec:service.ServiceSpec{Type:"mysql-persistent", Plan:"default"}, Status:service.Serv
iceStatus{Status:"ProvisionedSuccessfully"}}, service.Service{TypeMeta:v1.TypeMeta{Kind:"Service", APIVersion:"odo.openshift.io/v1alpha1"}, ObjectMeta:v1.ObjectMeta{Name:"postgresql-ephemeral", GenerateName:"", Namespace:"", SelfLink:"", UID:"", ResourceVersion:"", Generation:0, CreationTimestamp:v1.Time{Time:time.Time{wall:0x0, ext:0, loc:(*time.Location)(nil)}}
, DeletionTimestamp:(*v1.Time)(nil), DeletionGracePeriodSeconds:(*int64)(nil), Labels:map[string]string(nil), Annotations:map[string]string(nil), OwnerReferences:[]v1.OwnerReference(nil), Initializers:(*v1.Initializers)(nil), Finalizers:[]string(nil), ClusterName:""}, Spec:service.ServiceSpec{Type:"postgresql-ephemeral", Plan:"default"}, Status:service.ServiceSta
tus{Status:"ProvisionedSuccessfully"}}, service.Service{TypeMeta:v1.TypeMeta{Kind:"Service", APIVersion:"odo.openshift.io/v1alpha1"}, ObjectMeta:v1.ObjectMeta{Name:"mongodb", GenerateName:"", Namespace:"", SelfLink:"", UID:"", ResourceVersion:"", Generation:0, CreationTimestamp:v1.Time{Time:time.Time{wall:0x0, ext:0, loc:(*time.Location)(nil)}}, DeletionTimestamp
:(*v1.Time)(nil), DeletionGracePeriodSeconds:(*int64)(nil), Labels:map[string]string(nil), Annotations:map[string]string(nil), OwnerReferences:[]v1.OwnerReference(nil), Initializers:(*v1.Initializers)(nil), Finalizers:[]string(nil), ClusterName:""}, Spec:service.ServiceSpec{Type:"mongodb", Plan:"default"}, Status:service.ServiceStatus{Status:"ProvisionedSuccessfu
lly"}}, service.Service{TypeMeta:v1.TypeMeta{Kind:"Service", APIVersion:"odo.openshift.io/v1alpha1"}, ObjectMeta:v1.ObjectMeta{Name:"jenkins-persistent", GenerateName:"", Namespace:"", SelfLink:"", UID:"", ResourceVersion:"", Generation:0, CreationTimestamp:v1.Time{Time:time.Time{wall:0x0, ext:0, loc:(*time.Location)(nil)}}, DeletionTimestamp:(*v1.Time)(nil), Del
etionGracePeriodSeconds:(*int64)(nil), Labels:map[string]string(nil), Annotations:map[string]string(nil), OwnerReferences:[]v1.OwnerReference(nil), Initializers:(*v1.Initializers)(nil), Finalizers:[]string(nil), ClusterName:""}, Spec:service.ServiceSpec{Type:"jenkins-persistent", Plan:"default"}, Status:service.ServiceStatus{Status:"Provisioning"}}},got: []servic
e.Service{service.Service{TypeMeta:v1.TypeMeta{Kind:"Service", APIVersion:"odo.openshift.io/v1alpha1"}, ObjectMeta:v1.ObjectMeta{Name:"mysql-persistent", GenerateName:"", Namespace:"", SelfLink:"", UID:"", ResourceVersion:"", Generation:0, CreationTimestamp:v1.Time{Time:time.Time{wall:0x0, ext:0, loc:(*time.Location)(nil)}}, DeletionTimestamp:(*v1.Time)(nil), Del
etionGracePeriodSeconds:(*int64)(nil), Labels:map[string]string(nil), Annotations:map[string]string(nil), OwnerReferences:[]v1.OwnerReference(nil), Initializers:(*v1.Initializers)(nil), Finalizers:[]string(nil), ClusterName:""}, Spec:service.ServiceSpec{Type:"mysql-persistent", Plan:"default"}, Status:service.ServiceStatus{Status:"ProvisionedAndLinked"}}, service
.Service{TypeMeta:v1.TypeMeta{Kind:"Service", APIVersion:"odo.openshift.io/v1alpha1"}, ObjectMeta:v1.ObjectMeta{Name:"postgresql-ephemeral", GenerateName:"", Namespace:"", SelfLink:"", UID:"", ResourceVersion:"", Generation:0, CreationTimestamp:v1.Time{Time:time.Time{wall:0x0, ext:0, loc:(*time.Location)(nil)}}, DeletionTimestamp:(*v1.Time)(nil), DeletionGracePer
iodSeconds:(*int64)(nil), Labels:map[string]string(nil), Annotations:map[string]string(nil), OwnerReferences:[]v1.OwnerReference(nil), Initializers:(*v1.Initializers)(nil), Finalizers:[]string(nil), ClusterName:""}, Spec:service.ServiceSpec{Type:"postgresql-ephemeral", Plan:"default"}, Status:service.ServiceStatus{Status:"ProvisionedAndBound"}}, service.Service{T
ypeMeta:v1.TypeMeta{Kind:"Service", APIVersion:"odo.openshift.io/v1alpha1"}, ObjectMeta:v1.ObjectMeta{Name:"mongodb", GenerateName:"", Namespace:"", SelfLink:"", UID:"", ResourceVersion:"", Generation:0, CreationTimestamp:v1.Time{Time:time.Time{wall:0x0, ext:0, loc:(*time.Location)(nil)}}, DeletionTimestamp:(*v1.Time)(nil), DeletionGracePeriodSeconds:(*int64)(nil
), Labels:map[string]string(nil), Annotations:map[string]string(nil), OwnerReferences:[]v1.OwnerReference(nil), Initializers:(*v1.Initializers)(nil), Finalizers:[]string(nil), ClusterName:""}, Spec:service.ServiceSpec{Type:"mongodb", Plan:"default"}, Status:service.ServiceStatus{Status:"ProvisionedSuccessfully"}}, service.Service{TypeMeta:v1.TypeMeta{Kind:"Servic
e", APIVersion:"odo.openshift.io/v1alpha1"}, ObjectMeta:v1.ObjectMeta{Name:"jenkins-persistent", GenerateName:"", Namespace:"", SelfLink:"", UID:"", ResourceVersion:"", Generation:0, CreationTimestamp:v1.Time{Time:time.Time{wall:0x0, ext:0, loc:(*time.Location)(nil)}}, DeletionTimestamp:(*v1.Time)(nil), DeletionGracePeriodSeconds:(*int64)(nil), Labels:map[string]
string(nil), Annotations:map[string]string(nil), OwnerReferences:[]v1.OwnerReference(nil), Initializers:(*v1.Initializers)(nil), Finalizers:[]string(nil), ClusterName:""}, Spec:service.ServiceSpec{Type:"jenkins-persistent", Plan:"default"}, Status:service.ServiceStatus{Status:"Provisioning"}}}
```

Closes: #2120
@cdrage cdrage force-pushed the cdrage:add-pretty branch from 4f33cbe to 50dba03 Sep 18, 2019
@cdrage

This comment has been minimized.

Copy link
Collaborator Author

commented Sep 18, 2019

Rebased, up for another review 👍

@kadel

This comment has been minimized.

Copy link
Member

commented Sep 19, 2019

/approve

@openshift-ci-robot

This comment has been minimized.

Copy link

commented Sep 19, 2019

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kadel

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@dharmit

This comment has been minimized.

Copy link
Collaborator

commented Sep 19, 2019

/lgtm

@openshift-bot

This comment has been minimized.

Copy link

commented Sep 19, 2019

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit 0956835 into openshift:master Sep 19, 2019
8 of 9 checks passed
8 of 9 checks passed
ci/prow/v4.2-e2e-scenarios Job triggered.
Details
Travis CI - Pull Request Build Passed
Details
ci/prow/v4.1-benchmark Job succeeded.
Details
ci/prow/v4.1-e2e-scenarios Job succeeded.
Details
ci/prow/v4.1-integration Job succeeded.
Details
ci/prow/v4.1-unit Job succeeded.
Details
ci/prow/v4.2-benchmark Job succeeded.
Details
ci/prow/v4.2-integration Job succeeded.
Details
tide In merge pool.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.