コード例 #1
0
        public LeakyAzureBlobStorageTest()
        {
            ITestSettings settings = Settings.Instance;

            _storage = StorageFactory.Blobs.AzureBlobStorage(settings.AzureStorageName, settings.AzureStorageKey);
            _native  = (IAzureBlobStorage)_storage;
        }
コード例 #2
0
 public DocumentationScenarios()
 {
     _settings = new ConfigurationBuilder <ITestSettings>()
                 .UseIniFile("c:\\tmp\\integration-tests.ini")
                 .UseEnvironmentVariables()
                 .Build();
 }
コード例 #3
0
 protected override IBlobStorage CreateStorage(ITestSettings settings)
 {
     return(StorageFactory.Blobs.GoogleCloudStorageFromJson(
                settings.GcpStorageBucketName,
                settings.GcpStorageJsonCreds,
                true));
 }
コード例 #4
0
 protected override IMessageReceiver CreateReceiver(ITestSettings settings) =>
 StorageFactory.Messages.AzureStorageQueueReceiver(
     settings.AzureStorageName,
     settings.AzureStorageKey,
     settings.AzureStorageQueueName,
     TimeSpan.FromMinutes(1),
     TimeSpan.FromMilliseconds(500));
コード例 #5
0
 protected override IMessageReceiver CreateReceiver(ITestSettings settings) =>
 StorageFactory.Messages.AmazonSQSMessageReceiver(
     settings.AwsAccessKeyId,
     settings.AwsSecretAccessKey,
     "https://sqs.us-east-1.amazonaws.com",
     "integration",
     RegionEndpoint.USEast1);
コード例 #6
0
ファイル: AttachTests.cs プロジェクト: optikos/MIEngine
        public void CompileKitchenSinkForAttach(ITestSettings settings)
        {
            this.TestPurpose("Compiles the kitchen sink debuggee for attach.");
            this.WriteSettings(settings);

            IDebuggee debuggee = SinkHelper.OpenAndCompile(this, settings.CompilerSettings, DebuggeeMonikers.KitchenSink.Attach);
        }
コード例 #7
0
        public void BreakpointSettingsVerification(ITestSettings settings)
        {
            this.TestPurpose("Tests supported breakpoint settings");
            this.WriteSettings(settings);

            IDebuggee debuggee = SinkHelper.Open(this, settings.CompilerSettings, DebuggeeMonikers.KitchenSink.Breakpoint);

            using (IDebuggerRunner runner = CreateDebugAdapterRunner(settings))
            {
                this.Comment("Configure launch");
                runner.Launch(settings.DebuggerSettings, debuggee);

                Assert.True(runner.InitializeResponse.body.supportsConditionalBreakpoints.HasValue &&
                            runner.InitializeResponse.body.supportsConditionalBreakpoints.Value == true, "Conditional breakpoints should be supported");

                Assert.True(runner.InitializeResponse.body.supportsFunctionBreakpoints.HasValue &&
                            runner.InitializeResponse.body.supportsFunctionBreakpoints.Value == true, "Function breakpoints should be supported");

                this.Comment("Run to completion");
                runner.Expects.ExitedEvent()
                .TerminatedEvent()
                .AfterConfigurationDone();

                runner.DisconnectAndVerify();
            }
        }
コード例 #8
0
 protected override IBlobStorage CreateStorage(ITestSettings settings)
 {
     return(StorageFactory.Blobs.AmazonS3BlobStorage(
                settings.AwsAccessKeyId,
                settings.AwsSecretAccessKey,
                settings.AwsTestBucketName));
 }
コード例 #9
0
        protected KeyValueStorageTest(string name)
        {
            _settings = new ConfigurationBuilder <ITestSettings>()
                        .UseIniFile("c:\\tmp\\integration-tests.ini")
                        .UseEnvironmentVariables()
                        .Build();

            _name = name;

            if (_name == "csv-files")
            {
                _tables = StorageFactory.KeyValue.CsvFiles(TestDir);
            }
            else if (_name == "azure")
            {
                _tables = StorageFactory.KeyValue.AzureTableStorage(
                    _settings.AzureStorageName,
                    _settings.AzureStorageKey);
            }
            else if (_name == "azure-emulator")
            {
                _tables = StorageFactory.KeyValue.AzureTableDevelopmentStorage();
            }

            _tableName = "TableStorageTest" + Guid.NewGuid().ToString().Replace("-", "");
        }
