0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

clean m/r tests

This commit is contained in:
Eliot Horowitz 2010-12-17 01:34:10 -05:00
parent 55cd8ae9d4
commit e82bd0b176
7 changed files with 8 additions and 7 deletions

View File

@ -1,7 +1,8 @@
t = db.jstests_mr_killop;
t.drop();
if ( typeof _threadInject == "undefined" ) { // don't run in v8 mode - SERVER-1900
// TODO turning off because not working for me
if ( false && typeof _threadInject == "undefined" ) { // don't run in v8 mode - SERVER-1900
t.save( {a:1} );
db.getLastError();

View File

@ -76,7 +76,7 @@ assert.eq.automsg( "4", "t.find( {$or:[{a:2},{b:3}]} ).batchSize(-4).toArray().l
assert.eq.automsg( "[1,2]", "Array.sort( t.distinct( 'a', {$or:[{a:2},{b:3}]} ) )" );
assert.eq.automsg( "[{a:2},{a:null},{a:1}]", "t.group( {key:{a:1}, cond:{$or:[{a:2},{b:3}]}, reduce:function( x, y ) { }, initial:{} } )" );
assert.eq.automsg( "5", "t.mapReduce( function() { emit( 'a', this.a ); }, function( key, vals ) { return vals.length; }, {query:{$or:[{a:2},{b:3}]}} ).counts.input" );
assert.eq.automsg( "5", "t.mapReduce( function() { emit( 'a', this.a ); }, function( key, vals ) { return vals.length; }, {out:{inline:true},query:{$or:[{a:2},{b:3}]}} ).counts.input" );
explain = t.find( {$or:[{a:2},{b:3}]} ).explain();
assert.eq.automsg( "2", "explain.clauses.length" );

View File

@ -60,7 +60,7 @@ r = function( key , v ){
correct = { a : 2 , b : 1 };
function checkMR( t ){
var res = t.mapReduce( m , r );
var res = t.mapReduce( m , r , "basic1_out" );
assert.eq( correct , res.convertToSingleObject() , "checkMR: " + tojson( t ) );
}

View File

@ -108,7 +108,7 @@ r = function( key , v ){
correct = { a : 2 , b : 1 };
function checkMR( t ){
var res = t.mapReduce( m , r );
var res = t.mapReduce( m , r , "xyz" );
assert.eq( correct , res.convertToSingleObject() , "checkMR: " + tojson( t ) );
}

View File

@ -15,7 +15,7 @@ s.printChangeLog();
function map() { emit('count', 1); }
function reduce(key, values) { return Array.sum(values) }
out = db.foo.mapReduce(map, reduce)
out = db.foo.mapReduce(map, reduce,"big_out")
printjson(out) // SERVER-1400
s.stop()

View File

@ -141,7 +141,7 @@ s.adminCommand({movechunk:'test.mr', find:{x:3}, to: s.getServer('test').name }
doMR( "after extra split" );
cmd = { mapreduce : "mr" , map : "emit( " , reduce : "fooz + " };
cmd = { mapreduce : "mr" , map : "emit( " , reduce : "fooz + " , "broken1" };
x = db.runCommand( cmd );
y = s._connections[0].getDB( "test" ).runCommand( cmd );

View File

@ -6,7 +6,7 @@ t.drop()
t.insert( { x : 1 } )
res = t.mapReduce( function(){ emit(1,1); } , function(){ return 1; } );
res = t.mapReduce( function(){ emit(1,1); } , function(){ return 1; } , "xyz" );
printjson( res );
assert.eq( 1 , t.count() , "A1" )