Skip to content

Commit

Permalink
cflinuxfs4 compatible integration tests
Browse files Browse the repository at this point in the history
- update all general fixtures to use dotnet 6.x as 3.x is not supported
on cflinuxfs4
- Skip 3.x specific tests on cflinuxfs4
  • Loading branch information
arjun024 committed Aug 4, 2022
1 parent b84f904 commit d56db80
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 9 deletions.
2 changes: 1 addition & 1 deletion fixtures/fsharp/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
This app was generated with the .NET Core CLI version 3.1.413 by running:
This app was generated with the .NET Core CLI by running:
```
dotnet new web -lang "F#" -o fsharp
```
2 changes: 1 addition & 1 deletion fixtures/fsharp/fsharp.fsproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>netcoreapp6.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>netcoreapp6.0</TargetFramework>
<DebugType>portable</DebugType>
<AssemblyName>asp_web_app</AssemblyName>
<OutputType>Exe</OutputType>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>netcoreapp6.0</TargetFramework>
<AssemblyName>console_app</AssemblyName>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>netcoreapp6.0</TargetFramework>
<AssemblyName>some_other.name</AssemblyName>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion fixtures/supply/dotnet_app/msbuild_self_contained.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>netcoreapp6.0</TargetFramework>
<AssemblyName>msbuild_self_contained</AssemblyName>
<OutputType>Exe</OutputType>
<PackageId>msbuild_self_contained</PackageId>
Expand Down
21 changes: 18 additions & 3 deletions src/dotnetcore/integration/default_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package integration_test

import (
"fmt"
"os"
"path/filepath"
"testing"
"time"
Expand Down Expand Up @@ -34,11 +35,14 @@ func testDefault(t *testing.T, context spec.G, it spec.S) {
bpDir, err := cutlass.FindRoot()
Expect(err).NotTo(HaveOccurred())

latest31RuntimeVersion = GetLatestDepVersion(t, "dotnet-runtime", "3.1.x", bpDir)
// cflinuxfs4 does not support 3.1
if os.Getenv("CF_STACK") != "cflinuxfs4" {
latest31RuntimeVersion = GetLatestDepVersion(t, "dotnet-runtime", "3.1.x", bpDir)

latest31ASPNetVersion = GetLatestDepVersion(t, "dotnet-aspnetcore", "3.1.x", bpDir)
latest31ASPNetVersion = GetLatestDepVersion(t, "dotnet-aspnetcore", "3.1.x", bpDir)

latest31SDKVersion = GetLatestDepVersion(t, "dotnet-sdk", "3.1.x", bpDir)
latest31SDKVersion = GetLatestDepVersion(t, "dotnet-sdk", "3.1.x", bpDir)
}

latest6RuntimeVersion = GetLatestDepVersion(t, "dotnet-runtime", "6.0.x", bpDir)

Expand All @@ -64,6 +68,11 @@ func testDefault(t *testing.T, context spec.G, it spec.S) {
})

context("with dotnet sdk 3.1 in global json", func() {
it.Before(func() {
// 3.1 not supported on cflinuxfs4
SkipOnCflinuxfs4(t)
})

context("when the sdk exists", func() {
it.Before(func() {
app = ReplaceFileTemplate(t, filepath.Join(settings.FixturesPath, "source_apps", "simple_global_json"), "global.json", "sdk_version", latest31SDKVersion)
Expand Down Expand Up @@ -169,6 +178,8 @@ func testDefault(t *testing.T, context spec.G, it spec.S) {
context("when an app has a Microsoft.AspNetCore.App", func() {
context("with version 3.1", func() {
it.Before(func() {
// 3.1 not supported on cflinuxfs4
SkipOnCflinuxfs4(t)
app = cutlass.New(filepath.Join(settings.FixturesPath, "source_apps", "aspnet_package_reference"))
app.Disk = "2G"
})
Expand Down Expand Up @@ -201,6 +212,8 @@ func testDefault(t *testing.T, context spec.G, it spec.S) {
context("when the app has Microsoft.AspNetCore.All", func() {
context("with version 3.1", func() {
it.Before(func() {
// 3.1 not supported on cflinuxfs4
SkipOnCflinuxfs4(t)
app = cutlass.New(filepath.Join(settings.FixturesPath, "source_apps", "source_3.1"))
app.Disk = "1G"
})
Expand Down Expand Up @@ -265,6 +278,8 @@ func testDefault(t *testing.T, context spec.G, it spec.S) {
context("deploying a framework-dependent app", func() {
context("with Microsoft.AspNetCore.App 3.1", func() {
it.Before(func() {
// 3.1 not supported on cflinuxfs4
SkipOnCflinuxfs4(t)
app = cutlass.New(filepath.Join(settings.FixturesPath, "fdd_apps", "simple"))
app.Disk = "2G"
})
Expand Down
6 changes: 6 additions & 0 deletions src/dotnetcore/integration/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,3 +167,9 @@ func ReplaceFileTemplate(t *testing.T, pathToFixture, file, templateVar, replace

return cutlass.New(dir)
}

func SkipOnCflinuxfs4(t *testing.T) {
if os.Getenv("CF_STACK") == "cflinuxfs4" {
t.Skip("Skipping test not relevant for stack cflinuxfs4")
}
}
2 changes: 2 additions & 0 deletions src/dotnetcore/integration/supply_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ func testSupply(t *testing.T, context spec.G, it spec.S) {
context("with no csproj file", func() {
context("the app is pushed once", func() {
it.Before(func() {
// Staticfile does not support cflinuxfs4 yet
SkipOnCflinuxfs4(t)
app = cutlass.New(filepath.Join(settings.FixturesPath, "supply", "staticfile_app"))
app.Buildpacks = []string{
"dotnet_core_buildpack",
Expand Down

0 comments on commit d56db80

Please sign in to comment.