Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions pkg/installers/pip/detect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
package pip_test

import (
"os"
"testing"

"github.com/paketo-buildpacks/packit/v2"
Expand Down Expand Up @@ -50,11 +49,7 @@ func testDetect(t *testing.T, context spec.G, it spec.S) {

context("when BP_PIP_VERSION is set", func() {
it.Before(func() {
Expect(os.Setenv("BP_PIP_VERSION", "some-version")).To(Succeed())
})

it.After(func() {
Expect(os.Unsetenv("BP_PIP_VERSION")).To(Succeed())
t.Setenv("BP_PIP_VERSION", "some-version")
})

it("returns a build plan that provides the version of pip from BP_PIP_VERSION", func() {
Expand Down Expand Up @@ -85,7 +80,7 @@ func testDetect(t *testing.T, context spec.G, it spec.S) {

context("when the provided version is of the form X.Y", func() {
it.Before(func() {
Expect(os.Setenv("BP_PIP_VERSION", "2.11")).To(Succeed())
t.Setenv("BP_PIP_VERSION", "2.11")
})

it("selects the version X.Y.0", func() {
Expand Down Expand Up @@ -118,7 +113,7 @@ func testDetect(t *testing.T, context spec.G, it spec.S) {

context("when the provided version is of the form X.Y.Z", func() {
it.Before(func() {
Expect(os.Setenv("BP_PIP_VERSION", "22.1.3")).To(Succeed())
t.Setenv("BP_PIP_VERSION", "22.1.3")
})

it("selects the exact provided version X.Y.Z", func() {
Expand Down Expand Up @@ -151,7 +146,7 @@ func testDetect(t *testing.T, context spec.G, it spec.S) {

context("when the provided version is of some other form", func() {
it.Before(func() {
Expect(os.Setenv("BP_PIP_VERSION", "some.other")).To(Succeed())
t.Setenv("BP_PIP_VERSION", "some.other")
})

it("selects the exact provided version", func() {
Expand Down
6 changes: 1 addition & 5 deletions pkg/installers/poetry/detect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,7 @@ func testDetect(t *testing.T, context spec.G, it spec.S) {

context("when the BP_POETRY_VERSION is set", func() {
it.Before(func() {
Expect(os.Setenv("BP_POETRY_VERSION", "some-version")).To(Succeed())
})

it.After(func() {
Expect(os.Unsetenv("BP_POETRY_VERSION")).To(Succeed())
t.Setenv("BP_POETRY_VERSION", "some-version")
})

it("returns a plan that requires that version of poetry", func() {
Expand Down
9 changes: 1 addition & 8 deletions pkg/installers/uv/detect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ func testDetect(t *testing.T, context spec.G, it spec.S) {
})

context("when the BP_UV_VERSION is NOT set", func() {
it.Before(func() {
Expect(os.Unsetenv("BP_UV_VERSION")).To(Succeed())
})
it("returns a plan that provides uv", func() {
result, err := detect(packit.DetectContext{
WorkingDir: workingDir,
Expand All @@ -61,11 +58,7 @@ func testDetect(t *testing.T, context spec.G, it spec.S) {

context("when the BP_UV_VERSION is set", func() {
it.Before(func() {
Expect(os.Setenv("BP_UV_VERSION", "some-version")).To(Succeed())
})

it.After(func() {
Expect(os.Unsetenv("BP_UV_VERSION")).To(Succeed())
t.Setenv("BP_UV_VERSION", "some-version")
})

it("returns a plan that requires that version of poetry", func() {
Expand Down
2 changes: 1 addition & 1 deletion pkg/installers/uv/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
func TestUnit(t *testing.T) {
suite := spec.New("uv", spec.Report(report.Terminal{}), spec.Parallel())
suite("Build", testBuild)
suite("Detect", testDetect)
suite("Detect", testDetect, spec.Sequential())
suite("InstallProcess", testUvInstallProcess)
suite("Parser", testUvLockParser)
suite.Run(t)
Expand Down
Loading