コード例 #10
0
        public BlobStorageProviderTest(string type)
        {
            _settings = new ConfigurationBuilder <ITestSettings>()
                        .UseIniFile("c:\\tmp\\integration-tests.ini")
                        .UseEnvironmentVariables()
                        .Build();

            _type = type;

            switch (_type)
            {
            case "azure":
                _provider = new AzureBlobStorageProvider(
                    _settings.AzureStorageName,
                    _settings.AzureStorageKey,
                    "blobstoragetest");
                break;

            case "azure-sas":
                _provider = StorageFactory.Blobs.AzureBlobStorageByContainerSasUri(_settings.AzureContainerSasUri);
                break;

            case "azure-datalakestore":
                //Console.WriteLine("ac: {0}, tid: {1}, pid: {2}, ps: {3}", _settings.AzureDataLakeStoreAccountName, _settings.AzureDataLakeTenantId, _settings.AzureDataLakePrincipalId, _settings.AzureDataLakePrincipalSecret);

                _provider = StorageFactory.Blobs.AzureDataLakeStoreByClientSecret(
                    _settings.AzureDataLakeStoreAccountName,
                    _settings.AzureDataLakeTenantId,
                    _settings.AzureDataLakePrincipalId,
                    _settings.AzureDataLakePrincipalSecret);
                break;

            case "disk-directory":
                _provider = StorageFactory.Blobs.DirectoryFiles(TestDir);
                break;

            case "zip":
                _provider = StorageFactory.Blobs.ZipFile(Path.Combine(TestDir.FullName, "test.zip"));
                break;

            case "aws-s3":
                _provider = new AwsS3BlobStorageProvider(
                    _settings.AwsAccessKeyId,
                    _settings.AwsSecretAccessKey,
                    _settings.AwsTestBucketName);
                break;

            case "inmemory":
                _provider = StorageFactory.Blobs.InMemory();
                break;

            case "azurekeyvault":
                _provider = StorageFactory.Blobs.AzureKeyVault(
                    _settings.KeyVaultUri,
                    _settings.KeyVaultCreds);
                break;
            }

            _bs = new BlobStorage(_provider);
        }
コード例 #11
0
ファイル: ExpressionTests.cs プロジェクト: optikos/MIEngine
        public void CompileKitchenSinkForExpressionTests(ITestSettings settings)
        {
            this.TestPurpose("Compile kitchen sink debuggee for expression tests.");
            this.WriteSettings(settings);

            IDebuggee debuggee = SinkHelper.OpenAndCompile(this, settings.CompilerSettings, DebuggeeMonikers.KitchenSink.Expression);
        }
コード例 #12
0
        public void CompileSourceMapForSourceMapping(ITestSettings settings)
        {
            this.TestPurpose("Compiles source map debuggee for source mapping.");
            this.WriteSettings(settings);

            IDebuggee debuggee = SourceMappingHelper.OpenAndCompile(this, settings.CompilerSettings, DebuggeeMonikers.SourceMapping.Default);
        }
コード例 #13
0
        public void CompileKitchenSinkForBreakpointTests(ITestSettings settings)
        {
            this.TestPurpose("Compiles the kitchen sink debuggee.");
            this.WriteSettings(settings);

            IDebuggee debuggee = SinkHelper.OpenAndCompile(this, settings.CompilerSettings, DebuggeeMonikers.KitchenSink.Breakpoint);
        }
コード例 #14
0
ファイル: ExpressionTests.cs プロジェクト: optikos/MIEngine
        public void EvaluateInvalidExpression(ITestSettings settings)
        {
            this.TestPurpose("To test invalid expression evaluation return apropriate errors.");
            this.WriteSettings(settings);

            IDebuggee debuggee = SinkHelper.Open(this, settings.CompilerSettings, DebuggeeMonikers.KitchenSink.Expression);

            using (IDebuggerRunner runner = CreateDebugAdapterRunner(settings))
            {
                this.Comment("Configure launch.");
                runner.Launch(settings.DebuggerSettings, debuggee, "-fExpression");

                this.Comment("Set a breakpoint so that we can stop at a line.");
                runner.SetBreakpoints(debuggee.Breakpoints(SinkHelper.Expression, 31));

                this.Comment("To start debugging and hit breakpoint.");
                runner.Expects.HitBreakpointEvent().AfterConfigurationDone();

                using (IThreadInspector threadInspector = runner.GetThreadInspector())
                {
                    IFrameInspector currentFrame = threadInspector.Stack.First();

                    this.Comment("To evaluate some invalid expression on curren stack frame.");
                    currentFrame.AssertEvaluateAsError("notExistVar", EvaluateContext.Watch);
                }

                this.Comment("Continue to run to exist.");
                runner.Expects.TerminatedEvent().AfterContinue();

                runner.DisconnectAndVerify();
            }
        }
