Skip to content

Commit

Permalink
kubernetes: Fix topology regression
Browse files Browse the repository at this point in the history
The version of kubernetes-object-describer in npm
is broken. It is missing the actual kubernetesUI code.
Bring that repo in separately and make sure we are loading
it.

Adds test to prevent regressing again.
  • Loading branch information
petervo committed Aug 19, 2017
1 parent c8f36b5 commit 63b5051
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"jquery": "2.1.4",
"jquery-flot": "0.8.3",
"kubernetes-container-terminal": "1.0.3",
"org-kubernetes-object-describer": "https://github.com/kubernetes-ui/object-describer#v1.0.4",
"kubernetes-object-describer": "1.1.4",
"kubernetes-topology-graph": "0.0.23",
"moment": "2.10.6",
Expand Down
1 change: 1 addition & 0 deletions pkg/kubernetes/scripts/details.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"use strict";

var angular = require('angular');
require('object-describer/dist/object-describer.js');
require('kubernetes-object-describer/dist/object-describer.js');
require('angular-dialog.js');

Expand Down
1 change: 1 addition & 0 deletions pkg/kubernetes/scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
require('angular-gettext/dist/angular-gettext.js');
require('angular-bootstrap-npm/dist/angular-bootstrap.js');
require('kubernetes-container-terminal/dist/container-terminal.js');
require('object-describer/dist/object-describer.js');
require('kubernetes-object-describer/dist/object-describer.js');

/* The kubernetes client */
Expand Down
32 changes: 32 additions & 0 deletions test/verify/kubelib.py
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,38 @@ def testTopology(self):
# Assert that at least one link between Service and Pod has loaded
b.wait_present("svg line.ServicePod")

# Make sure that details display works
b.wait_present("svg g.Node")
b.wait_js_func(
"""(function() {
var el = window.Sizzle("svg g.Node");
var i;
for (i = 0; i < el.length; i++) {
var x = el[i].getAttribute("cx");
var y = el[i].getAttribute("cy");
if (x && y) {
var ev = document.createEvent("MouseEvent");
ev.initMouseEvent(
"mousedown",
true /* bubble */, true /* cancelable */,
window, null,
0, 0, 0, 0, /* coordinates */
false, false, false, false, /* modifier keys */
0 /*left*/, null);
/* Now dispatch the event */
el[i].dispatchEvent(ev);
return true;
}
}
})""", "true")

b.wait_present("div.sidebar-pf-right")
b.wait_present("div.sidebar-pf-right kubernetes-object-describer")
b.wait_in_text("div.sidebar-pf-right kubernetes-object-describer", "127.0.0.1")
b.wait_in_text("div.sidebar-pf-right kubernetes-object-describer h3:first", "Node")

class OpenshiftCommonTests(VolumeTests):

def testBasic(self):
Expand Down

0 comments on commit 63b5051

Please sign in to comment.