Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ MANIFEST
*.iml
*.sqlite3
*.pyc
venv
venv
tests/javascript/reports
tests/javascript/PhantomJS*
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ addons:
install:
- sudo pip install pylint
- sudo pip install -r requirements.txt
- npm install -g jshint
- npm install -g jshint karma jasmine-core karma-phantomjs-launcher karma-coverage karma-junit-reporter karma-jasmine

script:
- sonar-scanner
- pylint openstack_lease_it/openstack_lease_it openstack_lease_it/lease_it
- jshint .
- karma start tests/javascript/karma.conf.ci.js
- sonar-scanner
4 changes: 4 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ sonar.sources=openstack_lease_it

# Exclude static directory
sonar.exclusions=openstack_lease_it/lease_it/static/contrib/**

# SonarJs for javascript coverage
sonar.javascript.lcov.reportPath=tests/javascript/reports/coverage/lcov.info
sonar.surefire.reportsPath=tests/javascript/reports/junit
26 changes: 26 additions & 0 deletions tests/javascript/karma.conf.ci.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
var baseConfig = require('./karma.conf.js');

module.exports = function (config) {
// Load base config
baseConfig(config);

// Override base config
config.set({
singleRun: true,
colors: false,
autoWatch: false,
reporters: ['progress', 'junit', 'coverage'],
preprocessors: {
'../../openstack_lease_it/lease_it/static/js/*.js': ['coverage']
},
browsers: ['PhantomJS'],
junitReporter: {
outputFile: 'reports/junit/TESTS-xunit.xml'
},
coverageReporter: {
type: 'lcov',
dir: 'reports',
subdir: 'coverage'
}
});
};
69 changes: 69 additions & 0 deletions tests/javascript/karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
// Karma configuration
// Generated on Sat Apr 29 2017 11:31:54 GMT+0200 (CEST)

module.exports = function(config) {
config.set({

// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',


// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['jasmine'],


// list of files / patterns to load in the browser
files: [
'../../openstack_lease_it/lease_it/static/js/*.js'
],


// list of files to exclude
exclude: [
],


// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
},


// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress'],


// web server port
port: 9876,


// enable / disable colors in the output (reporters and logs)
colors: true,


// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,


// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,


// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['PhantomJS'],


// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false,

// Concurrency level
// how many browser should be started simultaneous
concurrency: Infinity
});
};