Skip to content

Commit

Permalink
Merge pull request #1913 from buildpacks/update/bp-api
Browse files Browse the repository at this point in the history
Update acceptance fixtures to use newer Buildpack API versions
  • Loading branch information
jkutner authored Sep 19, 2023
2 parents 491fd83 + 175282a commit 3a994bd
Show file tree
Hide file tree
Showing 24 changed files with 63 additions and 45 deletions.
28 changes: 12 additions & 16 deletions acceptance/acceptance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -794,23 +794,19 @@ func testAcceptance(
})

it("creates builder", func() {
// Linux containers (including Linux containers on Windows)
extSimpleLayersDiffID := "sha256:b9e4a0ddfb650c7aa71d1e6aceea1665365e409b3078bfdc1e51c2b07ab2b423"
extReadEnvDiffID := "sha256:4490d78f2b056cdb99ad9cd3892f3c0617c5a485fb300dd90c572ce375ee45b2"
bpSimpleLayersDiffID := "sha256:285ff6683c99e5ae19805f6a62168fb40dca64d813c53b782604c9652d745c70"
bpReadEnvDiffID := "sha256:dd1e0efcbf3f08b014ef6eff9cfe7a9eac1cf20bd9b6a71a946f0a74575aa56f"
if imageManager.HostOS() == "windows" { // Windows containers on Windows
extSimpleLayersDiffID = "sha256:a063cf949b9c267133e451ac8cd95b4e77571bb7c629dd817461dca769170810"
extReadEnvDiffID = "sha256:ae9520eef7d84f69da6adf2597266660ce3fa5fd8ddac716cbfbecb67ded50e5"
bpSimpleLayersDiffID = "sha256:ccd1234cc5685e8a412b70c5f9a8e7b584b8e4f2a20c987ec242c9055de3e45e"
bpReadEnvDiffID = "sha256:8b22a7742ffdfbdd978787c6937456b68afb27c3585a3903048be7434d251e3f"
if imageManager.HostOS() != "windows" {
// Linux containers (including Linux containers on Windows)
extSimpleLayersDiffID := "sha256:d24758b8b75b13292746fe7a06666f28a9499da31826a60afe6ee6b8cba29b73"
extReadEnvDiffID := "sha256:4490d78f2b056cdb99ad9cd3892f3c0617c5a485fb300dd90c572ce375ee45b2"
bpSimpleLayersDiffID := "sha256:ade9da86859fa4ea50a513757f9b242bf1038667abf92dad3d018974a17f0ea7"
bpReadEnvDiffID := "sha256:db0797077ba8deff7054ab5578133b8f0206b6393de34b5bfd795cf50f6afdbd"
// extensions
assertImage.HasLabelWithData(builderName, "io.buildpacks.extension.layers", `{"read/env":{"read-env-version":{"api":"0.9","layerDiffID":"`+extReadEnvDiffID+`","name":"Read Env Extension"}},"simple/layers":{"simple-layers-version":{"api":"0.7","layerDiffID":"`+extSimpleLayersDiffID+`","name":"Simple Layers Extension"}}}`)
assertImage.HasLabelWithData(builderName, "io.buildpacks.buildpack.order-extensions", `[{"group":[{"id":"read/env","version":"read-env-version"},{"id":"simple/layers","version":"simple-layers-version"}]}]`)
// buildpacks
assertImage.HasLabelWithData(builderName, "io.buildpacks.buildpack.layers", `{"read/env":{"read-env-version":{"api":"0.7","stacks":[{"id":"pack.test.stack"}],"layerDiffID":"`+bpReadEnvDiffID+`","name":"Read Env Buildpack"}},"simple/layers":{"simple-layers-version":{"api":"0.7","stacks":[{"id":"pack.test.stack"}],"layerDiffID":"`+bpSimpleLayersDiffID+`","name":"Simple Layers Buildpack"}}}`)
assertImage.HasLabelWithData(builderName, "io.buildpacks.buildpack.order", `[{"group":[{"id":"read/env","version":"read-env-version","optional":true},{"id":"simple/layers","version":"simple-layers-version","optional":true}]}]`)
}
// extensions
assertImage.HasLabelWithData(builderName, "io.buildpacks.extension.layers", `{"read/env":{"read-env-version":{"api":"0.9","layerDiffID":"`+extReadEnvDiffID+`","name":"Read Env Extension"}},"simple/layers":{"simple-layers-version":{"api":"0.2","layerDiffID":"`+extSimpleLayersDiffID+`","name":"Simple Layers Extension"}}}`)
assertImage.HasLabelWithData(builderName, "io.buildpacks.buildpack.order-extensions", `[{"group":[{"id":"read/env","version":"read-env-version"},{"id":"simple/layers","version":"simple-layers-version"}]}]`)
// buildpacks
assertImage.HasLabelWithData(builderName, "io.buildpacks.buildpack.layers", `{"read/env":{"read-env-version":{"api":"0.2","stacks":[{"id":"pack.test.stack"}],"layerDiffID":"`+bpReadEnvDiffID+`","name":"Read Env Buildpack"}},"simple/layers":{"simple-layers-version":{"api":"0.2","stacks":[{"id":"pack.test.stack"}],"layerDiffID":"`+bpSimpleLayersDiffID+`","name":"Simple Layers Buildpack"}}}`)
assertImage.HasLabelWithData(builderName, "io.buildpacks.buildpack.order", `[{"group":[{"id":"read/env","version":"read-env-version","optional":true},{"id":"simple/layers","version":"simple-layers-version","optional":true}]}]`)
})

when("build", func() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
api = "0.2"
api = "0.7"

[buildpack]
id = "descriptor/bp"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
api = "0.2"
api = "0.7"

[buildpack]
id = "internet/bp"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
api = "0.2"
api = "0.7"

[buildpack]
id = "local/meta-bp-dep"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
api = "0.2"
api = "0.7"

[buildpack]
id = "local/meta-bp"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
api = "0.2"
api = "0.7"

[buildpack]
id = "simple/nested-level-1"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
api = "0.2"
api = "0.7"

[buildpack]
id = "simple/nested-level-2"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
api = "0.2"
api = "0.7"

[buildpack]
id = "noop.buildpack"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
api = "0.2"
api = "0.7"

[buildpack]
id = "noop.buildpack"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
api = "0.2"
api = "0.7"

[buildpack]
id = "local/bp"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
api = "0.2"
api = "0.7"

[buildpack]
id = "other/stack/bp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ if [[ -f "$platform_dir/env/ENV1_CONTENTS" ]]; then
contents=$(cat "$platform_dir/env/ENV1_CONTENTS")
echo "$contents" > "$launch_dir/env1-launch-layer/env1-launch-dep"
ln -snf "$launch_dir/env1-launch-layer" env1-launch-deps
echo "launch = true" > "$launch_dir/env1-launch-layer.toml"
echo "[types]" > "$launch_dir/env1-launch-layer.toml"
echo "launch = true" >> "$launch_dir/env1-launch-layer.toml"
fi

## makes a launch layer
Expand All @@ -26,7 +27,8 @@ if [[ -f "$platform_dir/env/ENV2_CONTENTS" ]]; then
contents=$(cat "$platform_dir/env/ENV2_CONTENTS")
echo "$contents" > "$launch_dir/env2-launch-layer/env2-launch-dep"
ln -snf "$launch_dir/env2-launch-layer" env2-launch-deps
echo "launch = true" > "$launch_dir/env2-launch-layer.toml"
echo "[types]" > "$launch_dir/env2-launch-layer.toml"
echo "launch = true" >> "$launch_dir/env2-launch-layer.toml"
fi

echo "---> Done"
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ if exist %platform_dir%\env\ENV1_CONTENTS (
set /p contents=<%platform_dir%\env\ENV1_CONTENTS
echo !contents!> %launch_dir%\env1-launch-layer\env1-launch-dep
mklink /j env1-launch-deps %launch_dir%\env1-launch-layer
echo launch = true> %launch_dir%\env1-launch-layer.toml
echo [types] > %launch_dir%\env1-launch-layer.toml
echo launch = true >> %launch_dir%\env1-launch-layer.toml
)

:: makes a launch layer
Expand All @@ -21,7 +22,8 @@ if exist %platform_dir%\env\ENV2_CONTENTS (
set /p contents=<%platform_dir%\env\ENV2_CONTENTS
echo !contents!> %launch_dir%\env2-launch-layer\env2-launch-dep
mklink /j env2-launch-deps %launch_dir%\env2-launch-layer
echo launch = true> %launch_dir%\env2-launch-layer.toml
echo [types] > %launch_dir%\env2-launch-layer.toml
echo launch = true >> %launch_dir%\env2-launch-layer.toml
)

echo --- Done
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
api = "0.2"
api = "0.7"

[buildpack]
id = "read/env"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
api = "0.2"
api = "0.7"

[buildpack]
id = "volume/bp"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
api = "0.2"
api = "0.7"

[buildpack]
id = "rw-volume/bp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,17 @@ echo "Color: Styled"
mkdir "$launch_dir/launch-layer"
echo "Launch Dep Contents" > "$launch_dir/launch-layer/launch-dep"
ln -snf "$launch_dir/launch-layer" launch-deps
echo "launch = true" > "$launch_dir/launch-layer.toml"
echo "[types]" > "$launch_dir/launch-layer.toml"
echo "launch = true" >> "$launch_dir/launch-layer.toml"

## makes a cached launch layer
if [[ ! -f "$launch_dir/cached-launch-layer.toml" ]]; then
echo "making cached launch layer"
mkdir "$launch_dir/cached-launch-layer"
echo "Cached Dep Contents" > "$launch_dir/cached-launch-layer/cached-dep"
ln -snf "$launch_dir/cached-launch-layer" cached-deps
echo "launch = true" > "$launch_dir/cached-launch-layer.toml"
echo "[types]" > "$launch_dir/cached-launch-layer.toml"
echo "launch = true" >> "$launch_dir/cached-launch-layer.toml"
echo "cache = true" >> "$launch_dir/cached-launch-layer.toml"
else
echo "reusing cached launch layer"
Expand All @@ -38,6 +40,7 @@ cat <<EOF > "$launch_dir/launch.toml"
type = "web"
command = "./run"
args = ["8080"]
default = true
[[processes]]
type = "hello"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@ echo making launch layer %launch_dir%\launch-layer
mkdir %launch_dir%\launch-layer
echo Launch Dep Contents > "%launch_dir%\launch-layer\launch-dep
mklink /j launch-deps %launch_dir%\launch-layer
echo launch = true > %launch_dir%\launch-layer.toml
echo [types] > %launch_dir%\launch-layer.toml
echo launch = true >> %launch_dir%\launch-layer.toml

:: makes a cached launch layer
if not exist %launch_dir%\cached-launch-layer.toml (
echo making cached launch layer %launch_dir%\cached-launch-layer
mkdir %launch_dir%\cached-launch-layer
echo Cached Dep Contents > %launch_dir%\cached-launch-layer\cached-dep
mklink /j cached-deps %launch_dir%\cached-launch-layer
echo launch = true > %launch_dir%\cached-launch-layer.toml
echo [types] > %launch_dir%\cached-launch-layer.toml
echo launch = true >> %launch_dir%\cached-launch-layer.toml
echo cache = true >> %launch_dir%\cached-launch-layer.toml
) else (
echo reusing cached launch layer %launch_dir%\cached-launch-layer
Expand All @@ -29,6 +31,7 @@ echo [[processes]]
echo type = "web"
echo command = '.\run'
echo args = ["8080"]
echo default = true
echo.
echo [[processes]]
echo type = "hello"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
api = "0.2"
api = "0.7"

[buildpack]
id = "simple/layers"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,23 @@ echo "Color: Styled"
mkdir "$launch_dir/launch-layer"
echo "Launch Dep Contents" > "$launch_dir/launch-layer/launch-dep"
ln -snf "$launch_dir/launch-layer" launch-deps
echo "launch = true" > "$launch_dir/launch-layer.toml"
echo "[types]" > "$launch_dir/launch-layer.toml"
echo "launch = true" >> "$launch_dir/launch-layer.toml"

## makes a cached launch layer
if [[ ! -f "$launch_dir/cached-launch-layer.toml" ]]; then
echo "making cached launch layer"
mkdir "$launch_dir/cached-launch-layer"
echo "Cached Dep Contents" > "$launch_dir/cached-launch-layer/cached-dep"
ln -snf "$launch_dir/cached-launch-layer" cached-deps
echo "launch = true" > "$launch_dir/cached-launch-layer.toml"
echo "[types]" > "$launch_dir/cached-launch-layer.toml"
echo "launch = true" >> "$launch_dir/cached-launch-layer.toml"
echo "cache = true" >> "$launch_dir/cached-launch-layer.toml"
else
echo "reusing cached launch layer"
echo "[types]" > "$launch_dir/cached-launch-layer.toml"
echo "launch = true" >> "$launch_dir/cached-launch-layer.toml"
echo "cache = true" >> "$launch_dir/cached-launch-layer.toml"
ln -snf "$launch_dir/cached-launch-layer" cached-deps
fi

Expand All @@ -38,6 +43,7 @@ cat <<EOF > "$launch_dir/launch.toml"
type = "web"
command = "./run"
args = ["8080"]
default = true
[[processes]]
type = "hello"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,23 @@ echo making launch layer %launch_dir%\launch-layer
mkdir %launch_dir%\launch-layer
echo Launch Dep Contents > "%launch_dir%\launch-layer\launch-dep
mklink /j launch-deps %launch_dir%\launch-layer
echo launch = true > %launch_dir%\launch-layer.toml
echo [types] > %launch_dir%\launch-layer.toml
echo launch = true >> %launch_dir%\launch-layer.toml

:: makes a cached launch layer
if not exist %launch_dir%\cached-launch-layer.toml (
echo making cached launch layer %launch_dir%\cached-launch-layer
mkdir %launch_dir%\cached-launch-layer
echo Cached Dep Contents > %launch_dir%\cached-launch-layer\cached-dep
mklink /j cached-deps %launch_dir%\cached-launch-layer
echo launch = true > %launch_dir%\cached-launch-layer.toml
echo [types] > %launch_dir%\cached-launch-layer.toml
echo launch = true >> %launch_dir%\cached-launch-layer.toml
echo cache = true >> %launch_dir%\cached-launch-layer.toml
) else (
echo reusing cached launch layer %launch_dir%\cached-launch-layer
echo [types] > %launch_dir%\cached-launch-layer.toml
echo launch = true >> %launch_dir%\cached-launch-layer.toml
echo cache = true >> %launch_dir%\cached-launch-layer.toml
mklink /j cached-deps %launch_dir%\cached-launch-layer
)

Expand All @@ -29,6 +34,7 @@ echo [[processes]]
echo type = "web"
echo command = '.\run'
echo args = ["8080"]
echo default = true
echo.
echo [[processes]]
echo type = "hello"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
api = "0.2"
api = "0.7"

[buildpack]
id = "simple/layers"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
api = "0.2"
api = "0.7"

[extension]
id = "simple/layers"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
api = "0.2"
api = "0.7"

[buildpack]
id = "simple/layers/parent"
Expand Down

0 comments on commit 3a994bd

Please sign in to comment.