Skip to content

update texting , uncomment tests + add new test cases #330

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Nov 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/dotnet-install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
.PARAMETER Channel
Default: LTS
Download from the Channel specified. Possible values:
- STS - Standard Term Support SDK
- LTS - the most current Long Term Support release
- STS - the most recent Standard Term Support release
- LTS - the most recent Long Term Support release
- 2-part version in a format A.B - represents a specific release
examples: 2.0, 1.0
- 3-part version in a format A.B.Cxx - represents a specific SDK release
Expand Down
4 changes: 2 additions & 2 deletions src/dotnet-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1622,8 +1622,8 @@ do
echo " -c,--channel <CHANNEL> Download from the channel specified, Defaults to \`$channel\`."
echo " -Channel"
echo " Possible values:"
echo " - STS - Standard Term Support SDK"
echo " - LTS - the most current Long Term Support release"
echo " - STS - the most recent Standard Term Support release"
echo " - LTS - the most recent Long Term Support release"
echo " - 2-part version in a format A.B - represents a specific release"
echo " examples: 2.0; 1.0"
echo " - 3-part version in a format A.B.Cxx - represents a specific SDK release"
Expand Down
38 changes: 21 additions & 17 deletions tests/Install-Scripts.Test/AkaMsLinksTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@

namespace Microsoft.DotNet.InstallationScript.Tests
{
#pragma warning disable xUnit1000 // Test classes must be public
internal class AkaMsLinksTests : TestBase
#pragma warning restore xUnit1000 // Test classes must be public
public class AkaMsLinksTests : TestBase
{
/// <summary>
/// Test verifies E2E the aka.ms resolution for SDK
Expand All @@ -27,7 +25,7 @@ internal class AkaMsLinksTests : TestBase
//[InlineData("5.0", null, @"https://aka.ms/dotnet/5.0/dotnet-sdk-")]
//[InlineData("5.0.1xx", null, @"https://aka.ms/dotnet/5.0.1xx/dotnet-sdk-")]
//[InlineData("5.0.2xx", null, @"https://aka.ms/dotnet/5.0.2xx/dotnet-sdk-")]
//[InlineData("Current", null, @"https://aka.ms/dotnet/current/dotnet-sdk-")]
//[InlineData("STS", null, @"https://aka.ms/dotnet/STS/dotnet-sdk-")]
//[InlineData("LTS", null, @"https://aka.ms/dotnet/LTS/dotnet-sdk-")]
//[InlineData("5.0.2xx", "signed", @"https://aka.ms/dotnet/5.0.2xx/signed/dotnet-sdk-")]
//[InlineData("5.0.2xx", "daily", @"https://aka.ms/dotnet/5.0.2xx/daily/dotnet-sdk-")]
Expand All @@ -42,6 +40,7 @@ internal class AkaMsLinksTests : TestBase
//[InlineData("6.0", "ga", @"https://aka.ms/dotnet/6.0/dotnet-sdk-")]

[InlineData("6.0", "daily", @"https://aka.ms/dotnet/6.0/daily/dotnet-sdk-")]
[InlineData("7.0", "daily", @"https://aka.ms/dotnet/7.0/daily/dotnet-sdk-")]
public void SDK_IntegrationTest(string channel, string quality, string expectedLink)
{
string expectedLinkPattern = Regex.Escape(expectedLink);
Expand Down Expand Up @@ -91,7 +90,7 @@ public void SDK_IntegrationTest(string channel, string quality, string expectedL
//[InlineData("3.0", "dotnet", null, @"https://aka.ms/dotnet/3.0/dotnet-runtime-")]
//[InlineData("3.1", "dotnet", null, @"https://aka.ms/dotnet/3.1/dotnet-runtime-")]
//[InlineData("5.0", "dotnet", null, @"https://aka.ms/dotnet/5.0/dotnet-runtime-")]
//[InlineData("Current", "dotnet", null, @"https://aka.ms/dotnet/current/dotnet-runtime-")]
//[InlineData("STS", "dotnet", null, @"https://aka.ms/dotnet/STS/dotnet-runtime-")]
//[InlineData("LTS", "dotnet", null, @"https://aka.ms/dotnet/LTS/dotnet-runtime-")]
//[InlineData("5.0", "dotnet", "signed", @"https://aka.ms/dotnet/5.0/signed/dotnet-runtime-")]
//[InlineData("5.0", "dotnet", "daily", @"https://aka.ms/dotnet/5.0/daily/dotnet-runtime-")]
Expand All @@ -103,7 +102,7 @@ public void SDK_IntegrationTest(string channel, string quality, string expectedL
//[InlineData("3.0", "aspnetcore", null, @"https://aka.ms/dotnet/3.0/aspnetcore-runtime-")]
//[InlineData("3.1", "aspnetcore", null, @"https://aka.ms/dotnet/3.1/aspnetcore-runtime-")]
//[InlineData("5.0", "aspnetcore", null, @"https://aka.ms/dotnet/5.0/aspnetcore-runtime-")]
//[InlineData("Current", "aspnetcore", null, @"https://aka.ms/dotnet/current/aspnetcore-runtime-")]
//[InlineData("STS", "aspnetcore", null, @"https://aka.ms/dotnet/STS/aspnetcore-runtime-")]
//[InlineData("LTS", "aspnetcore", null, @"https://aka.ms/dotnet/LTS/aspnetcore-runtime-")]
//[InlineData("5.0", "aspnetcore", "signed", @"https://aka.ms/dotnet/5.0/signed/aspnetcore-runtime-")]
//[InlineData("5.0", "aspnetcore", "daily", @"https://aka.ms/dotnet/5.0/daily/aspnetcore-runtime-")]
Expand All @@ -113,7 +112,7 @@ public void SDK_IntegrationTest(string channel, string quality, string expectedL
//[InlineData("3.0", "windowsdesktop", null, @"https://aka.ms/dotnet/3.0/windowsdesktop-runtime-")]
//[InlineData("3.1", "windowsdesktop", null, @"https://aka.ms/dotnet/3.1/windowsdesktop-runtime-")]
//[InlineData("5.0", "windowsdesktop", null, @"https://aka.ms/dotnet/5.0/windowsdesktop-runtime-")]
//[InlineData("Current", "windowsdesktop", null, @"https://aka.ms/dotnet/current/windowsdesktop-runtime-")]
//[InlineData("STS", "windowsdesktop", null, @"https://aka.ms/dotnet/STS/windowsdesktop-runtime-")]
//[InlineData("LTS", "windowsdesktop", null, @"https://aka.ms/dotnet/LTS/windowsdesktop-runtime-")]
//[InlineData("5.0", "windowsdesktop", "signed", @"https://aka.ms/dotnet/5.0/signed/windowsdesktop-runtime-")]
//[InlineData("5.0", "windowsdesktop", "daily", @"https://aka.ms/dotnet/5.0/daily/windowsdesktop-runtime-")]
Expand All @@ -128,6 +127,7 @@ public void SDK_IntegrationTest(string channel, string quality, string expectedL
// [InlineData("6.0", "windowsdesktop", "ga", @"https://aka.ms/dotnet/6.0/windowsdesktop-runtime-")]

[InlineData("6.0", "windowsdesktop", "daily", @"https://aka.ms/dotnet/6.0/daily/windowsdesktop-runtime-")]
[InlineData("7.0", "windowsdesktop", "daily", @"https://aka.ms/dotnet/7.0/daily/windowsdesktop-runtime-")]
public void Runtime_IntegrationTest(string channel, string runtime, string quality, string expectedLink)
{
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && runtime == "windowsdesktop")
Expand Down Expand Up @@ -177,7 +177,7 @@ public void Runtime_IntegrationTest(string channel, string runtime, string quali
[InlineData("5.0", null, false, @"https://aka.ms/dotnet/5.0/dotnet-sdk-")]
[InlineData("5.0.1xx", null, false, @"https://aka.ms/dotnet/5.0.1xx/dotnet-sdk-")]
[InlineData("5.0.2xx", null, false, @"https://aka.ms/dotnet/5.0.2xx/dotnet-sdk-")]
[InlineData("Current", null, false, @"https://aka.ms/dotnet/current/dotnet-sdk-")]
[InlineData("STS", null, false, @"https://aka.ms/dotnet/STS/dotnet-sdk-")]
[InlineData("LTS", null, false, @"https://aka.ms/dotnet/LTS/dotnet-sdk-")]
[InlineData("5.0.2xx", "signed", false, @"https://aka.ms/dotnet/5.0.2xx/signed/dotnet-sdk-")]
[InlineData("5.0.2xx", "daily", false, @"https://aka.ms/dotnet/5.0.2xx/daily/dotnet-sdk-")]
Expand All @@ -186,9 +186,11 @@ public void Runtime_IntegrationTest(string channel, string runtime, string quali
[InlineData("5.0.2xx", "ga", false, @"https://aka.ms/dotnet/5.0.2xx/dotnet-sdk-")]
[InlineData("3.1", null, true, @"https://aka.ms/dotnet/internal/3.1/dotnet-sdk-")]
[InlineData("5.0.2xx", null, true, @"https://aka.ms/dotnet/internal/5.0.2xx/dotnet-sdk-")]
[InlineData("Current", null, true, @"https://aka.ms/dotnet/internal/current/dotnet-sdk-")]
[InlineData("STS", null, true, @"https://aka.ms/dotnet/internal/STS/dotnet-sdk-")]
[InlineData("LTS", null, true, @"https://aka.ms/dotnet/internal/LTS/dotnet-sdk-")]
[InlineData("5.0.2xx", "validated", true, @"https://aka.ms/dotnet/internal/5.0.2xx/validated/dotnet-sdk-")]
[InlineData("6.0.2xx", "validated", true, @"https://aka.ms/dotnet/internal/6.0.2xx/validated/dotnet-sdk-")]
[InlineData("7.0.1xx", "validated", true, @"https://aka.ms/dotnet/internal/7.0.1xx/validated/dotnet-sdk-")]
public void LinkCanBeCreatedForSdk(string channel, string quality, bool isInternal, string expectedLink)
{
string expectedLinkPattern = Regex.Escape(expectedLink);
Expand Down Expand Up @@ -237,7 +239,7 @@ public void LinkCanBeCreatedForSdk(string channel, string quality, bool isIntern
[InlineData("2.1", "dotnet", null, false, @"https://aka.ms/dotnet/2.1/dotnet-runtime-")]
[InlineData("3.1", "dotnet", null, false, @"https://aka.ms/dotnet/3.1/dotnet-runtime-")]
[InlineData("5.0", "dotnet", null, false, @"https://aka.ms/dotnet/5.0/dotnet-runtime-")]
[InlineData("Current", "dotnet", null, false, @"https://aka.ms/dotnet/current/dotnet-runtime-")]
[InlineData("STS", "dotnet", null, false, @"https://aka.ms/dotnet/STS/dotnet-runtime-")]
[InlineData("LTS", "dotnet", null, false, @"https://aka.ms/dotnet/LTS/dotnet-runtime-")]
[InlineData("5.0", "dotnet", "signed", false, @"https://aka.ms/dotnet/5.0/signed/dotnet-runtime-")]
[InlineData("5.0", "dotnet", "daily", false, @"https://aka.ms/dotnet/5.0/daily/dotnet-runtime-")]
Expand All @@ -247,7 +249,7 @@ public void LinkCanBeCreatedForSdk(string channel, string quality, bool isIntern
[InlineData("2.1", "aspnetcore", null, false, @"https://aka.ms/dotnet/2.1/aspnetcore-runtime-")]
[InlineData("3.1", "aspnetcore", null, false, @"https://aka.ms/dotnet/3.1/aspnetcore-runtime-")]
[InlineData("5.0", "aspnetcore", null, false, @"https://aka.ms/dotnet/5.0/aspnetcore-runtime-")]
[InlineData("Current", "aspnetcore", null, false, @"https://aka.ms/dotnet/current/aspnetcore-runtime-")]
[InlineData("STS", "aspnetcore", null, false, @"https://aka.ms/dotnet/STS/aspnetcore-runtime-")]
[InlineData("LTS", "aspnetcore", null, false, @"https://aka.ms/dotnet/LTS/aspnetcore-runtime-")]
[InlineData("5.0", "aspnetcore", "signed", false, @"https://aka.ms/dotnet/5.0/signed/aspnetcore-runtime-")]
[InlineData("5.0", "aspnetcore", "daily", false, @"https://aka.ms/dotnet/5.0/daily/aspnetcore-runtime-")]
Expand All @@ -256,7 +258,7 @@ public void LinkCanBeCreatedForSdk(string channel, string quality, bool isIntern
[InlineData("5.0", "aspnetcore", "ga", false, @"https://aka.ms/dotnet/5.0/aspnetcore-runtime-")]
[InlineData("3.1", "windowsdesktop", null, false, @"https://aka.ms/dotnet/3.1/windowsdesktop-runtime-")]
[InlineData("5.0", "windowsdesktop", null, false, @"https://aka.ms/dotnet/5.0/windowsdesktop-runtime-")]
[InlineData("Current", "windowsdesktop", null, false, @"https://aka.ms/dotnet/current/windowsdesktop-runtime-")]
[InlineData("STS", "windowsdesktop", null, false, @"https://aka.ms/dotnet/STS/windowsdesktop-runtime-")]
[InlineData("LTS", "windowsdesktop", null, false, @"https://aka.ms/dotnet/LTS/windowsdesktop-runtime-")]
[InlineData("5.0", "windowsdesktop", "signed", false, @"https://aka.ms/dotnet/5.0/signed/windowsdesktop-runtime-")]
[InlineData("5.0", "windowsdesktop", "daily", false, @"https://aka.ms/dotnet/5.0/daily/windowsdesktop-runtime-")]
Expand All @@ -265,10 +267,12 @@ public void LinkCanBeCreatedForSdk(string channel, string quality, bool isIntern
[InlineData("5.0", "windowsdesktop", "ga", false, @"https://aka.ms/dotnet/5.0/windowsdesktop-runtime-")]
[InlineData("LTS", "dotnet", null, true, @"https://aka.ms/dotnet/internal/LTS/dotnet-runtime-")]
[InlineData("5.0", "dotnet", "daily", true, @"https://aka.ms/dotnet/internal/5.0/daily/dotnet-runtime-")]
[InlineData("Current", "aspnetcore", null, true, @"https://aka.ms/dotnet/internal/current/aspnetcore-runtime-")]
[InlineData("STS", "aspnetcore", null, true, @"https://aka.ms/dotnet/internal/STS/aspnetcore-runtime-")]
[InlineData("5.0", "aspnetcore", "ga", true, @"https://aka.ms/dotnet/internal/5.0/aspnetcore-runtime-")]
[InlineData("LTS", "windowsdesktop", null, true, @"https://aka.ms/dotnet/internal/LTS/windowsdesktop-runtime-")]
[InlineData("5.0", "windowsdesktop", "ga", true, @"https://aka.ms/dotnet/internal/5.0/windowsdesktop-runtime-")]
[InlineData("6.0", "windowsdesktop", "ga", true, @"https://aka.ms/dotnet/internal/6.0/windowsdesktop-runtime-")]
[InlineData("7.0", "windowsdesktop", "ga", true, @"https://aka.ms/dotnet/internal/7.0/windowsdesktop-runtime-")]
public void LinkCanBeCreatedForGivenRuntime(string channel, string runtime, string quality, bool isInternal, string expectedLink)
{
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && runtime == "windowsdesktop")
Expand Down Expand Up @@ -320,13 +324,13 @@ public void LinkCanBeCreatedForGivenRuntime(string channel, string runtime, stri
}

[Theory]
[InlineData("Current", null, "daily", @"https://aka.ms/dotnet/current/dotnet-sdk-")]
[InlineData("STS", null, "daily", @"https://aka.ms/dotnet/STS/dotnet-sdk-")]
[InlineData("LTS", null, "signed", @"https://aka.ms/dotnet/LTS/dotnet-sdk-")]
[InlineData("Current", "dotnet", "validated", @"https://aka.ms/dotnet/current/dotnet-runtime-")]
[InlineData("STS", "dotnet", "validated", @"https://aka.ms/dotnet/STS/dotnet-runtime-")]
[InlineData("LTS", "dotnet", "preview", @"https://aka.ms/dotnet/LTS/dotnet-runtime-")]
[InlineData("Current", "aspnetcore", "daily", @"https://aka.ms/dotnet/current/aspnetcore-runtime-")]
[InlineData("STS", "aspnetcore", "daily", @"https://aka.ms/dotnet/STS/aspnetcore-runtime-")]
[InlineData("LTS", "aspnetcore", "signed", @"https://aka.ms/dotnet/LTS/aspnetcore-runtime-")]
[InlineData("Current", "windowsdesktop", "validated", @"https://aka.ms/dotnet/current/windowsdesktop-runtime-")]
[InlineData("STS", "windowsdesktop", "validated", @"https://aka.ms/dotnet/STS/windowsdesktop-runtime-")]
[InlineData("LTS", "windowsdesktop", "preview", @"https://aka.ms/dotnet/LTS/windowsdesktop-runtime-")]
public void QualityIsSkippedForLTSAndCurrentChannel(string channel, string runtime, string quality, string expectedLink)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@

namespace Microsoft.DotNet.InstallationScript.Tests
{
#pragma warning disable xUnit1000 // Test classes must be public
internal class GivenThatIWantToGetTheSdkLinksFromAScript : TestBase
#pragma warning restore xUnit1000 // Test classes must be public
public class GivenThatIWantToGetTheSdkLinksFromAScript : TestBase
{
public GivenThatIWantToGetTheSdkLinksFromAScript(VerifySettings settings = null)
: base(settings) { }
Expand Down Expand Up @@ -111,7 +109,7 @@ public void WhenRuntimeParametersArePassedToInstallScripts(string runtime, strin
[InlineData("3.1", "dotnet", true)]
[InlineData("5.0", "dotnet")]
[InlineData("5.0", "dotnet", true)]
[InlineData("Current", "dotnet")]
[InlineData("STS", "dotnet")]
[InlineData("LTS", "dotnet")]
[InlineData("master", "dotnet")]
[InlineData("release/2.1", "dotnet")]
Expand All @@ -120,7 +118,7 @@ public void WhenRuntimeParametersArePassedToInstallScripts(string runtime, strin
[InlineData("release/3.1", "dotnet")]
[InlineData("release/3.1", "dotnet", true)]
// [InlineData("release/5.0", "dotnet")] - Broken
[InlineData("Current", "aspnetcore")]
[InlineData("STS", "aspnetcore")]
[InlineData("LTS", "aspnetcore")]
//[InlineData("1.0", "aspnetcore")] - Broken
//[InlineData("1.1", "aspnetcore")] - Broken
Expand All @@ -136,8 +134,8 @@ public void WhenRuntimeParametersArePassedToInstallScripts(string runtime, strin
//[InlineData("release/3.0", "aspnetcore")] - Broken
//[InlineData("release/3.1", "aspnetcore")] - Broken
//[InlineData("release/5.0", "aspnetcore")] - Broken
[InlineData("Current", "windowsdesktop")]
[InlineData("Current", "windowsdesktop", true)]
[InlineData("STS", "windowsdesktop")]
[InlineData("STS", "windowsdesktop", true)]
[InlineData("LTS", "windowsdesktop")]
[InlineData("3.0", "windowsdesktop")]
[InlineData("3.1", "windowsdesktop")]
Expand Down Expand Up @@ -191,7 +189,7 @@ public void WhenChannelResolvesToASpecificRuntimeVersion(string channel, string
[InlineData("3.0")]
[InlineData("3.1")]
[InlineData("5.0")]
[InlineData("Current")]
[InlineData("STS")]
[InlineData("LTS")]
[InlineData("master")]
[InlineData("release/1.0.0")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@

namespace Microsoft.DotNet.InstallationScript.Tests
{
#pragma warning disable xUnit1000 // Test classes must be public
internal class GivenThatIWantToInstallDotnetFromAScript : IDisposable
#pragma warning restore xUnit1000 // Test classes must be public
public class GivenThatIWantToInstallDotnetFromAScript : IDisposable
{

/// <summary>
Expand All @@ -34,10 +32,10 @@ internal class GivenThatIWantToInstallDotnetFromAScript : IDisposable
("5.0", "5\\.0\\..*", Quality.None),
("6.0", "6\\.0\\..*", Quality.Daily),
("6.0", "6\\.0\\..*", Quality.None),
("Current", "6\\.0\\..*", Quality.None),
("STS", "7\\.0\\..*", Quality.None),
("LTS", "6\\.0\\..*", Quality.None),
("7.0", "7\\.0\\..*", Quality.None),
("7.0", "7\\.0\\..*", Quality.Preview),
("7.0", "7\\.0\\..*", Quality.Ga),
};

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion tests/Install-Scripts.Test/TestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace Microsoft.DotNet.InstallationScript.Tests
{
internal abstract class TestBase : VerifyBase
public abstract class TestBase : VerifyBase
{
protected TestBase(VerifySettings settings = null, [CallerFilePath] string sourceFile = "")
: base(settings, Path.Combine(Path.GetDirectoryName(sourceFile) ?? "", "Assets", "foo.cs")) { }
Expand Down