Skip to content

Commit

Permalink
remove tests expecting multiple patch versions
Browse files Browse the repository at this point in the history
Multiple patches for the same line were removed in
#518
  • Loading branch information
arjun024 committed Mar 11, 2022
1 parent fd60c96 commit e82d481
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 50 deletions.
6 changes: 0 additions & 6 deletions src/dotnetcore/brats/brats_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ var _ = Describe("Dotnet buildpack", func() {

bratshelper.DeployingAnAppWithAnUpdatedVersionOfTheSameBuildpack(CopyBrats)

bratshelper.StagingWithADepThatIsNotTheLatestConstrained(
"dotnet-sdk",
FirstOfVersionLine("dotnet-sdk", "3.1.x"),
func(v string) *cutlass.App { return CopyCSharpBratsWithRuntime(v, "3.1.x") },
)

bratshelper.StagingWithCustomBuildpackWithCredentialsInDependencies(CopyBrats)

bratshelper.DeployAppWithExecutableProfileScript("dotnet-sdk", CopyBrats)
Expand Down
47 changes: 3 additions & 44 deletions src/dotnetcore/integration/default_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ func testDefault(t *testing.T, context spec.G, it spec.S) {

app *cutlass.App

latest31RuntimeVersion, previous31RuntimeVersion string
latest31ASPNetVersion, previous31ASPNetVersion string
latest31SDKVersion, previous31SDKVersion string
latest31RuntimeVersion string
latest31ASPNetVersion string
latest31SDKVersion string
)

it.Before(func() {
Expand All @@ -32,13 +32,10 @@ func testDefault(t *testing.T, context spec.G, it spec.S) {
Expect(err).NotTo(HaveOccurred())

latest31RuntimeVersion = GetLatestDepVersion(t, "dotnet-runtime", "3.1.x", bpDir)
previous31RuntimeVersion = GetLatestDepVersion(t, "dotnet-runtime", fmt.Sprintf("<%s", latest31RuntimeVersion), bpDir)

latest31ASPNetVersion = GetLatestDepVersion(t, "dotnet-aspnetcore", "3.1.x", bpDir)
previous31ASPNetVersion = GetLatestDepVersion(t, "dotnet-aspnetcore", fmt.Sprintf("<%s", latest31ASPNetVersion), bpDir)

latest31SDKVersion = GetLatestDepVersion(t, "dotnet-sdk", "3.1.x", bpDir)
previous31SDKVersion = GetLatestDepVersion(t, "dotnet-sdk", fmt.Sprintf("<%s", latest31SDKVersion), bpDir)
})

it.After(func() {
Expand Down Expand Up @@ -94,20 +91,6 @@ func testDefault(t *testing.T, context spec.G, it spec.S) {
app = ReplaceFileTemplate(t, filepath.Join(settings.FixturesPath, "source_apps", "multi_version_sources"), "global.json", "sdk_version", latest31SDKVersion)
})

context("when SDK versions don't match", func() {
it("installs the specific version from buildpack.yml instead of global.json", func() {
app = ReplaceFileTemplate(t, filepath.Join(settings.FixturesPath, "source_apps", "multi_version_sources"), "buildpack.yml", "sdk_version", previous31SDKVersion)
app.Push()
Expect(app.Stdout.String()).To(ContainSubstring(fmt.Sprintf("Installing dotnet-sdk %s", previous31SDKVersion)))
})

it("installs the floated version from buildpack.yml instead of global.json", func() {
app = ReplaceFileTemplate(t, filepath.Join(settings.FixturesPath, "source_apps", "multi_version_sources"), "buildpack.yml", "sdk_version", "3.1.x")
app.Push()
Expect(app.Stdout.String()).To(ContainSubstring(fmt.Sprintf("Installing dotnet-sdk %s", latest31SDKVersion)))
})
})

context("when SDK version from buildpack.yml is not available", func() {
it("fails due to missing SDK", func() {
app = ReplaceFileTemplate(t, filepath.Join(settings.FixturesPath, "source_apps", "multi_version_sources"), "buildpack.yml", "sdk_version", "2.0.0-preview7")
Expand All @@ -119,19 +102,6 @@ func testDefault(t *testing.T, context spec.G, it spec.S) {
})
})

context("when RuntimeFrameworkVersion is explicitly defined in csproj", func() {
it.Before(func() {
app = ReplaceFileTemplate(t, filepath.Join(settings.FixturesPath, "source_apps", "templated_runtime"), "templated_runtime.csproj", "runtime_version", previous31RuntimeVersion)
app.Disk = "2G"
})

it("publishes and runs, using exact runtime", func() {
PushAppAndConfirm(t, app)
Eventually(app.Stdout.String()).Should(ContainSubstring(fmt.Sprintf("Installing dotnet-runtime %s", previous31RuntimeVersion)))
Expect(app.GetBody("/")).To(ContainSubstring("Hello World!"))
})
})

context("when a 3.1 app has a Microsoft.AspNetCore.App version 3.1", func() {
it.Before(func() {
app = cutlass.New(filepath.Join(settings.FixturesPath, "source_apps", "aspnet_package_reference"))
Expand Down Expand Up @@ -212,17 +182,6 @@ func testDefault(t *testing.T, context spec.G, it spec.S) {
})
})

context("with Microsoft.AspNetCore.App 3.1 and applyPatches false", func() {
it.Before(func() {
app = ReplaceFileTemplate(t, filepath.Join(settings.FixturesPath, "fdd_apps", "templated_framework"), "templated_framework.runtimeconfig.json", "framework_version", previous31ASPNetVersion)
})

it("installs the exact version of dotnet-aspnetcore from the runtimeconfig.json", func() {
PushAppAndConfirm(t, app)
Eventually(app.Stdout.String()).Should(ContainSubstring(fmt.Sprintf("Installing dotnet-aspnetcore %s", previous31ASPNetVersion)))
})
})

context("with libgdiplus", func() {
it.Before(func() {
app = cutlass.New(filepath.Join(settings.FixturesPath, "util", "libgdiplus", "bin", "Release", "netcoreapp3.1", "linux-x64", "publish"))
Expand Down

0 comments on commit e82d481

Please sign in to comment.