Skip to content

Commit 3364ff6

Browse files
committed
Remove functional tests depending on auto-curation of packages (#6493)
Progress on #6469
1 parent 5f3979a commit 3364ff6

7 files changed

Lines changed: 2 additions & 158 deletions

File tree

tests/NuGetGallery.FunctionalTests.Core/Helpers/PackageCreationHelper.cs

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -39,35 +39,6 @@ public async Task<string> CreatePackage(string packageName, string version = "1.
3939
return path;
4040
}
4141

42-
/// <summary>
43-
/// Creates a windows 8 curated package given the package name and version.
44-
/// </summary>
45-
/// <param name="packageName"></param>
46-
/// <param name="version"></param>
47-
/// <returns></returns>
48-
public async Task<string> CreateWindows8CuratedPackage(string packageName, string version = "1.0.0")
49-
{
50-
var nuspecHelper = new NuspecHelper(TestOutputHelper);
51-
string nuspecFileFullPath = await nuspecHelper.CreateDefaultNuspecFile(packageName, version);
52-
NuspecHelper.AddWindows8Tag(nuspecFileFullPath);
53-
return await CreatePackageInternal(nuspecFileFullPath);
54-
}
55-
56-
/// <summary>
57-
/// Creates a windows 8 curated package given the package name and version.
58-
/// </summary>
59-
/// <param name="packageName"></param>
60-
/// <param name="version"></param>
61-
/// <returns></returns>
62-
public async Task<string> CreateWebMatrixCuratedPackage(string packageName, string version = "1.0.0")
63-
{
64-
var nuspecHelper = new NuspecHelper(TestOutputHelper);
65-
string nuspecFileFullPath = await nuspecHelper.CreateDefaultNuspecFile(packageName, version);
66-
NuspecHelper.AddWebMatrixTag(nuspecFileFullPath);
67-
return await CreatePackageInternal(nuspecFileFullPath);
68-
}
69-
70-
7142
/// <summary>
7243
/// Creates a package with the specified minclient version.
7344
/// </summary>

tests/NuGetGallery.FunctionalTests.Core/Helpers/UrlHelper.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ public class UrlHelper
2424
private const string _uploadPageUrlSuffix = "packages/manage/Upload";
2525
private const string _cancelUploadPageUrlSuffix = "packages/manage/cancel-upload";
2626
private const string _verifyUploadPageUrlSuffix = "/packages/manage/verify-upload";
27-
private const string _windows8CuratedFeedUrlSuffix = "curated-feeds/windows8-packages/";
28-
private const string _webMatrixCuratedFeedUrlSuffix = "curated-feeds/webmatrix/";
2927
private const string _dotnetCuratedFeedUrlSuffix = "curated-feeds/microsoftdotnet/";
3028
private const string _accountPageUrlSuffix = "/account";
3129
private const string _accountUnscribeUrlSuffix = "account/subscription/change";
@@ -146,16 +144,6 @@ public static string LogonPageUrlOnPackageUpload
146144
get { return BaseUrl + _logonPageUrlOnPackageUploadSuffix; }
147145
}
148146

