# HG changeset patch # User ymh # Date 1396966913 -7200 # Node ID ecf0e467eeb809aa1e43c5ce46176df58eff1db8 # Parent 7b983f1b7040e3a06e701507485276b22aa0d1ff adapt dev enviromenent to the new test-suite location diff -r 7b983f1b7040 -r ecf0e467eeb8 .hgignore --- a/.hgignore Mon Apr 07 17:41:35 2014 +0200 +++ b/.hgignore Tue Apr 08 16:21:53 2014 +0200 @@ -17,10 +17,10 @@ urls_local.py dev/.vagrant dev/custom.yaml -src/cm/scripts/test-suite/node_modules -src/cm/scripts/test-suite/workspace.info*.js -src/cm/scripts/test-suite/clean-testserver.sh -src/cm/scripts/test-suite/karma.conf.full.js -src/cm/scripts/test-suite/start-test-suite-full.sh -src/cm/scripts/test-suite/start-testserver.sh +test-suite/node_modules +test-suite/workspace.info*.js +test-suite/clean-testserver.sh +test-suite/karma.conf.full.js +test-suite/start-test-suite-full.sh +test-suite/start-testserver.sh diff -r 7b983f1b7040 -r ecf0e467eeb8 dev/clean_dev.sh --- a/dev/clean_dev.sh Mon Apr 07 17:41:35 2014 +0200 +++ b/dev/clean_dev.sh Tue Apr 08 16:21:53 2014 +0200 @@ -9,9 +9,9 @@ pushd "$ROOTPATH" > /dev/null rm -rfv .installed.cfg .mr.developer.cfg parts/ eggs/ develop-eggs/ bin/ \ - src/cm/settings_local.py src/cm/scripts/test-suite/workspace.info*.js \ - src/cm/scripts/test-suite/{clean-testserver.sh,karma.conf.full.js} \ - src/cm/scripts/test-suite/{start-test-suite-full.sh,start-testserver.sh} + src/cm/settings_local.py test-suite/workspace.info*.js \ + test-suite/{clean-testserver.sh,karma.conf.full.js} \ + test-suite/{start-test-suite-full.sh,start-testserver.sh} find . -name '*.pyc' -or -name '*.egg-info' | xargs rm -rvf diff -r 7b983f1b7040 -r ecf0e467eeb8 dev/modules/sysconfig/files/karma.conf.full.js --- a/dev/modules/sysconfig/files/karma.conf.full.js Mon Apr 07 17:41:35 2014 +0200 +++ b/dev/modules/sysconfig/files/karma.conf.full.js Tue Apr 08 16:21:53 2014 +0200 @@ -3,7 +3,8 @@ // SID: get WORKSPACE_URL configuration from one single file to customize -var w = require ('./workspace.info.full.js'); +var w = require ('./workspace.info.full.js'), + t = require ('./lib/test_hlp.js'); module.exports = function(config) { config.set({ @@ -31,7 +32,12 @@ mocha: { ui: 'tdd' }, - w: w // SID: exports the variable in the test execution browser window + w: w, // SID: exports the variable in the test execution browser window + // SID: we can't pass living functions to testing (mocha) browser environment + // so we convert them to string, and send also a string body of a reviving function + // closures are lost in the process, that's ok. + t: JSON.stringify (t, function (k, v) { return typeof v === 'function' ? v.toString () : v }), + r: t.reviveFunc }, // test results reporter to use : 'dots', 'progress', 'junit', 'growl', 'coverage' reporters: ['progress'], @@ -40,13 +46,12 @@ // enable / disable colors in the output (reporters and logs) colors: true, // level of logging : config.LOG_DISABLE || _ERROR || _WARN || _INFO || _DEBUG - logLevel: config.LOG_INFO || config.LOG_DEBUG, + logLevel: config.LOG_INFO, + // If browser does not capture in given timeout [ms], kill it + captureTimeout: 9999, // enable / disable watching file and executing tests whenever any file changes autoWatch: false, - // If browser does not capture in given timeout [ms], kill it - captureTimeout: 20000, // Continuous Integration mode : if true, it capture browsers, run tests and exit - // singleRun: false singleRun: true, }); }; diff -r 7b983f1b7040 -r ecf0e467eeb8 dev/modules/sysconfig/manifests/testserver_init.pp --- a/dev/modules/sysconfig/manifests/testserver_init.pp Mon Apr 07 17:41:35 2014 +0200 +++ b/dev/modules/sysconfig/manifests/testserver_init.pp Tue Apr 08 16:21:53 2014 +0200 @@ -11,12 +11,12 @@ $vagrant_base_path ) inherits sysconfig::params { - + notify {'testserver_init': name => "testserver init : \$superuser_name : ${superuser_name}, \$superuser_pw : ${superuser_pw}", withpath => true }-> file { 'karma_workspace_info': ensure => 'present', - path => "/srv/comt/src/cm/scripts/test-suite/workspace.info.js", + path => "/srv/comt/test-suite/workspace.info.js", replace => 'no', owner => 'vagrant', group => 'vagrant', @@ -26,7 +26,7 @@ file { 'karma_workspace_info_full': ensure => 'present', - path => "/srv/comt/src/cm/scripts/test-suite/workspace.info.full.js", + path => "/srv/comt/test-suite/workspace.info.full.js", replace => 'no', owner => 'vagrant', group => 'vagrant', @@ -36,7 +36,7 @@ file { 'clean-testserver.sh': ensure => 'present', - path => "/srv/comt/src/cm/scripts/test-suite/clean-testserver.sh", + path => "/srv/comt/test-suite/clean-testserver.sh", replace => 'no', owner => 'vagrant', group => 'vagrant', @@ -46,7 +46,7 @@ file { 'karma.conf.full.js': ensure => 'present', - path => "/srv/comt/src/cm/scripts/test-suite/karma.conf.full.js", + path => "/srv/comt/test-suite/karma.conf.full.js", replace => 'no', owner => 'vagrant', group => 'vagrant', @@ -56,7 +56,7 @@ file { 'start-test-suite-full.sh': ensure => 'present', - path => "/srv/comt/src/cm/scripts/test-suite/start-test-suite-full.sh", + path => "/srv/comt/test-suite/start-test-suite-full.sh", replace => 'no', owner => 'vagrant', group => 'vagrant', @@ -66,7 +66,7 @@ file { 'start-testserver.sh': ensure => 'present', - path => "/srv/comt/src/cm/scripts/test-suite/start-testserver.sh", + path => "/srv/comt/test-suite/start-testserver.sh", replace => 'no', owner => 'vagrant', group => 'vagrant', @@ -74,4 +74,4 @@ content => template('sysconfig/start-testserver.sh.erb'), } -} \ No newline at end of file +} diff -r 7b983f1b7040 -r ecf0e467eeb8 dev/modules/sysconfig/templates/start-test-suite-full.sh.erb --- a/dev/modules/sysconfig/templates/start-test-suite-full.sh.erb Mon Apr 07 17:41:35 2014 +0200 +++ b/dev/modules/sysconfig/templates/start-test-suite-full.sh.erb Tue Apr 08 16:21:53 2014 +0200 @@ -6,7 +6,7 @@ DEV_FOLDER="<%= @vagrant_base_path %>" pushd "$DEV_FOLDER" > /dev/null -vagrant ssh -c "/srv/comt/src/cm/scripts/test-suite/start-testserver.sh" +vagrant ssh -c "/srv/comt/test-suite/start-testserver.sh" popd > /dev/null CONNECTION_TIMEOUT=10 @@ -52,7 +52,5 @@ echo "stopping test server + output test server logs" pushd "$DEV_FOLDER" > /dev/null -vagrant ssh -c "/srv/comt/src/cm/scripts/test-suite/clean-testserver.sh" +vagrant ssh -c "/srv/comt/test-suite/clean-testserver.sh" popd /dev/null - - diff -r 7b983f1b7040 -r ecf0e467eeb8 dev/modules/sysconfig/templates/start-testserver.sh.erb --- a/dev/modules/sysconfig/templates/start-testserver.sh.erb Mon Apr 07 17:41:35 2014 +0200 +++ b/dev/modules/sysconfig/templates/start-testserver.sh.erb Tue Apr 08 16:21:53 2014 +0200 @@ -6,7 +6,7 @@ pushd "$ROOTPATH" > /dev/null -nohup bin/django testserver --noinput --addrport=0.0.0.0:<%= @testserver_port %> initial_data roles_generic test_suite > $TMPFILE 2>&1 & +nohup bin/django testserver --noinput --addrport=0.0.0.0:<%= @testserver_port %> initial_data roles_generic test_content > $TMPFILE 2>&1 & echo "$!|$TMPFILE" > /tmp/testserver.pid cat /tmp/testserver.pid diff -r 7b983f1b7040 -r ecf0e467eeb8 dev/modules/sysconfig/templates/workspace.info.js.erb --- a/dev/modules/sysconfig/templates/workspace.info.js.erb Mon Apr 07 17:41:35 2014 +0200 +++ b/dev/modules/sysconfig/templates/workspace.info.js.erb Tue Apr 08 16:21:53 2014 +0200 @@ -3,10 +3,11 @@ Object.defineProperty (exports, name, { value: value, enumerable: true - }); + }); } -//define ("WORKSPACE_URL", 'http://<%= @ipaddress_eth1 %>/'); +define ("DEBUG", false); + define ("USER_ADMIN", '<%= @superuser_name %>'); define ("PASS_ADMIN", '<%= @superuser_pw %>'); @@ -23,5 +24,3 @@ define ("USER_OBSERV", '<%= @user_observ_name %>'); define ("PASS_OBSERV", '<%= @user_observ_pw %>'); - -