protected override Task <RunSummary> RunTestCollectionAsync(IMessageBus messageBus, ITestCollection testCollection, IEnumerable <IXunitTestCase> testCases, CancellationTokenSource cancellationTokenSource) { Task <RunSummary> result = null; ExecutionContext.Run(_context, state => result = new CollectionRunner(_assemblyFixtureMappings, testCollection, testCases, DiagnosticMessageSink, messageBus, TestCaseOrderer, new ExceptionAggregator(Aggregator), cancellationTokenSource).RunAsync(), state: null); return(result); }
public override Task <IOperationResult> ExecutePatchQuery(IndexQueryServerSide query, QueryOperationOptions options, PatchRequest patch, BlittableJsonReaderObject patchArgs, DocumentsOperationContext context, Action <IOperationProgress> onProgress, OperationCancelToken token) { var runner = new CollectionRunner(Database, context, query); return(runner.ExecutePatch(query.Metadata.CollectionName, new CollectionOperationOptions { MaxOpsPerSecond = options.MaxOpsPerSecond }, patch, patchArgs, onProgress, token)); }
public override Task <IOperationResult> ExecuteDeleteQuery(IndexQueryServerSide query, QueryOperationOptions options, DocumentsOperationContext context, Action <IOperationProgress> onProgress, OperationCancelToken token) { var runner = new CollectionRunner(Database, context, query); return(runner.ExecuteDelete(query.Metadata.CollectionName, new CollectionOperationOptions { MaxOpsPerSecond = options.MaxOpsPerSecond }, onProgress, token)); }
protected override Task <RunSummary> RunTestCollectionAsync( IMessageBus messageBus, ITestCollection testCollection, IEnumerable <IXunitTestCase> testCases, CancellationTokenSource cancellationTokenSource) { var fixture = new CollectionRunner( assemblyFixtureMappings, testCollection, testCases, DiagnosticMessageSink, messageBus, TestCaseOrderer, new ExceptionAggregator(Aggregator), cancellationTokenSource); return(fixture.RunAsync()); }
private void ExecuteCollectionOperation(Func <CollectionRunner, string, CollectionOperationOptions, Action <IOperationProgress>, OperationCancelToken, Task <IOperationResult> > operation, DocumentsOperationContext context, IDisposable returnContextToPool, DatabaseOperations.PendingOperationType operationType) { var collectionName = GetStringQueryString("name"); var token = CreateTimeLimitedOperationToken(); var collectionRunner = new CollectionRunner(Database, context); var operationId = Database.Operations.GetNextOperationId(); var options = GetCollectionOperationOptions(); var task = Database.Operations.AddOperation(collectionName, operationType, onProgress => operation(collectionRunner, collectionName, options, onProgress, token), operationId, token); task.ContinueWith(_ => returnContextToPool.Dispose()); using (var writer = new BlittableJsonTextWriter(context, ResponseBodyStream())) { writer.WriteOperationId(context, operationId); } }