コード例 #1
0
ファイル: TestResultStorage.cs プロジェクト: jaredpar/jenkins
        public void Add(string key, TestResult value)
        {
            if (string.IsNullOrEmpty(value.ResultsFileContent) || value.ResultsFileContent.Length > SizeLimit)
            {
                throw new Exception("Data too big");
            }

            var blob = TestResultsContainer.GetBlockBlobReference(key);

            var obj = new TestResultJson()
            {
                ExitCode = value.ExitCode,
                OutputStandard = value.OutputStandard,
                OutputError = value.OutputError,
                ResultsFileName = value.ResultsFileName,
                ResultsFileContent = value.ResultsFileContent,
                ElapsedSeconds = value.Elapsed.TotalSeconds,
                Passed = value.UnitTestData.Passed,
                Failed = value.UnitTestData.Failed,
                Skipped = value.UnitTestData.Skipped
            };

            var str = JsonConvert.SerializeObject(obj);
            blob.UploadText(str);
        }
コード例 #2
0
ファイル: TestResultStorage.cs プロジェクト: karelz/jenkins
        public void Add(string key, TestResult value)
        {
            if (string.IsNullOrEmpty(value.ResultsFileContent) || value.ResultsFileContent.Length > SizeLimit)
            {
                throw new Exception("Data too big");
            }

            var container = _storage.TestResultsContainer;
            var blob      = container.GetBlockBlobReference(key);

            var obj = new TestResultJson()
            {
                ExitCode           = value.ExitCode,
                OutputStandard     = value.OutputStandard,
                OutputError        = value.OutputError,
                ResultsFileName    = value.ResultsFileName,
                ResultsFileContent = value.ResultsFileContent,
                ElapsedSeconds     = value.Elapsed.TotalSeconds,
                Passed             = value.UnitTestData.Passed,
                Failed             = value.UnitTestData.Failed,
                Skipped            = value.UnitTestData.Skipped
            };

            var str = JsonConvert.SerializeObject(obj);

            blob.UploadText(str);
        }