149-
public static string Windows8CuratedFeedUrl
150-
{
151-
get { return V2FeedRootUrl + _windows8CuratedFeedUrlSuffix; }
152-
}
153-
154-
public static string WebMatrixCuratedFeedUrl
155-
{
156-
get { return V2FeedRootUrl + _webMatrixCuratedFeedUrlSuffix; }
157-
}
158-
159147
public static string DotnetCuratedFeedUrl
160148
{
161149
get { return V2FeedRootUrl + _dotnetCuratedFeedUrlSuffix; }

tests/NuGetGallery.FunctionalTests/NuGetGallery.FunctionalTests.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@
8484
<Compile Include="Commandline\NuGetCommandLineTests.cs" />
8585
<Compile Include="Commandline\NuGetCoreTests.cs" />
8686
<Compile Include="ODataFeeds\CuratedFeedTest.cs" />
87-
<Compile Include="ODataFeeds\FeedType.cs" />
8887
<Compile Include="ODataFeeds\SearchTest.cs" />
8988
<Compile Include="ODataFeeds\V2FeedExtendedTests.cs" />
9089
<Compile Include="PackageCreation\ApiPushTests.cs" />

tests/NuGetGallery.FunctionalTests/ODataFeeds/CuratedFeedTest.cs

Lines changed: 1 addition & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
using System.ComponentModel;
66
using System.IO;
77
using System.Net;
8-
using System.Threading;
98
using System.Threading.Tasks;
109
using Xunit;
1110
using Xunit.Abstractions;
@@ -47,49 +46,13 @@ public async Task SearchMicrosoftDotNetCuratedFeed()
4746
Assert.Contains(packageUrl.ToLowerInvariant(), responseText.ToLowerInvariant());
4847
}
4948

50-
[Fact]
51-
[Description("Performs a querystring-based search of the Windows 8 curated feed. Confirms expected packages are returned.")]
52-
[Priority(0)]
53-
[Category("P0Tests")]
54-
public async Task SearchWindows8CuratedFeed()
55-
{
56-
string packageName = "NuGetGallery.FunctionalTests.SearchWindows8CuratedFeed";
57-
string ticks = DateTime.Now.Ticks.ToString();
58-
string version = new Version(ticks.Substring(0, 6) + "." + ticks.Substring(6, 6) + "." + ticks.Substring(12, 6)).ToString();
59-
60-
int exitCode = await UploadPackageToCuratedFeed(packageName, version, FeedType.Windows8CuratedFeed);
61-
Assert.True((exitCode == 0), Constants.UploadFailureMessage);
62-
63-
bool applied = CheckPackageExistInCuratedFeed(packageName, FeedType.Windows8CuratedFeed);
64-
var userMessage = string.Format(Constants.PackageNotFoundAfterUpload, packageName, UrlHelper.Windows8CuratedFeedUrl);
65-
Assert.True(applied, userMessage);
66-
}
67-
68-
[Fact]
69-
[Description("Performs a querystring-based search of the WebMatrix curated feed. Confirms expected packages are returned.")]
70-
[Priority(0)]
71-
[Category("P0Tests")]
72-
public async Task SearchWebMatrixCuratedFeed()
73-
{
74-
string packageName = "NuGetGallery.FunctionalTests.SearchWebMatrixCuratedFeed";
75-
string ticks = DateTime.Now.Ticks.ToString();
76-
string version = new Version(ticks.Substring(0, 6) + "." + ticks.Substring(6, 6) + "." + ticks.Substring(12, 6)).ToString();
77-
78-
int exitCode = await UploadPackageToCuratedFeed(packageName, version, FeedType.WebMatrixCuratedFeed);
79-
Assert.True((exitCode == 0), Constants.UploadFailureMessage);
80-
81-
bool applied = CheckPackageExistInCuratedFeed(packageName, FeedType.WebMatrixCuratedFeed);
82-
var userMessage = string.Format(Constants.PackageNotFoundAfterUpload, packageName, UrlHelper.WebMatrixCuratedFeedUrl);
83-
Assert.True(applied, userMessage);
84-
}
85-
8649
[Fact]
8750
[Description("Validates the microsoftdotnet feed, including the next page link")]
8851
[Priority(1)]
8952
[Category("P1Tests")]
9053
public async Task ValidateMicrosoftDotNetCuratedFeed()
9154
{
92-
var request = WebRequest.Create(GetCuratedFeedUrl(FeedType.DotnetCuratedFeed) + "Packages");
55+
var request = WebRequest.Create(UrlHelper.DotnetCuratedFeedUrl + "Packages");
9356
var response = await request.GetResponseAsync();
9457

9558
string responseText;
@@ -121,68 +84,5 @@ public async Task ValidateMicrosoftDotNetCuratedFeed()
12184
}
12285
}
12386
}
124-
125-
private async Task<int> UploadPackageToCuratedFeed(string packageName, string version, FeedType feedType)
126-
{
127-
string packageFullPath = string.Empty;
128-
switch (feedType)
129-
{
130-
case FeedType.Windows8CuratedFeed:
131-
packageFullPath = await _packageCreationHelper.CreateWindows8CuratedPackage(packageName, version);
132-
break;
133-
case FeedType.WebMatrixCuratedFeed:
134-
packageFullPath = await _packageCreationHelper.CreateWindows8CuratedPackage(packageName, version);
135-
break;
136-
}
137-
var processResult = await _commandlineHelper.UploadPackageAsync(packageFullPath, UrlHelper.V2FeedPushSourceUrl);
138-
return processResult.ExitCode;
139-
}
140-
141-
private string GetCuratedFeedUrl(FeedType type)
142-
{
143-
string url = string.Empty;
144-
switch (type)
145-
{
146-
case FeedType.Windows8CuratedFeed:
147-
url = UrlHelper.Windows8CuratedFeedUrl;
148-
break;
149-
case FeedType.WebMatrixCuratedFeed:
150-
url = UrlHelper.WebMatrixCuratedFeedUrl;
151-
break;
152-
case FeedType.DotnetCuratedFeed:
153-
url = UrlHelper.DotnetCuratedFeedUrl;
154-
break;
155-
}
156-
return url;
157-
}
158-
159-
private bool CheckPackageExistInCuratedFeed(string packageName, FeedType feedType)
160-
{
161-
string curatedFeedUrl = GetCuratedFeedUrl(feedType);
162-
var maxAttempts = 10;
163-
var interval = 30;
164-
bool applied = false;
165-
166-
TestOutputHelper.WriteLine("Starting package verification checks ({0} attempts, interval {1} seconds).", maxAttempts, interval);
167-
168-
for (int i = 0; i < maxAttempts && applied == false; i++)
169-
{
170-
TestOutputHelper.WriteLine("[verification attempt {0}]: Waiting {1} seconds before next check...", i, interval);
171-
if (i != 0)
172-
{
173-
Thread.Sleep(interval * 1000);
174-
}
175-
else
176-
{
177-
Thread.Sleep(5000);
178-
}
179-
180-
if (_clientSdkHelper.CheckIfPackageExistsInSource(packageName, curatedFeedUrl))
181-
{
182-
applied = true;
183-
}
184-
}
185-
return applied;
186-
}
18787
}
18888
}

