commit/galaxy-central: 2 new changesets
2 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/3d30cac626a8/ Changeset: 3d30cac626a8 User: carlfeberhard Date: 2014-04-18 15:56:31 Summary: QA: add qunit tests for galaxy-app-base; Fix defaults in metrics-logger tests Affected #: 4 files diff -r 7f05a259b98a16f0cb86e69a9c2e8746f1520623 -r 3d30cac626a8484eaba7d28adb0359eb9e124b4d static/scripts/galaxy-app-base.js --- a/static/scripts/galaxy-app-base.js +++ b/static/scripts/galaxy-app-base.js @@ -40,7 +40,6 @@ self.debug( 'GalaxyApp.options: ', self.options ); self._patchGalaxy( window.Galaxy ); - self.debug( 'GalaxyApp.options: ', self.options ); self._initLogger( options.loggerOptions || {} ); self.debug( 'GalaxyApp.logger: ', self.logger ); diff -r 7f05a259b98a16f0cb86e69a9c2e8746f1520623 -r 3d30cac626a8484eaba7d28adb0359eb9e124b4d test/qunit/tests/galaxy-app-base.html --- /dev/null +++ b/test/qunit/tests/galaxy-app-base.html @@ -0,0 +1,10 @@ +<!doctype html> +<!-- Minimal outline test page for a requirejs+qunit testing setup, + test environment is bootstrapped in test-common.js --> +<html> + <head> + <script data-main="../test-common" src="../scripts/libs/require.js"></script> + </head> + <body> + </body> +</html> diff -r 7f05a259b98a16f0cb86e69a9c2e8746f1520623 -r 3d30cac626a8484eaba7d28adb0359eb9e124b4d test/qunit/tests/galaxy-app-base.js --- /dev/null +++ b/test/qunit/tests/galaxy-app-base.js @@ -0,0 +1,113 @@ +define( 'bootstrapped-data', function(){ + return { + config : { + "allow_user_deletion": false, + "allow_user_creation": true, + "wiki_url": "http://wiki.galaxyproject.org/", + "ftp_upload_site": null, + "support_url": "https://wiki.galaxyproject.org/Support", + "allow_user_dataset_purge": false, + "allow_library_path_paste": false, + "user_library_import_dir": null, + "terms_url": null, + "ftp_upload_dir": null, + "library_import_dir": null, + "logo_url": null, + "enable_unique_workflow_defaults": false + }, + user : { + "username": "test", + "quota_percent": null, + "total_disk_usage": 61815527, + "nice_total_disk_usage": "59.0 MB", + "email": "test@test.test", + "tags_used": [ + "test" + ], + "model_class": "User", + "id": "f2db41e1fa331b3e" + } + }; +}); +define([ + "galaxy-app-base", + 'bootstrapped-data', + "jquery", + "sinon-qunit" +], function( + appBase, + bootstrapped, + $, + sinon +){ + /*globals equal test module expect deepEqual strictEqual throws ok */ + "use strict"; + + module( "Galaxy client app tests" ); + + test( "App base construction/initializiation defaults", function() { + var app = new appBase.GalaxyApp({}); + ok( app.hasOwnProperty( 'options' ) && typeof app.options === 'object' ); + ok( app.hasOwnProperty( 'logger' ) && typeof app.logger === 'object' ); + ok( app.hasOwnProperty( 'localize' ) && typeof app.localize === 'function' ); + ok( app.hasOwnProperty( 'config' ) && typeof app.config === 'object' ); + ok( app.hasOwnProperty( 'user' ) && typeof app.config === 'object' ); + + equal( app.localize, window._l ); + }); + + test( "App base default options", function() { + var app = new appBase.GalaxyApp({}); + ok( app.hasOwnProperty( 'options' ) && typeof app.options === 'object' ); + equal( app.options.root, '/' ); + equal( app.options.patchExisting, true ); + }); + + test( "App base extends from Backbone.Events", function() { + var app = new appBase.GalaxyApp({}); + [ 'on', 'off', 'trigger', 'listenTo', 'stopListening' ].forEach( function( fn ){ + ok( app.hasOwnProperty( fn ) && typeof app[ fn ] === 'function' ); + }); + }); + + test( "App base has logging methods from utils/add-logging.js", function() { + var app = new appBase.GalaxyApp({}); + [ 'debug', 'info', 'warn', 'error', 'metric' ].forEach( function( fn ){ + ok( typeof app[ fn ] === 'function' ); + }); + ok( app._logNamespace === 'GalaxyApp' ); + }); + + test( 'App base will patch in attributes from existing Galaxy objects', function(){ + window.Galaxy = { + attribute : { + subattr : 1 + } + }; + var app = new appBase.GalaxyApp({}); + ok( typeof app.attribute === 'object' && app.attribute.subattr === 1 ); + }); + + test( "App base logger", function() { + var app = new appBase.GalaxyApp({}); + ok( app.hasOwnProperty( 'logger' ) && typeof app.config === 'object' ); + }); + + test( "App base config", function() { + var app = new appBase.GalaxyApp({}); + ok( app.hasOwnProperty( 'config' ) && typeof app.config === 'object' ); + equal( app.config.allow_user_deletion, false ); + equal( app.config.allow_user_creation, true ); + equal( app.config.wiki_url, "http://wiki.galaxyproject.org/" ); + equal( app.config.ftp_upload_site, null ); + //... + }); + + test( "App base user", function() { + var app = new appBase.GalaxyApp({}); + ok( app.hasOwnProperty( 'user' ) && typeof app.user === 'object' ); + ok( app.hasOwnProperty( 'currUser' ) && app.user === app.currUser ); + ok( app.user.isAdmin() === false ); + }); + +}); diff -r 7f05a259b98a16f0cb86e69a9c2e8746f1520623 -r 3d30cac626a8484eaba7d28adb0359eb9e124b4d test/qunit/tests/metrics-logger.js --- a/test/qunit/tests/metrics-logger.js +++ b/test/qunit/tests/metrics-logger.js @@ -17,7 +17,7 @@ test( "logger construction/initializiation defaults", function() { var logger = new metrics.MetricsLogger({}); equal( logger.consoleLogger, null ); - equal( logger.options.logLevel, metrics.MetricsLogger.INFO ); + equal( logger.options.logLevel, metrics.MetricsLogger.NONE ); equal( logger.options.consoleLevel, metrics.MetricsLogger.NONE ); equal( logger.options.defaultNamespace, 'Galaxy' ); equal( logger.options.clientPrefix, 'client.' ); https://bitbucket.org/galaxy/galaxy-central/commits/5bbadf58b213/ Changeset: 5bbadf58b213 User: carlfeberhard Date: 2014-04-18 15:57:35 Summary: merge Affected #: 1 file diff -r 3d30cac626a8484eaba7d28adb0359eb9e124b4d -r 5bbadf58b213db0e23740a01396f38699dbd7ccd test/base/interactor.py --- a/test/base/interactor.py +++ b/test/base/interactor.py @@ -3,7 +3,7 @@ from galaxy.tools.parameters import grouping from galaxy import eggs eggs.require( "requests" ) -from galaxy.util import listify +from galaxy import util from galaxy.util.odict import odict import galaxy.model from galaxy.model.orm import and_, desc @@ -13,7 +13,10 @@ from logging import getLogger log = getLogger( __name__ ) -VERBOSE_ERRORS = False +# Off by default because it can pound the database pretty heavily +# and result in sqlite errors on larger tests or larger numbers of +# tests. +VERBOSE_ERRORS = util.asbool( os.environ.get( "GALAXY_TEST_VERBOSE_ERRORS", False ) ) ERROR_MESSAGE_DATASET_SEP = "--------------------------------------" Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org