Migrate to AngularJS v1.8.2

This patch aligns current code with AngularJS v1.8.2 requirements.
It also updates zun-ui to use the Firefox browser instead of phantomjs
browser to fix "nodjs-run-test" job because phantomjs browser has some
issue with backticks.

Change-Id: I40857bea1c83704106277bbb858eb35ee39f360f
This commit is contained in:
manchandavishal 2022-08-10 12:34:42 +05:30
parent 8974cb6771
commit 23914cc56c
5 changed files with 29 additions and 23 deletions

View File

@ -129,20 +129,14 @@ var path = require('path');
frameworks: ['jasmine', 'jasmine-matchers'], frameworks: ['jasmine', 'jasmine-matchers'],
browsers: ['PhantomJS'], browsers: ['Firefox'],
browserNoActivityTimeout: 60000, browserNoActivityTimeout: 60000,
phantomjsLauncher: {
// Have phantomjs exit if a ResourceError is encountered
// (useful if karma exits without killing phantom)
exitOnResourceError: true
},
reporters: ['progress', 'coverage', 'threshold'], reporters: ['progress', 'coverage', 'threshold'],
plugins: [ plugins: [
'karma-phantomjs-launcher', 'karma-firefox-launcher',
'karma-jasmine', 'karma-jasmine',
'karma-jasmine-matchers', 'karma-jasmine-matchers',
'karma-ng-html2js-preprocessor', 'karma-ng-html2js-preprocessor',

View File

@ -124,7 +124,7 @@
it('setBootDevice - cancel', function() { it('setBootDevice - cancel', function() {
spyOn($uibModal, 'open').and.returnValue( spyOn($uibModal, 'open').and.returnValue(
{result: $q.reject('cancel')}); {result: $q.reject('cancel').catch(angular.noop)});
createNode().then(function(data) { createNode().then(function(data) {
bootDeviceService.setBootDevice(data.node) bootDeviceService.setBootDevice(data.node)

View File

@ -166,7 +166,8 @@
it('createNode - Missing input data', function() { it('createNode - Missing input data', function() {
createNode({}) createNode({})
.then(failTest); .then(failTest)
.catch(angular.noop);
ironicBackendMockService.flush(); ironicBackendMockService.flush();
}); });
@ -201,7 +202,8 @@
it('deleteNode - nonexistent node', function() { it('deleteNode - nonexistent node', function() {
ironicAPI.deleteNode(0) ironicAPI.deleteNode(0)
.then(failTest); .then(failTest)
.catch(angular.noop);
ironicBackendMockService.flush(); ironicBackendMockService.flush();
}); });
@ -476,14 +478,16 @@
it('createPort - missing input data', function() { it('createPort - missing input data', function() {
ironicAPI.createPort({}) ironicAPI.createPort({})
.then(failTest); .then(failTest)
.catch(angular.noop);
ironicBackendMockService.flush(); ironicBackendMockService.flush();
}); });
it('createPort - bad input data', function() { it('createPort - bad input data', function() {
ironicAPI.createPort({address: "", node_uuid: ""}) ironicAPI.createPort({address: "", node_uuid: ""})
.then(failTest); .then(failTest)
.catch(angular.noop);
ironicBackendMockService.flush(); ironicBackendMockService.flush();
}); });
@ -506,7 +510,8 @@
return ironicAPI.createPort({address: macAddr, return ironicAPI.createPort({address: macAddr,
node_uuid: node.uuid}); node_uuid: node.uuid});
}) })
.then(failTest); .then(failTest)
.catch(angular.noop);
ironicBackendMockService.flush(); ironicBackendMockService.flush();
}); });
@ -534,7 +539,8 @@
it('deletePort - nonexistent port', function() { it('deletePort - nonexistent port', function() {
ironicAPI.deletePort(0) ironicAPI.deletePort(0)
.then(failTest); .then(failTest)
.catch(angular.noop);
ironicBackendMockService.flush(); ironicBackendMockService.flush();
}); });
@ -581,14 +587,16 @@
it('createPortgroup - missing input data', function() { it('createPortgroup - missing input data', function() {
ironicAPI.createPortgroup({}) ironicAPI.createPortgroup({})
.then(failTest); .then(failTest)
.catch(angular.noop);
ironicBackendMockService.flush(); ironicBackendMockService.flush();
}); });
it('createPort - bad input data', function() { it('createPort - bad input data', function() {
ironicAPI.createPort({node_uuid: ""}) ironicAPI.createPort({node_uuid: ""})
.then(failTest); .then(failTest)
.catch(angular.noop);
ironicBackendMockService.flush(); ironicBackendMockService.flush();
}); });
@ -605,7 +613,8 @@
ironicAPI.deletePortgroup(portgroup.uuid).then(function() { ironicAPI.deletePortgroup(portgroup.uuid).then(function() {
expect(ironicBackendMockService.getPortgroup(portgroup.uuid)) expect(ironicBackendMockService.getPortgroup(portgroup.uuid))
.toBeNull(); .toBeNull();
}); })
.catch(angular.noop);
}) })
.catch(failTest); .catch(failTest);
@ -631,7 +640,8 @@
.toBeNull(); .toBeNull();
expect(ironicBackendMockService.getPortgroup(portgroup.uuid)) expect(ironicBackendMockService.getPortgroup(portgroup.uuid))
.toBeNull(); .toBeNull();
}); })
.catch(angular.noop);
}) })
.catch(failTest); .catch(failTest);
@ -640,7 +650,8 @@
it('deletePortgroup - nonexistent portgroup', function() { it('deletePortgroup - nonexistent portgroup', function() {
ironicAPI.deletePortgroup(0) ironicAPI.deletePortgroup(0)
.then(failTest); .then(failTest)
.catch(angular.noop);
ironicBackendMockService.flush(); ironicBackendMockService.flush();
}); });
@ -679,7 +690,8 @@
it('injectNmi - nonexistent node', function() { it('injectNmi - nonexistent node', function() {
ironicAPI.injectNmi(0) ironicAPI.injectNmi(0)
.then(failTest); .then(failTest)
.catch(angular.noop);
ironicBackendMockService.flush(); ironicBackendMockService.flush();
}); });

View File

@ -118,7 +118,7 @@
it('setRaidConfig - cancel', function() { it('setRaidConfig - cancel', function() {
spyOn($uibModal, 'open').and.returnValue( spyOn($uibModal, 'open').and.returnValue(
{result: $q.reject('cancel')}); {result: $q.reject('cancel').catch(angular.noop)});
createNode().then(function(data) { createNode().then(function(data) {
raidConfigService.setRaidConfig(data.node) raidConfigService.setRaidConfig(data.node)

View File

@ -19,7 +19,7 @@
"karma-jasmine": "^1.0.2", "karma-jasmine": "^1.0.2",
"karma-jasmine-matchers": "^3.7.0", "karma-jasmine-matchers": "^3.7.0",
"karma-ng-html2js-preprocessor": "^1.0.0", "karma-ng-html2js-preprocessor": "^1.0.0",
"karma-phantomjs-launcher": "^1.0.4", "karma-firefox-launcher": "2.1.0",
"karma-threshold-reporter": "^0.1.15" "karma-threshold-reporter": "^0.1.15"
}, },
"scripts": { "scripts": {