public void AddPackageToWindows8CuratedFeed()
        {
            string packageId       = testContextInstance.TestName + DateTime.Now.Ticks.ToString();
            string packageFullPath = PackageCreationHelper.CreateWindows8CuratedPackage(packageId);
            int    exitCode        = CmdLineHelper.UploadPackage(packageFullPath, UrlHelper.V2FeedPushSourceUrl);

            Assert.IsTrue((exitCode == 0), "The package upload via Nuget.exe didnt suceed properly. Check the logs to see the process error and output stream");
            //check if the package is present in windows 8 feed.
            //TBD : Need to check the exact the url for curated feed.
            System.Threading.Thread.Sleep(60000);
            Assert.IsTrue(ClientSDKHelper.CheckIfPackageExistsInSource(packageId, UrlHelper.Windows8CuratedFeedUrl), "Package {0} is not found in the site {1} after uploading.", packageId, UrlHelper.Windows8CuratedFeedUrl);
        }
 public static void CheckIfBaseTestPackageExists()
 {
     //Check if the BaseTestPackage exists in current source and if not upload it. This will be used by the download related tests.
     try
     {
         if (!ClientSDKHelper.CheckIfPackageExistsInSource(Constants.TestPackageId, UrlHelper.V2FeedRootUrl))
         {
             AssertAndValidationHelper.UploadNewPackageAndVerify(Constants.TestPackageId);
         }
     }
     catch (AssertFailedException)
     {
         Assert.Inconclusive("The initialization method to pre-upload test package has failed. Hence failing all the tests. Make sure that a package by name {0} exists @ {1} before running tests. Check test run error for details", Constants.TestPackageId, UrlHelper.BaseUrl);
     }
 }
Exemple #3
0
        public bool CheckPackageExistInCuratedFeed(string packageName, FeedType feedType)
        {
            string curatedFeedUrl = GetCuratedFeedUrl(feedType);
            bool   applied        = false;

            for (int i = 0; i < 10 && applied == false; i++)
            {
                System.Threading.Thread.Sleep(30 * 1000);
                if (ClientSDKHelper.CheckIfPackageExistsInSource(packageName, curatedFeedUrl))
                {
                    applied = true;
                }
            }
            return(applied);
        }
 public static void AssemblyInit(TestContext context)
 {
     //Check if functional tests is enabled. If not, do an assert inconclusive.
     if (!EnvironmentSettings.RunFunctionalTests.Equals("True", StringComparison.OrdinalIgnoreCase))
     {
         Assert.Inconclusive("Functional tests are disabled in the current run. Please set environment variable RunFuntionalTests to True to enable them");
     }
     //Check if the BaseTestPackage exists in current source and if not upload it. This will be used by the download related tests.
     try
     {
         if (!ClientSDKHelper.CheckIfPackageExistsInSource(Constants.TestPackageId, UrlHelper.V2FeedRootUrl))
         {
             AssertAndValidationHelper.UploadNewPackageAndVerify(Constants.TestPackageId);
         }
     }
     catch (AssertFailedException)
     {
         Assert.Inconclusive("The initialization method to pre-upload test package has failed. Hence failing all the tests. Make sure that a package by name {0} exists @ {1} before running tests. Check test run error for details", Constants.TestPackageId, UrlHelper.BaseUrl);
     }
 }
Exemple #5
0
        public void SearchWebMatrixCuratedFeed()
        {
            string packageName     = "NuGetGallery.FunctionalTests.SearchWebMatrixCuratedFeed";
            string ticks           = DateTime.Now.Ticks.ToString();
            string version         = new System.Version(ticks.Substring(0, 6) + "." + ticks.Substring(6, 6) + "." + ticks.Substring(12, 6)).ToString();
            string packageFullPath = PackageCreationHelper.CreateWebMatrixCuratedPackage(packageName, version);

            int exitCode = CmdLineHelper.UploadPackage(packageFullPath, UrlHelper.V2FeedPushSourceUrl);

            Assert.IsTrue((exitCode == 0), "The package upload via Nuget.exe didnt suceed properly. Check the logs to see the process error and output stream");

            // The feed could update anytime in the next 5 minutes and this test would be considered a success.
            bool applied = false;

            for (int i = 0; i < 10 && applied == false; i++)
            {
                System.Threading.Thread.Sleep(30000);
                if (ClientSDKHelper.CheckIfPackageExistsInSource(packageName, UrlHelper.WebMatrixCuratedFeedUrl))
                {
                    applied = true;
                }
            }
            Assert.IsTrue(applied, "Package {0} is not found in the site {1} after uploading.", packageName, UrlHelper.WebMatrixCuratedFeedUrl);
        }