diff --git a/app/js/on_config.js b/app/js/on_config.js index 2f7b8ef9..ac2a8cc3 100644 --- a/app/js/on_config.js +++ b/app/js/on_config.js @@ -3,7 +3,9 @@ /** * @ngInject */ -function OnConfig($stateProvider, $locationProvider, $urlRouterProvider) { +function OnConfig($stateProvider, $locationProvider, $urlRouterProvider, $sceDelegateProvider) { + $sceDelegateProvider.resourceUrlWhitelist(['self','http://health.openstack.org/**']); + $stateProvider .state('home', { url: '/', diff --git a/app/js/services/health-api.js b/app/js/services/health-api.js index 52bb32d9..8fc68c3e 100644 --- a/app/js/services/health-api.js +++ b/app/js/services/health-api.js @@ -64,7 +64,6 @@ function HealthService($http, config) { return config.get().then(function(config) { return $http.jsonp(config.apiRoot + '/build_name/' + buildName + '/runs', { params: { - callback: 'JSON_CALLBACK' } }); }); @@ -74,7 +73,7 @@ function HealthService($http, config) { return config.get().then(function(config) { return $http.jsonp(config.apiRoot + '/build_name/' + buildName + '/test_runs', { cache: true, - params: angular.extend(options, { callback: 'JSON_CALLBACK' }) + params: angular.extend(options) }); }); }; @@ -83,7 +82,7 @@ function HealthService($http, config) { return config.get().then(function(config) { return $http.jsonp(config.apiRoot + '/runs/group_by/' + key, { cache: true, - params: angular.extend(options, { callback: 'JSON_CALLBACK' }) + params: angular.extend(options) }); }); }; @@ -91,7 +90,7 @@ function HealthService($http, config) { service.getRuns = function(options) { return config.get().then(function(config) { return $http.jsonp(config.apiRoot + '/runs', { - params: angular.extend(options, { callback: 'JSON_CALLBACK' }) + params: angular.extend(options) }); }); }; @@ -99,7 +98,7 @@ function HealthService($http, config) { service.getRunsForRunMetadataKey = function(runMetadataKey, value, options) { return config.get().then(function(config) { return $http.jsonp(config.apiRoot + '/runs/key/' + runMetadataKey + '/' + value, { - params: angular.extend(options, { callback: 'JSON_CALLBACK' }) + params: angular.extend(options) }); }); }; @@ -107,7 +106,7 @@ function HealthService($http, config) { service.getTestsFromRun = function(runId) { return config.get().then(function(config) { return $http.jsonp(config.apiRoot + '/run/' + runId + '/tests', { - params: { callback: 'JSON_CALLBACK' } + params: {} }); }); }; @@ -115,7 +114,7 @@ function HealthService($http, config) { service.getRunTestRuns = function(runId) { return config.get().then(function(config) { return $http.jsonp(config.apiRoot + '/run/' + runId + '/test_runs', { - params: { callback: 'JSON_CALLBACK' } + params: {} }); }); }; @@ -124,7 +123,7 @@ function HealthService($http, config) { return config.get().then(function(config) { return $http.jsonp(config.apiRoot + '/tests', { cache: true, - params: { callback: 'JSON_CALLBACK' } + params: {} }); }); }; @@ -133,7 +132,7 @@ function HealthService($http, config) { return config.get().then(function(config) { return $http.jsonp(config.apiRoot + '/runs/metadata/keys', { cache: true, - params: { callback: 'JSON_CALLBACK' } + params: {} }); }); }; @@ -141,7 +140,7 @@ function HealthService($http, config) { service.getTestRunList = function(testId, options) { return config.get().then(function(config) { return $http.jsonp(config.apiRoot + '/test_runs/' + testId, { - params: angular.extend(options, { callback: 'JSON_CALLBACK' }) + params: angular.extend(options) }); }); }; @@ -152,7 +151,7 @@ function HealthService($http, config) { return config.get().then(function(config) { return $http.jsonp(config.apiRoot + '/runs/key/' + runMetadataKey + '/' + value + '/recent', { cache: true, - params: angular.extend(options, { callback: 'JSON_CALLBACK' }) + params: angular.extend(options) }); }); }; @@ -163,7 +162,7 @@ function HealthService($http, config) { return config.get().then(function(config) { return $http.jsonp(config.apiRoot + '/tests/recent/fail', { cache: true, - params: angular.extend(options, { callback: 'JSON_CALLBACK' }) + params: angular.extend(options) }); }); }; @@ -172,7 +171,7 @@ function HealthService($http, config) { return config.get().then(function(config) { return $http.jsonp(config.apiRoot + '/tests/prefix', { cache: true, - params: { callback: 'JSON_CALLBACK' } + params: {} }); }); }; @@ -183,7 +182,7 @@ function HealthService($http, config) { return config.get().then(function(config) { return $http.jsonp(config.apiRoot + '/tests/prefix/' + prefix, { cache: true, - params: angular.extend(options, { callback: 'JSON_CALLBACK' }) + params: angular.extend(options) }); }); }; diff --git a/test-requirements.txt b/test-requirements.txt index 5b4d8cb3..3995dc03 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -4,6 +4,7 @@ hacking<0.11,>=0.10.0 coverage>=3.6 # Apache-2.0 +docutils>=0.11,!=0.13.1 # OSI-Approved Open Source, Public Domain os-testr>=0.4.1 # Apache-2.0 mock>=1.2 # BSD fixtures>=1.3.1 # Apache-2.0/BSD diff --git a/test/unit/controllers/grouped_runs_spec.js b/test/unit/controllers/grouped_runs_spec.js index 35acbc01..df5b3d59 100644 --- a/test/unit/controllers/grouped_runs_spec.js +++ b/test/unit/controllers/grouped_runs_spec.js @@ -3,7 +3,9 @@ describe('GroupedRunsController', function() { module('app'); module('app.controllers'); }); - + beforeEach(module(function ($sceDelegateProvider) { + $sceDelegateProvider.resourceUrlWhitelist(['self','http://8.8.4.4:8080/**']); + })); var $scope, $httpBackend, $controller, healthService, viewService; var API_ROOT = 'http://8.8.4.4:8080'; var DEFAULT_END_DATE = new Date(); diff --git a/test/unit/controllers/job_spec.js b/test/unit/controllers/job_spec.js index c94d1865..3a098343 100644 --- a/test/unit/controllers/job_spec.js +++ b/test/unit/controllers/job_spec.js @@ -4,6 +4,10 @@ describe('JobController', function() { module('app.controllers'); }); + beforeEach(module(function ($sceDelegateProvider) { + $sceDelegateProvider.resourceUrlWhitelist(['self','http://8.8.4.4:8080/**']); + })); + var $scope, $httpBackend, $controller, healthService, viewService; var API_ROOT = 'http://8.8.4.4:8080'; var DEFAULT_END_DATE = new Date(); diff --git a/test/unit/controllers/tests_detail_spec.js b/test/unit/controllers/tests_detail_spec.js index f6719521..d59d8c9f 100644 --- a/test/unit/controllers/tests_detail_spec.js +++ b/test/unit/controllers/tests_detail_spec.js @@ -4,6 +4,10 @@ describe('TestsDetailController', function() { module('app.controllers'); }); + beforeEach(module(function ($sceDelegateProvider) { + $sceDelegateProvider.resourceUrlWhitelist(['self','http://8.8.4.4:8080/**']); + })); + var $scope, $httpBackend, $controller, healthService; var API_ROOT = 'http://8.8.4.4:8080'; var DEFAULT_START_DATE = new Date(); diff --git a/test/unit/controllers/tests_spec.js b/test/unit/controllers/tests_spec.js index 8b5fa89c..3993a21e 100644 --- a/test/unit/controllers/tests_spec.js +++ b/test/unit/controllers/tests_spec.js @@ -4,6 +4,10 @@ describe('TestsController', function() { module('app.controllers'); }); + beforeEach(module(function ($sceDelegateProvider) { + $sceDelegateProvider.resourceUrlWhitelist(['self','http://8.8.4.4:8080/**']); + })); + var $scope, $httpBackend, $controller, healthService; var API_ROOT = 'http://8.8.4.4:8080'; var DEFAULT_START_DATE = new Date(); diff --git a/test/unit/services/health_spec.js b/test/unit/services/health_spec.js index 3b468d16..4288627d 100644 --- a/test/unit/services/health_spec.js +++ b/test/unit/services/health_spec.js @@ -4,6 +4,10 @@ describe('HealthService', function() { module('app.services'); }); + beforeEach(module(function ($sceDelegateProvider) { + $sceDelegateProvider.resourceUrlWhitelist(['self','http://8.8.4.4:8080/**']); + })); + var $httpBackend, healthService; var API_ROOT = 'http://8.8.4.4:8080'; var DEFAULT_START_TIME = '2010-01-01T01:00:00';