From 5593faf2a4dce0446e6595dd1b3d6da92e9a6101 Mon Sep 17 00:00:00 2001 From: Atira Odhner Date: Wed, 15 Mar 2017 17:13:55 +0000 Subject: [PATCH] Move the karma config and node_modules into the web directory. --- karma.conf.js => web/karma.conf.js | 16 ++++++++-------- web/regression/README | 11 ++++++----- .../regression}/javascript/fake_translations.js | 0 {test => web/regression}/javascript/test-main.js | 4 ++-- .../regression}/javascript/translate_spec.js | 0 5 files changed, 16 insertions(+), 15 deletions(-) rename karma.conf.js => web/karma.conf.js (80%) rename {test => web/regression}/javascript/fake_translations.js (100%) rename {test => web/regression}/javascript/test-main.js (96%) rename {test => web/regression}/javascript/translate_spec.js (100%) diff --git a/karma.conf.js b/web/karma.conf.js similarity index 80% rename from karma.conf.js rename to web/karma.conf.js index 2f9849044..3e110463c 100644 --- a/karma.conf.js +++ b/web/karma.conf.js @@ -15,18 +15,18 @@ module.exports = function(config) { // list of files / patterns to load in the browser files: [ - {pattern: 'test/javascript/**/*.js', included: false}, - {pattern: 'web/pgadmin/static/vendor/**/*.js', included: false}, - {pattern: 'web/pgadmin/static/js/**/*.js', included: false}, - 'test/javascript/test-main.js' + {pattern: 'regression/javascript/**/*.js', included: false}, + {pattern: 'pgadmin/static/vendor/**/*.js', included: false}, + {pattern: 'pgadmin/static/js/**/*.js', included: false}, + 'regression/javascript/test-main.js' ], // list of files to exclude exclude: [ - 'web/pgadmin/static/js/pgadmin.js', - 'web/pgadmin/static/vendor/**/*[Tt]est.js', - 'web/pgadmin/static/vendor/**/*[Ss]pec.js' + 'pgadmin/static/js/pgadmin.js', + 'pgadmin/static/vendor/**/*[Tt]est.js', + 'pgadmin/static/vendor/**/*[Ss]pec.js' ], @@ -66,7 +66,7 @@ module.exports = function(config) { // Continuous Integration mode // if true, Karma captures browsers, runs the tests and exits - singleRun: false, + singleRun: true, // Concurrency level // how many browser should be started simultaneous diff --git a/web/regression/README b/web/regression/README index 6e3723d5a..78e2fd9b5 100644 --- a/web/regression/README +++ b/web/regression/README @@ -157,15 +157,16 @@ Python Tests run 'python runtests.py --exclude browser.server_groups.servers.databases,browser.server_groups.servers.tablespaces' Javascript Tests + javascript tests must be run from the web directory (since that is where node_modules and karma.conf reside) + cd web/ + brew install nodejs - npm install + brew install yarn + yarn - you may wish to install the karma cli, so it is accessible globally: + install the karma cli, so it is accessible globally: npm install -g karma-cli - Otherwise you can use: - ./node_modules/karma/bin/karma - to run tests: karma start --single-run diff --git a/test/javascript/fake_translations.js b/web/regression/javascript/fake_translations.js similarity index 100% rename from test/javascript/fake_translations.js rename to web/regression/javascript/fake_translations.js diff --git a/test/javascript/test-main.js b/web/regression/javascript/test-main.js similarity index 96% rename from test/javascript/test-main.js rename to web/regression/javascript/test-main.js index b0726a0d4..3d70cf917 100644 --- a/test/javascript/test-main.js +++ b/web/regression/javascript/test-main.js @@ -12,7 +12,7 @@ Object.keys(window.__karma__.files).forEach(function (file) { } }); -var sourcesDir = '/base/web/pgadmin/static/'; +var sourcesDir = '/base/pgadmin/static/'; require.config({ // Karma serves files under /base, which is the basePath from your config file baseUrl: '/base', @@ -26,7 +26,7 @@ require.config({ 'slickgrid': sourcesDir + 'vendor/slickgrid/slick.core', 'slickgrid/slick.grid': sourcesDir + 'vendor/slickgrid/slick.grid', 'slickgrid/slick.rowselectionmodel': sourcesDir + 'vendor/slickgrid/plugins/slick.rowselectionmodel', - 'translations': '/base/test/javascript/fake_translations', + 'translations': '/base/regression/javascript/fake_translations', 'sources': sourcesDir + 'js' }, diff --git a/test/javascript/translate_spec.js b/web/regression/javascript/translate_spec.js similarity index 100% rename from test/javascript/translate_spec.js rename to web/regression/javascript/translate_spec.js