コード例 #15
0
        public LeakyAmazonS3StorageTest()
        {
            _settings = Settings.Instance;

            _storage = (IAwsS3BlobStorage)StorageFactory.Blobs.AwsS3(
                _settings.AwsAccessKeyId, _settings.AwsSecretAccessKey, null, _settings.AwsTestBucketName, _settings.AwsTestBucketRegion);
        }
コード例 #16
0
        /// <summary>
        /// Compile the shared library
        /// </summary>
        private void CompileSharedLib(ITestSettings settings, int debuggeeMoniker)
        {
            IDebuggee debuggee = Debuggee.Create(this, settings.CompilerSettings, debuggeeName, debuggeeMoniker, outLibName, CompilerOutputType.SharedLibrary);

            debuggee.AddSourceFiles(srcLibName);
            debuggee.Compile();
        }
コード例 #17
0
        protected TableStorageTest(string name)
        {
            _settings = new ConfigurationBuilder <ITestSettings>()
                        .UseIniFile("c:\\tmp\\integration-tests.ini")
                        .UseEnvironmentVariables()
                        .Build();

            _name = name;

            if (_name == "csv-files")
            {
                _tables = StorageFactory.Tables.CsvFiles(TestDir);
            }
            else if (_name == "azure")
            {
                _tables = StorageFactory.Tables.AzureTableStorage(
                    _settings.AzureStorageName,
                    _settings.AzureStorageKey);
            }
            else if (_name == "mssql")
            {
                _tables = StorageFactory.Tables.MssqlServer(
                    _settings.MssqlConnectionString);
            }

            /*else if(_name == "esent")
             * {
             * _tables = StorageFactory.Tables.Esent(
             *    Path.Combine(TestDir.FullName, "test.edb"));
             * }*/

            _tableName = "TableStorageTest" + Guid.NewGuid().ToString().Replace("-", "");
            //_tableName = "TableStorageTest";
        }
コード例 #18
0
ファイル: ExpressionTests.cs プロジェクト: optikos/MIEngine
        public void CallStackBasic(ITestSettings settings)
        {
            this.TestPurpose("To check all frames of callstack on a thead and evaluation on each frame.");
            this.WriteSettings(settings);

            IDebuggee debuggee = SinkHelper.Open(this, settings.CompilerSettings, DebuggeeMonikers.KitchenSink.Expression);

            this.Comment("Here are stack frames in a list we expect the actual to match with this.");
            StackFrame[] expectedstackFrames = ExpressionTests.GenerateFramesList(settings.DebuggerSettings);

            using (IDebuggerRunner runner = CreateDebugAdapterRunner(settings))
            {
                this.Comment("Configure launch.");
                runner.Launch(settings.DebuggerSettings, debuggee, "-fExpression");

                this.Comment("Set a breakpoint so that we can stop after starting debugging.");
                runner.SetBreakpoints(debuggee.Breakpoints(SinkHelper.Expression, 19));

                this.Comment("To start debugging and break");
                runner.Expects.StoppedEvent(StoppedReason.Breakpoint, SinkHelper.Expression, 19).AfterConfigurationDone();

                this.Comment("To step in several times into the innermost layer of a recursive call.");
                runner.ExpectStepAndStepToTarget(SinkHelper.Expression, 9, 10).AfterStepIn();
                runner.Expects.HitStepEvent(SinkHelper.Expression, 12).AfterStepIn();
                runner.ExpectStepAndStepToTarget(SinkHelper.Expression, 9, 10).AfterStepIn();
                runner.Expects.HitStepEvent(SinkHelper.Expression, 12).AfterStepIn();
                runner.ExpectStepAndStepToTarget(SinkHelper.Expression, 9, 10).AfterStepIn();

                using (IThreadInspector threadInspector = runner.GetThreadInspector())
                {
                    IEnumerable <IFrameInspector> stackOfCurrentThread = threadInspector.Stack;
                    this.Comment("To verify the count of stack frames count.");
                    Assert.True(stackOfCurrentThread.Count() >= 13, "Expected the stack frame count to be at least 13 deep");

                    this.Comment("To verify each frame, include frame name, line number and source name.");
                    int index = 0;
                    foreach (IFrameInspector frame in stackOfCurrentThread)
                    {
                        if (index >= 13)
                        {
                            break;
                        }
                        StackFrame expectedstackFrame = expectedstackFrames[index];
                        this.Comment("Comparing Names. Expecected: {0}, Actual: {1}", expectedstackFrame.Name, frame.Name);
                        Assert.Contains(expectedstackFrame.Name, frame.Name, StringComparison.Ordinal);
                        this.Comment("Comparing line number. Expecected: {0}, Actual: {1}", expectedstackFrame.Line, frame.Line);
                        Assert.Equal(expectedstackFrame.Line, frame.Line);
                        this.Comment("Comparing Source Name. Expecected: {0}, Actual: {1}", expectedstackFrame.SourceName, frame.SourceName);
                        Assert.Equal(expectedstackFrame.SourceName, frame.SourceName);
                        index++;
                    }
                }

                this.Comment("Continue to run to exist.");
                runner.Expects.TerminatedEvent().AfterContinue();

                runner.DisconnectAndVerify();
            }
        }
