From 38ccad62ce29aed03dc0ac01ed6122cbda92b39f Mon Sep 17 00:00:00 2001 From: Frankie Gallina-Jones Date: Mon, 8 Nov 2021 14:00:29 -0500 Subject: [PATCH] add watchexec to python language family --- buildpack.toml | 20 ++++++++++++++++++++ integration/conda_test.go | 10 ++++++---- integration/no_package_manager_test.go | 10 ++++++---- integration/pip_test.go | 10 ++++++---- integration/pipenv_test.go | 10 ++++++---- package.toml | 3 +++ 6 files changed, 47 insertions(+), 16 deletions(-) diff --git a/buildpack.toml b/buildpack.toml index 2c7311a4..c2627643 100644 --- a/buildpack.toml +++ b/buildpack.toml @@ -14,6 +14,11 @@ api = "0.5" optional = true version = "2.4.2" + [[order.group]] + id = "paketo-buildpacks/watchexec" + optional = true + version = "1.2.0" + [[order.group]] id = "paketo-buildpacks/cpython" version = "0.7.3" @@ -56,6 +61,11 @@ api = "0.5" optional = true version = "2.4.2" + [[order.group]] + id = "paketo-buildpacks/watchexec" + optional = true + version = "1.2.0" + [[order.group]] id = "paketo-buildpacks/cpython" version = "0.7.3" @@ -94,6 +104,11 @@ api = "0.5" optional = true version = "2.4.2" + [[order.group]] + id = "paketo-buildpacks/watchexec" + optional = true + version = "1.2.0" + [[order.group]] id = "paketo-buildpacks/miniconda" version = "0.2.1" @@ -128,6 +143,11 @@ api = "0.5" optional = true version = "2.4.2" + [[order.group]] + id = "paketo-buildpacks/watchexec" + optional = true + version = "1.2.0" + [[order.group]] id = "paketo-buildpacks/cpython" version = "0.7.3" diff --git a/integration/conda_test.go b/integration/conda_test.go index b38b091d..ea240d70 100644 --- a/integration/conda_test.go +++ b/integration/conda_test.go @@ -63,8 +63,9 @@ func testConda(t *testing.T, context spec.G, it spec.S) { WithBuildpacks(pythonBuildpack). WithPullPolicy("never"). WithEnv(map[string]string{ - "BPE_SOME_VARIABLE": "some-value", - "BP_IMAGE_LABELS": "some-label=some-value", + "BPE_SOME_VARIABLE": "some-value", + "BP_IMAGE_LABELS": "some-label=some-value", + "BP_LIVE_RELOAD_ENABLED": "true", }). Execute(name, source) Expect(err).NotTo(HaveOccurred(), logs.String()) @@ -95,9 +96,10 @@ func testConda(t *testing.T, context spec.G, it spec.S) { Expect(logs).To(ContainLines(ContainSubstring("Procfile Buildpack"))) Expect(logs).To(ContainLines(ContainSubstring("Environment Variables Buildpack"))) Expect(logs).To(ContainLines(ContainSubstring("Image Labels Buildpack"))) + Expect(logs).To(ContainLines(ContainSubstring("Watchexec Buildpack"))) - Expect(image.Buildpacks[5].Key).To(Equal("paketo-buildpacks/environment-variables")) - Expect(image.Buildpacks[5].Layers["environment-variables"].Metadata["variables"]).To(Equal(map[string]interface{}{"SOME_VARIABLE": "some-value"})) + Expect(image.Buildpacks[6].Key).To(Equal("paketo-buildpacks/environment-variables")) + Expect(image.Buildpacks[6].Layers["environment-variables"].Metadata["variables"]).To(Equal(map[string]interface{}{"SOME_VARIABLE": "some-value"})) Expect(image.Labels["some-label"]).To(Equal("some-value")) }) diff --git a/integration/no_package_manager_test.go b/integration/no_package_manager_test.go index 6c5752b9..3c2e26ff 100644 --- a/integration/no_package_manager_test.go +++ b/integration/no_package_manager_test.go @@ -94,8 +94,9 @@ func testNoPackageManager(t *testing.T, context spec.G, it spec.S) { WithBuildpacks(pythonBuildpack). WithPullPolicy("never"). WithEnv(map[string]string{ - "BPE_SOME_VARIABLE": "some-value", - "BP_IMAGE_LABELS": "some-label=some-value", + "BPE_SOME_VARIABLE": "some-value", + "BP_IMAGE_LABELS": "some-label=some-value", + "BP_LIVE_RELOAD_ENABLED": "true", }). Execute(name, source) Expect(err).NotTo(HaveOccurred(), logs.String()) @@ -106,9 +107,10 @@ func testNoPackageManager(t *testing.T, context spec.G, it spec.S) { Expect(logs).To(ContainLines(ContainSubstring("Procfile Buildpack"))) Expect(logs).To(ContainLines(ContainSubstring("Environment Variables Buildpack"))) Expect(logs).To(ContainLines(ContainSubstring("Image Labels Buildpack"))) + Expect(logs).To(ContainLines(ContainSubstring("Watchexec Buildpack"))) - Expect(image.Buildpacks[4].Key).To(Equal("paketo-buildpacks/environment-variables")) - Expect(image.Buildpacks[4].Layers["environment-variables"].Metadata["variables"]).To(Equal(map[string]interface{}{"SOME_VARIABLE": "some-value"})) + Expect(image.Buildpacks[5].Key).To(Equal("paketo-buildpacks/environment-variables")) + Expect(image.Buildpacks[5].Layers["environment-variables"].Metadata["variables"]).To(Equal(map[string]interface{}{"SOME_VARIABLE": "some-value"})) Expect(image.Labels["some-label"]).To(Equal("some-value")) container, err = docker.Container.Run.Execute(image.ID) diff --git a/integration/pip_test.go b/integration/pip_test.go index fbcff476..69af59f7 100644 --- a/integration/pip_test.go +++ b/integration/pip_test.go @@ -63,8 +63,9 @@ func testPip(t *testing.T, context spec.G, it spec.S) { WithBuildpacks(pythonBuildpack). WithPullPolicy("never"). WithEnv(map[string]string{ - "BPE_SOME_VARIABLE": "some-value", - "BP_IMAGE_LABELS": "some-label=some-value", + "BPE_SOME_VARIABLE": "some-value", + "BP_IMAGE_LABELS": "some-label=some-value", + "BP_LIVE_RELOAD_ENABLED": "true", }). Execute(name, source) Expect(err).NotTo(HaveOccurred(), logs.String()) @@ -96,9 +97,10 @@ func testPip(t *testing.T, context spec.G, it spec.S) { Expect(logs).To(ContainLines(ContainSubstring("Procfile Buildpack"))) Expect(logs).To(ContainLines(ContainSubstring("Environment Variables Buildpack"))) Expect(logs).To(ContainLines(ContainSubstring("Image Labels Buildpack"))) + Expect(logs).To(ContainLines(ContainSubstring("Watchexec Buildpack"))) - Expect(image.Buildpacks[6].Key).To(Equal("paketo-buildpacks/environment-variables")) - Expect(image.Buildpacks[6].Layers["environment-variables"].Metadata["variables"]).To(Equal(map[string]interface{}{"SOME_VARIABLE": "some-value"})) + Expect(image.Buildpacks[7].Key).To(Equal("paketo-buildpacks/environment-variables")) + Expect(image.Buildpacks[7].Layers["environment-variables"].Metadata["variables"]).To(Equal(map[string]interface{}{"SOME_VARIABLE": "some-value"})) Expect(image.Labels["some-label"]).To(Equal("some-value")) }) diff --git a/integration/pipenv_test.go b/integration/pipenv_test.go index e9348304..b20e7ebb 100644 --- a/integration/pipenv_test.go +++ b/integration/pipenv_test.go @@ -63,8 +63,9 @@ func testPipenv(t *testing.T, context spec.G, it spec.S) { WithBuildpacks(pythonBuildpack). WithPullPolicy("never"). WithEnv(map[string]string{ - "BPE_SOME_VARIABLE": "some-value", - "BP_IMAGE_LABELS": "some-label=some-value", + "BPE_SOME_VARIABLE": "some-value", + "BP_IMAGE_LABELS": "some-label=some-value", + "BP_LIVE_RELOAD_ENABLED": "true", }). Execute(name, source) Expect(err).NotTo(HaveOccurred(), logs.String()) @@ -97,9 +98,10 @@ func testPipenv(t *testing.T, context spec.G, it spec.S) { Expect(logs).To(ContainLines(ContainSubstring("Procfile Buildpack"))) Expect(logs).To(ContainLines(ContainSubstring("Environment Variables Buildpack"))) Expect(logs).To(ContainLines(ContainSubstring("Image Labels Buildpack"))) + Expect(logs).To(ContainLines(ContainSubstring("Watchexec Buildpack"))) - Expect(image.Buildpacks[7].Key).To(Equal("paketo-buildpacks/environment-variables")) - Expect(image.Buildpacks[7].Layers["environment-variables"].Metadata["variables"]).To(Equal(map[string]interface{}{"SOME_VARIABLE": "some-value"})) + Expect(image.Buildpacks[8].Key).To(Equal("paketo-buildpacks/environment-variables")) + Expect(image.Buildpacks[8].Layers["environment-variables"].Metadata["variables"]).To(Equal(map[string]interface{}{"SOME_VARIABLE": "some-value"})) Expect(image.Labels["some-label"]).To(Equal("some-value")) }) diff --git a/package.toml b/package.toml index fb48b107..d61331a8 100644 --- a/package.toml +++ b/package.toml @@ -37,3 +37,6 @@ [[dependencies]] uri = "docker://gcr.io/paketo-buildpacks/image-labels:3.2.3" + +[[dependencies]] + uri = "docker://gcr.io/paketo-buildpacks/watchexec:1.2.0"