tests/NuGetGallery.FunctionalTests/ODataFeeds/FeedType.cs

Lines changed: 0 additions & 12 deletions
This file was deleted.

tests/NuGetGallery.FunctionalTests/ODataFeeds/SearchTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public async Task SearchV1Feed()
2828
}
2929

3030
[Fact]
31-
[Description("Performs a querystring-based search of the default (non-curated) v2 feed. Confirms expected packages are returned.")]
31+
[Description("Performs a querystring-based search of the v2 feed. Confirms expected packages are returned.")]
3232
[Priority(0)]
3333
[Category("P0Tests")]
3434
public async Task SearchV2Feed()

tests/NuGetGallery.FunctionalTests/Security/HttpToHttpsRedirectTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ public class HttpToHttpsRedirectTests
2222
new object[] { UrlHelper.AggregateStatsPageUrl },
2323
new object[] { UrlHelper.UploadPageUrl },
2424
new object[] { UrlHelper.VerifyUploadPageUrl },
25-
new object[] { UrlHelper.Windows8CuratedFeedUrl },
26-
new object[] { UrlHelper.WebMatrixCuratedFeedUrl },
2725
};
2826

2927
public static IEnumerable<object[]> UrlsExcludedFromRedirect => new[]

0 commit comments

Comments
 (0)