Пример #1
0
        public async Task Darc_AzDoFlow_NonBatched_AllChecksSuccessful()
        {
            TestContext.WriteLine("AzDo Dependency Flow, non-batched, all checks successful");

            TestParameters parameters = await TestParameters.GetAsync();

            SetTestParameters(parameters);
            EndToEndFlowLogic testLogic = new EndToEndFlowLogic(parameters);

            await testLogic.NonBatchedAzDoFlowTestBase(
                $"AzDo_NonBatchedTestBranch_AllChecks_{Environment.MachineName}",
                $"AzDo Non-Batched All Checks Channel {Environment.MachineName}",
                source1Assets,
                expectedAzDoDependenciesSource1,
                allChecks : true).ConfigureAwait(true);
        }
Пример #2
0
        public async Task Darc_AzDoFlow_FeedFlow()
        {
            TestContext.WriteLine("AzDo Dependency Feed Flow, non-batched");

            // Feed flow test strings
            string proxyFeed      = "https://some-proxy.azurewebsites.net/container/some-container/sig/somesig/se/2020-02-02/darc-int-maestro-test1-bababababab-1/index.json";
            string azdoFeed1      = "https://some_org.pkgs.visualstudio.com/_packaging/darc-int-maestro-test1-aaabaababababe-1/nuget/v3/index.json";
            string azdoFeed2      = "https://some_org.pkgs.visualstudio.com/_packaging/darc-int-maestro-test1-bbbbaababababd-1/nuget/v3/index.json";
            string azdoFeed3      = "https://some_org.pkgs.visualstudio.com/_packaging/darc-int-maestro-test1-cccbaababababf-1/nuget/v3/index.json";
            string regularFeed    = "https://dotnetfeed.blob.core.windows.net/maestro-test1/index.json";
            string buildContainer = "https://dev.azure.com/dnceng/internal/_apis/build/builds/9999999/artifacts";

            string[] expectedFeeds    = { proxyFeed, azdoFeed1, azdoFeed3 };
            string[] notExpectedFeeds = { regularFeed, azdoFeed2, buildContainer };

            IImmutableList <AssetData> feedFlowSourceAssets = ImmutableList.Create(
                GetAssetDataWithLocations(
                    "Foo",
                    "1.1.0",
                    proxyFeed,
                    LocationType.NugetFeed
                    ),
                GetAssetDataWithLocations(
                    "Bar",
                    "2.1.0",
                    azdoFeed1,
                    LocationType.NugetFeed),
                GetAssetDataWithLocations(
                    "Pizza",
                    "3.1.0",
                    azdoFeed2,
                    LocationType.NugetFeed,
                    regularFeed,
                    LocationType.NugetFeed
                    ),
                GetAssetDataWithLocations(
                    "Hamburger",
                    "4.1.0",
                    azdoFeed3,
                    LocationType.NugetFeed,
                    buildContainer,
                    LocationType.Container)
                );

            TestContext.WriteLine("Azure DevOps Internal feed flow");
            TestParameters parameters = await TestParameters.GetAsync();

            SetTestParameters(parameters);

            EndToEndFlowLogic testLogic = new EndToEndFlowLogic(parameters);

            List <DependencyDetail> expectedAzDoFeedFlowDependencies = new List <DependencyDetail>();

            DependencyDetail feedFoo = new DependencyDetail
            {
                Name      = "Foo",
                Version   = "1.1.0",
                RepoUri   = GetAzDoRepoUrl(TestRepository.TestRepo1Name),
                Commit    = TestRepository.CoherencyTestRepo1Commit,
                Type      = DependencyType.Product,
                Pinned    = false,
                Locations = new List <string> {
                    proxyFeed
                }
            };

            expectedAzDoFeedFlowDependencies.Add(feedFoo);

            DependencyDetail feedBar = new DependencyDetail
            {
                Name      = "Bar",
                Version   = "2.1.0",
                RepoUri   = GetAzDoRepoUrl(TestRepository.TestRepo1Name),
                Commit    = TestRepository.CoherencyTestRepo1Commit,
                Type      = DependencyType.Product,
                Pinned    = false,
                Locations = new List <string> {
                    azdoFeed1
                }
            };

            expectedAzDoFeedFlowDependencies.Add(feedBar);

            DependencyDetail feedPizza = new DependencyDetail
            {
                Name      = "Pizza",
                Version   = "3.1.0",
                RepoUri   = GetAzDoRepoUrl(TestRepository.TestRepo1Name),
                Commit    = TestRepository.CoherencyTestRepo1Commit,
                Type      = DependencyType.Product,
                Pinned    = false,
                Locations = new List <string> {
                    azdoFeed2, regularFeed
                }
            };

            expectedAzDoFeedFlowDependencies.Add(feedPizza);

            DependencyDetail feedHamburger = new DependencyDetail
            {
                Name      = "Hamburger",
                Version   = "4.1.0",
                RepoUri   = GetAzDoRepoUrl(TestRepository.TestRepo1Name),
                Commit    = TestRepository.CoherencyTestRepo1Commit,
                Type      = DependencyType.Product,
                Pinned    = false,
                Locations = new List <string> {
                    azdoFeed3, buildContainer
                }
            };

            expectedAzDoFeedFlowDependencies.Add(feedHamburger);
            await testLogic.NonBatchedAzDoFlowTestBase(
                $"AzDo_FeedFlowBranch_{Environment.MachineName}",
                $"AzDo_FeedFlowChannel_{Environment.MachineName}",
                feedFlowSourceAssets,
                expectedAzDoFeedFlowDependencies,
                isFeedTest : true,
                expectedFeeds : expectedFeeds,
                notExpectedFeeds : notExpectedFeeds).ConfigureAwait(false);
        }