From b1d967ca8c2a674d96fc2987566013955e11dfa0 Mon Sep 17 00:00:00 2001 From: Pavel Busko Date: Tue, 13 Dec 2022 16:11:32 +0100 Subject: [PATCH] address feedback --- tomcat/build.go | 2 +- tomcat/build_test.go | 12 +++--------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/tomcat/build.go b/tomcat/build.go index c2a2ff5..7ad19b2 100644 --- a/tomcat/build.go +++ b/tomcat/build.go @@ -129,7 +129,7 @@ func (b Build) Build(context libcnb.BuildContext) (libcnb.BuildResult, error) { if !versionExists && !shaExists { v = time.Now().Format(time.RFC3339) - b.Logger.Infof("No BP_TOMCAT_EXT_CONF_VERSION or BP_TOMCAT_EXT_CONF_SHA256 provided, using version '%s'", v) + b.Logger.Infof(color.YellowString("WARNING: No BP_TOMCAT_EXT_CONF_VERSION or BP_TOMCAT_EXT_CONF_SHA256 provided, so no layer caching will occur.")) } externalConfigurationDependency = &libpak.BuildpackDependency{ diff --git a/tomcat/build_test.go b/tomcat/build_test.go index 77a883e..90c9e0b 100644 --- a/tomcat/build_test.go +++ b/tomcat/build_test.go @@ -370,15 +370,9 @@ func testBuild(t *testing.T, context spec.G, it spec.S) { } ctx.StackID = "test-stack-id" - Expect(os.Setenv("BP_TOMCAT_EXT_CONF_SHA256", "test-sha256")).To(Succeed()) - Expect(os.Setenv("BP_TOMCAT_EXT_CONF_URI", "test-uri")).To(Succeed()) - Expect(os.Setenv("BP_TOMCAT_EXT_CONF_VERSION", "test-version")).To(Succeed()) - }) - - it.After(func() { - Expect(os.Unsetenv("BP_TOMCAT_EXT_CONF_SHA256")).To(Succeed()) - Expect(os.Unsetenv("BP_TOMCAT_EXT_CONF_URI")).To(Succeed()) - Expect(os.Unsetenv("BP_TOMCAT_EXT_CONF_VERSION")).To(Succeed()) + t.Setenv("BP_TOMCAT_EXT_CONF_SHA256", "test-sha256") + t.Setenv("BP_TOMCAT_EXT_CONF_URI", "test-uri") + t.Setenv("BP_TOMCAT_EXT_CONF_VERSION", "test-version") }) it("contributes external configuration when $BP_TOMCAT_EXT_CONF_URI, $BP_TOMCAT_EXT_CONF_VERSION and $BP_TOMCAT_EXT_CONF_SHA256 are set", func() {