Skip to content

Commit f571f33

Browse files
committed
Remove yaf/mcrypt from all-modules fixtures; fix wildcard version resolution
yaf and mcrypt are not available for PHP 8.3.x (dropped upstream). The default PHP version was changed to 8.3.x in the previous commit, so tests using PHP 8.3.30 no longer have these extensions. - Remove ext-yaf from php_all_modules_composer/composer.json (composer install was failing: ext-yaf not found in system) - Remove yaf and mcrypt from php_all_modules/.bp-config/options.json - Fix ItLoadsAllTheModules to resolve wildcard default version (e.g. '8.3.x') to the highest matching exact version in the manifest, instead of doing an exact string match that would always fail to find any modules
1 parent 62e8fb0 commit f571f33

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

fixtures/php_all_modules/.bp-config/options.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
"mailparse",
2626
"maxminddb",
2727
"mbstring",
28-
"mcrypt",
2928
"memcached",
3029
"mongodb",
3130
"msgpack",
@@ -63,7 +62,6 @@
6362
"tidy",
6463
"xsl",
6564
"yaml",
66-
"yaf",
6765
"zip",
6866
"zlib",
6967
"phalcon"

fixtures/php_all_modules_composer/composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
"ext-yaml": "*",
6060
"ext-zip": "*",
6161
"ext-zlib": "*",
62-
"ext-yaf" : "*",
6362
"ext-phalcon": "*"
6463
}
6564
}

src/php/integration/modules_test.go

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import (
44
"fmt"
55
"os"
66
"path/filepath"
7+
"strings"
78
"testing"
89

910
"github.com/cloudfoundry/switchblade"
10-
"github.com/sclevine/spec"
11-
1211
. "github.com/cloudfoundry/switchblade/matchers"
1312
. "github.com/onsi/gomega"
13+
"github.com/sclevine/spec"
1414
"gopkg.in/yaml.v2"
1515
)
1616

@@ -69,13 +69,22 @@ func testModules(platform switchblade.Platform, fixtures string) func(*testing.T
6969
}
7070
}
7171

72+
// Resolve wildcard default (e.g. "8.3.x") to the highest matching
73+
// exact version present in the manifest dependencies.
74+
prefix := strings.TrimSuffix(phpVersion, "x")
75+
var resolvedVersion string
7276
var modules []SubDependency
7377
for _, d := range manifest.Dependencies {
74-
if d.Name == "php" && d.Version == phpVersion {
75-
modules = d.Modules
76-
break
78+
if d.Name == "php" && strings.HasPrefix(d.Version, prefix) {
79+
if resolvedVersion == "" || d.Version > resolvedVersion {
80+
resolvedVersion = d.Version
81+
modules = d.Modules
82+
}
7783
}
7884
}
85+
if resolvedVersion != "" {
86+
phpVersion = resolvedVersion
87+
}
7988

8089
Eventually(deployment).Should(Serve(
8190
ContainSubstring(fmt.Sprintf("PHP %s", phpVersion)),

0 commit comments

Comments
 (0)