diff --git a/phase/builder_test.go b/phase/builder_test.go index 045073076..e4f4fa1e7 100644 --- a/phase/builder_test.go +++ b/phase/builder_test.go @@ -191,8 +191,6 @@ func testBuilder(t *testing.T, when spec.G, it spec.S) { h.AssertContains(t, inputs.TargetEnv, "CNB_TARGET_ARCH=amd64") h.AssertContains(t, inputs.TargetEnv, "CNB_TARGET_ARCH_VARIANT=") h.AssertContains(t, inputs.TargetEnv, "CNB_TARGET_OS=linux") - h.AssertContains(t, inputs.TargetEnv, "CNB_TARGET_DISTRO_NAME=") - h.AssertContains(t, inputs.TargetEnv, "CNB_TARGET_DISTRO_VERSION=") return buildpack.BuildOutputs{}, nil }, ) @@ -205,8 +203,6 @@ func testBuilder(t *testing.T, when spec.G, it spec.S) { h.AssertContains(t, inputs.TargetEnv, "CNB_TARGET_ARCH=amd64") h.AssertContains(t, inputs.TargetEnv, "CNB_TARGET_ARCH_VARIANT=") h.AssertContains(t, inputs.TargetEnv, "CNB_TARGET_OS=linux") - h.AssertContains(t, inputs.TargetEnv, "CNB_TARGET_DISTRO_NAME=") - h.AssertContains(t, inputs.TargetEnv, "CNB_TARGET_DISTRO_VERSION=") return buildpack.BuildOutputs{}, nil }) diff --git a/phase/detector_test.go b/phase/detector_test.go index 6820ef37a..1c0e3be05 100644 --- a/phase/detector_test.go +++ b/phase/detector_test.go @@ -223,8 +223,6 @@ func testDetector(t *testing.T, when spec.G, it spec.S) { h.AssertContains(t, inputs.TargetEnv, "CNB_TARGET_ARCH=amd64") h.AssertContains(t, inputs.TargetEnv, "CNB_TARGET_ARCH_VARIANT=") h.AssertContains(t, inputs.TargetEnv, "CNB_TARGET_OS=linux") - h.AssertContains(t, inputs.TargetEnv, "CNB_TARGET_DISTRO_NAME=") - h.AssertContains(t, inputs.TargetEnv, "CNB_TARGET_DISTRO_VERSION=") return buildpack.DetectOutputs{} }) diff --git a/phase/generator_test.go b/phase/generator_test.go index cd6895bf3..2e4a2fcca 100644 --- a/phase/generator_test.go +++ b/phase/generator_test.go @@ -284,8 +284,8 @@ func testGenerator(t *testing.T, when spec.G, it spec.S) { h.AssertContains(t, inputs.TargetEnv, "CNB_TARGET_ARCH=amd64", "CNB_TARGET_ARCH_VARIANT=", - "CNB_TARGET_DISTRO_NAME=", - "CNB_TARGET_DISTRO_VERSION=", + "CNB_TARGET_DISTRO_NAME=ubuntu", + "CNB_TARGET_DISTRO_VERSION=22.04", "CNB_TARGET_OS=linux", ) return buildpack.GenerateOutputs{Dockerfiles: []buildpack.DockerfileInfo{{ExtensionID: d.Extension.ID, @@ -296,8 +296,8 @@ func testGenerator(t *testing.T, when spec.G, it spec.S) { h.AssertContains(t, inputs.TargetEnv, "CNB_TARGET_ARCH=amd64", "CNB_TARGET_ARCH_VARIANT=", - "CNB_TARGET_DISTRO_NAME=", - "CNB_TARGET_DISTRO_VERSION=", + "CNB_TARGET_DISTRO_NAME=ubuntu", + "CNB_TARGET_DISTRO_VERSION=22.04", "CNB_TARGET_OS=linux", ) return buildpack.GenerateOutputs{Dockerfiles: []buildpack.DockerfileInfo{{ExtensionID: d.Extension.ID, diff --git a/platform/run_image_test.go b/platform/run_image_test.go index e07f4257b..29cc1a54f 100644 --- a/platform/run_image_test.go +++ b/platform/run_image_test.go @@ -211,7 +211,7 @@ func testRunImage(t *testing.T, when spec.G, it spec.S) { t: t, HasFile: false, } - observed := platform.EnvVarsFor(d, tm, nil) + observed := platform.EnvVarsFor(d, tm, &log.Logger{Handler: memory.New()}) h.AssertContains(t, observed, "CNB_TARGET_ARCH="+tm.Arch) h.AssertContains(t, observed, "CNB_TARGET_ARCH_VARIANT="+tm.ArchVariant) h.AssertContains(t, observed, "CNB_TARGET_DISTRO_NAME="+tm.Distro.Name) @@ -221,14 +221,13 @@ func testRunImage(t *testing.T, when spec.G, it spec.S) { }) it("returns the right thing from /etc/os-release", func() { - logr := &log.Logger{Handler: memory.New()} d := &mockDetector{ contents: "this is just test contents really", t: t, HasFile: true, } tm := files.TargetMetadata{Arch: "pentium", ArchVariant: "mmx", ID: "my-id", OS: "linux", Distro: nil} - observed := platform.EnvVarsFor(d, tm, logr) + observed := platform.EnvVarsFor(d, tm, &log.Logger{Handler: memory.New()}) h.AssertContains(t, observed, "CNB_TARGET_ARCH="+tm.Arch) h.AssertContains(t, observed, "CNB_TARGET_ARCH_VARIANT="+tm.ArchVariant) h.AssertContains(t, observed, "CNB_TARGET_DISTRO_NAME=opensesame") @@ -244,7 +243,7 @@ func testRunImage(t *testing.T, when spec.G, it spec.S) { t: t, HasFile: false, } - observed := platform.EnvVarsFor(d, tm, nil) + observed := platform.EnvVarsFor(d, tm, &log.Logger{Handler: memory.New()}) h.AssertContains(t, observed, "CNB_TARGET_ARCH="+tm.Arch) h.AssertContains(t, observed, "CNB_TARGET_OS="+tm.OS) // note: per the spec only the ID field is optional, so I guess the others should always be set: https://github.com/buildpacks/rfcs/blob/main/text/0096-remove-stacks-mixins.md#runtime-metadata