コード例 #1
0
ファイル: BuildQueue.cs プロジェクト: paulcbetts/peasant
        public async Task FullBuildIntegrationTest()
        {
            var cache = new TestBlobCache();
            var client = new GitHubClient(new ProductHeaderValue("Peasant"));

            var fixture = new BuildQueue(client, cache);
            using (fixture.Start()) {
                var result = await fixture.Enqueue(TestBuild.RepoUrl, TestBuild.PassingBuildSHA1, TestBuild.BuildScriptUrl);
            }
        }
コード例 #2
0
ファイル: BuildQueue.cs プロジェクト: paulcbetts/peasant
        public async Task BuildsThatFailShouldBeRecorded()
        {
            var cache = new TestBlobCache();
            var client = new GitHubClient(new ProductHeaderValue("Peasant"));

            var fixture = new BuildQueue(client, cache, async (q, o) => {
                throw new Exception("Didn't work lol");
            });

            fixture.Start();

            var queueItem = await fixture.Enqueue(TestBuild.RepoUrl, TestBuild.PassingBuildSHA1, TestBuild.BuildScriptUrl);

            Assert.NotNull(queueItem);
            Assert.False(queueItem.BuildSucceded.Value);

            fixture = new BuildQueue(client, cache);
            var result = await fixture.GetBuildOutput(queueItem.BuildId);

            Assert.True(result.Item1.Contains("Didn't work lol"));
            Assert.NotEqual(0, result.Item2);
        }
コード例 #3
0
ファイル: BuildQueue.cs プロジェクト: paulcbetts/peasant
        public async Task BuildsThatSucceedShouldBeRecorded()
        {
            var cache = new TestBlobCache();
            var client = new GitHubClient(new ProductHeaderValue("Peasant"));

            var fixture = new BuildQueue(client, cache, (q, o) => {
                return Task.FromResult(0);
            });

            fixture.Start();

            var queueItem = await fixture.Enqueue(TestBuild.RepoUrl, TestBuild.PassingBuildSHA1, TestBuild.BuildScriptUrl);

            Assert.NotNull(queueItem);
            Assert.True(queueItem.BuildSucceded.Value);

            fixture = new BuildQueue(client, cache);
            var result = await fixture.GetBuildOutput(queueItem.BuildId);

            Assert.Equal(0, result.Item2);
        }