コード例 #19
0
        public void CompileExceptionDebuggee(ITestSettings settings)
        {
            this.TestPurpose("Create and compile the 'exception' debuggee");
            this.WriteSettings(settings);

            this.Comment("Compile the application");
            CompileApp(this, settings, DebuggeeMonikers.Exception.Default);
        }
コード例 #20
0
        protected override IBlobStorage CreateStorage(ITestSettings settings)
        {
            return(StorageFactory.Blobs.AzureDataLakeStorageWithSharedKey(
                       settings.AzureDataLakeGen2Name,
                       settings.AzureDataLakeGen2Key));

            //return StorageFactory.Blobs.AzureDataLakeGen2StoreBySharedAccessKey(settings.AzureDataLakeGen2Name, settings.AzureDataLakeGen2Key);
        }
コード例 #21
0
 protected override IMessenger CreateMessenger(ITestSettings settings)
 {
     return(StorageFactory.Messages.AwsSQS(
                settings.AwsAccessKeyId,
                settings.AwsSecretAccessKey,
                "https://sqs.us-east-1.amazonaws.com",
                RegionEndpoint.USEast1));
 }
コード例 #22
0
        public LeakyAdlsGen2StorageTest()
        {
            _settings = Settings.Instance;

            _storage = StorageFactory.Blobs.AzureDataLakeGen2StoreBySharedAccessKey(
                _settings.AzureDataLakeGen2Name,
                _settings.AzureDataLakeGen2Key);
        }
コード例 #23
0
 protected override IBlobStorage CreateStorage(ITestSettings settings)
 {
     return(StorageFactory.Blobs.AzureKeyVault(
                settings.KeyVaultUri,
                settings.KeyVaultTenantId,
                settings.KeyVaultClientId,
                settings.KeyVaultSecret));
 }
コード例 #24
0
 protected override IBlobStorage CreateStorage(ITestSettings settings)
 {
     return(StorageFactory.Blobs.AzureDataLakeGen1StoreByClientSecret(
                settings.AzureGen1StorageName,
                settings.TenantId,
                settings.ClientId,
                settings.ClientSecret));
 }
コード例 #25
0
        protected override IBlobStorage CreateStorage(ITestSettings settings)
        {
            IVirtualStorage vs = StorageFactory.Blobs.Virtual();

            vs.Mount("/", StorageFactory.Blobs.InMemory());
            vs.Mount("/mnt/s0", StorageFactory.Blobs.InMemory());
            return(vs);
        }
コード例 #26
0
 public void MergeSettings(ITestSettings settings)
 {
     ExtensionDirectories.Add(settings.ExtensionsDirectory);
     if (settings.DebugMixedMode)
     {
         DebugMixedMode = true;
     }
 }
コード例 #27
0
        public void SharedLibBasic(ITestSettings settings)
        {
            this.TestPurpose("This test checks to see if basic debugging scenarios work for application invoked shared library.");
            this.WriteSettings(settings);

            this.Comment("Start running targeted scenarios");
            RunTargetedScenarios(settings, outAppName, DebuggeeMonikers.SharedLib.Default);
        }
コード例 #28
0
 protected override IBlobStorage CreateStorage(ITestSettings settings)
 {
     return(StorageFactory.Blobs.AzureDataLakeGen1StoreByClientSecret(
                settings.AzureDataLakeStoreAccountName,
                settings.AzureDataLakeTenantId,
                settings.AzureDataLakePrincipalId,
                settings.AzureDataLakePrincipalSecret));
 }
コード例 #29
0
 public LeakyAdlsGen2StorageTest()
 {
     _settings = Settings.Instance;
     _storage  = StorageFactory.Blobs.AzureDataLakeStorageWithAzureAd(
         _settings.AzureDataLakeGen2Name,
         _settings.AzureDataLakeGen2TenantId,
         _settings.AzureDataLakeGen2PrincipalId,
         _settings.AzureDataLakeGen2PrincipalSecret);
 }
コード例 #30
0
 protected override IBlobStorage CreateStorage(ITestSettings settings)
 {
     return(StorageFactory.Blobs.AwsS3(
                settings.AwsAccessKeyId,
                settings.AwsSecretAccessKey,
                null,
                settings.AwsTestBucketName,
                settings.AwsTestBucketRegion));
 }