示例#1
0
        private static (string EventsJson, string ResultsJson) ExecuteWorkload(string connectionString, BsonDocument driverWorkload, bool async, CancellationToken astrolabeCancellationToken)
        {
            Environment.SetEnvironmentVariable("MONGODB_URI", connectionString); // force using atlas connection string in our internal test connection strings

            var additionalArgs = new Dictionary <string, object>()
            {
                { "UnifiedLoopOperationCancellationToken", astrolabeCancellationToken }
            };
            var eventFormatters = new Dictionary <string, IEventFormatter>()
            {
                { "events", new AstrolabeEventFormatter() } // "events" matches to the "storeEventsAsEntities.id" in the driverWorkload document
            };

            using (var testRunner = new UnifiedTestFormatTestRunner(
                       allowKillSessions: false,
                       additionalArgs: additionalArgs,
                       eventFormatters: eventFormatters))
            {
                var factory  = new TestCaseFactory();
                var testCase = factory.CreateTestCase(driverWorkload, async);
                testRunner.Run(testCase);
                Console.WriteLine("dotnet ExecuteWorkload> Returning...");
                return(CreateWorkloadResult(entityMap: testRunner.EntityMap));
            }
        }
示例#2
0
        public void TestRegressions(DirectoryInfo testDir)
        {
            var scratchDir     = Directory.CreateDirectory(Constants.ScratchParentDirectory);
            var factory        = new TestCaseFactory(scratchDir);
            var testCasePSharp = factory.CreateTestCase(testDir, CompilerOutput.PSharp);

            TestAssertions.AssertTestCase(testCasePSharp);
        }
示例#3
0
        public void TestRegressions(DirectoryInfo testDir)
        {
            DirectoryInfo    scratchDir     = Directory.CreateDirectory(Constants.ScratchParentDirectory);
            TestCaseFactory  factory        = new TestCaseFactory(scratchDir);
            CompilerTestCase testCaseCoyote = factory.CreateTestCase(testDir, CompilerOutput.Coyote);

            TestAssertions.AssertTestCase(testCaseCoyote);
        }