Skip to content

Commit 88917e1

Browse files
committed
Add cflinuxfs5 test support and fix npm 8 node-gyp/distutils test failure
- Switch integration test stack from cflinuxfs4 to cflinuxfs5 - Add cflinuxfs5 to install_go.sh stack validation, hardcode cflinuxfs4 Go download URL (Go toolchain is cross-stack compatible) - Add cflinuxfs5 to override buildpack fixture cf_stacks - Fix npm ^8 test: remove cpu-features native module from test copy because npm 8 bundles node-gyp v9.1.0 which requires distutils (removed in Python 3.12+)
1 parent 9b9c5ce commit 88917e1

5 files changed

Lines changed: 14 additions & 4 deletions

File tree

config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"stack": "cflinuxfs4",
2+
"stack": "cflinuxfs5",
33
"oses": [
44
"linux"
55
],

fixtures/util/override_buildpack/override.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ nodejs:
88
cf_stacks:
99
- cflinuxfs3
1010
- cflinuxfs4
11+
- cflinuxfs5

scripts/install_go.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -u
55
set -o pipefail
66

77
function main() {
8-
if [[ "${CF_STACK:-}" != "cflinuxfs3" && "${CF_STACK:-}" != "cflinuxfs4" ]]; then
8+
if [[ "${CF_STACK:-}" != "cflinuxfs3" && "${CF_STACK:-}" != "cflinuxfs4" && "${CF_STACK:-}" != "cflinuxfs5" ]]; then
99
echo " **ERROR** Unsupported stack"
1010
echo " See https://docs.cloudfoundry.org/devguide/deploy-apps/stacks.html for more info"
1111
exit 1
@@ -20,7 +20,8 @@ function main() {
2020

2121
if [[ ! -f "${dir}/bin/go" ]]; then
2222
local url
23-
url="https://buildpacks.cloudfoundry.org/dependencies/go/go_${version}_linux_x64_${CF_STACK}_${expected_sha:0:8}.tgz"
23+
# TODO: use exact stack based dep, when go is built for all supported stacks
24+
url="https://buildpacks.cloudfoundry.org/dependencies/go/go_${version}_linux_x64_cflinuxfs4_${expected_sha:0:8}.tgz"
2425

2526
echo "-----> Download go ${version}"
2627
curl "${url}" \

src/nodejs/integration/init_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func init() {
4141
flag.BoolVar(&settings.Serial, "serial", false, "run serial buildpack tests")
4242
flag.StringVar(&settings.Platform, "platform", "cf", `switchblade platform to test against ("cf" or "docker")`)
4343
flag.StringVar(&settings.GitHubToken, "github-token", "", "use the token to make GitHub API requests")
44-
flag.StringVar(&settings.Stack, "stack", "cflinuxfs4", "stack to use when pushing apps")
44+
flag.StringVar(&settings.Stack, "stack", "cflinuxfs5", "stack to use when pushing apps")
4545
}
4646

4747
func TestIntegration(t *testing.T) {

src/nodejs/integration/npm_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,14 @@ func testNPM(platform switchblade.Platform, fixtures string) func(*testing.T, sp
7272
Expect(file.Close()).To(Succeed())
7373

7474
pkg["engines"] = map[string]string{"npm": "^8"}
75+
76+
// Remove cpu-features (native module) because npm 8's bundled
77+
// node-gyp v9.1.0 requires distutils, which was removed in Python 3.12+.
78+
// This test validates npm version selection, not native compilation.
79+
deps := pkg["dependencies"].(map[string]interface{})
80+
delete(deps, "cpu-features")
81+
pkg["dependencies"] = deps
82+
7583
content, err := json.Marshal(pkg)
7684
Expect(err).NotTo(HaveOccurred())
7785
Expect(os.WriteFile(filepath.Join(source, "package.json"), content, 0600)).To(Succeed())

0 commit comments

Comments
 (0)