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: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.5.0] - 2026-07-30

### Fixed

- **Platform-specific test failures on macOS**
- `test_installer_platform.phpt` — `platformLabel()` returns "macOS arm64" on Darwin; test now accepts the `macOS` prefix instead of requiring `PHP_OS_FAMILY` verbatim
- `test_installer_lib_name.phpt` — switched to `--EXPECTF--` with `%s` wildcards (`.dylib` vs `.so`)
- `test_installer_resolve_asset_name.phpt` — unified platform-identifier and architecture assertions to produce identical output on Linux and macOS
- `test_hnsw_rabitq_index.phpt` — now skips on non-Linux-x86_64 platforms (RaBitQ is supported on Linux x86_64 only)

### Added

- **DOC-006: Complete README.md update with all missing features and sections** (#65)
Expand Down Expand Up @@ -1062,7 +1072,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

---

[Unreleased]: https://github.com/alibaba/zvec-php/compare/v0.4.11...HEAD
[Unreleased]: https://github.com/crazy-goat/php-zvec/compare/v0.5.0...HEAD
[0.5.0]: https://github.com/crazy-goat/php-zvec/compare/v0.4.10...v0.5.0
[0.4.11]: https://github.com/crazy-goat/php-zvec/compare/v0.4.10...v0.4.11
[0.4.10]: https://github.com/alibaba/zvec-php/compare/v0.4.9...v0.4.10
[0.4.9]: https://github.com/alibaba/zvec-php/compare/v0.4.8...v0.4.9
Expand Down
5 changes: 4 additions & 1 deletion tests/test_hnsw_rabitq_index.phpt
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
--TEST--
HNSW RaBitQ index: create, insert with dim >= 64, optimize, query
--SKIPIF--
<?php if (!extension_loaded('ffi')) die('skip FFI extension not available'); ?>
<?php
if (!extension_loaded('ffi')) die('skip FFI extension not available');
if (PHP_OS_FAMILY !== 'Linux' || php_uname('m') !== 'x86_64') die('skip RaBitQ supported on Linux x86_64 only');
?>
--FILE--
<?php
require_once __DIR__ . '/../src/ZVec.php';
Expand Down
4 changes: 2 additions & 2 deletions tests/test_installer_lib_name.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ echo "PASS: libName has correct prefix\n";

echo "PASS: All libName tests completed\n";
?>
--EXPECT--
PASS: libName returns 'libzvec_ffi.so' (expected 'libzvec_ffi.so')
--EXPECTF--
PASS: libName returns '%s' (expected '%s')
PASS: libName is a valid filename
PASS: libName has correct prefix
PASS: All libName tests completed
4 changes: 3 additions & 1 deletion tests/test_installer_platform.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ use CrazyGoat\ZVec\Installer;

$label = Installer::platformLabel();

if (str_contains($label, PHP_OS_FAMILY)) {
$osMatch = str_contains($label, PHP_OS_FAMILY)
|| (PHP_OS_FAMILY === 'Darwin' && str_contains($label, 'macOS'));
if ($osMatch) {
echo "Platform label contains OS family: PASS\n";
} else {
echo "FAIL: Platform label missing OS family\n";
Expand Down
39 changes: 16 additions & 23 deletions tests/test_installer_resolve_asset_name.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -32,28 +32,21 @@ if ($result === null) {
}
echo "PASS: Asset name contains 'libzvec_ffi'\n";

// Platform-specific checks
if ($os === 'Linux') {
if (str_contains($result, 'ubuntu') || str_contains($result, 'alpine')) {
echo "PASS: Linux asset name contains distro identifier\n";
} else {
echo "FAIL: Linux asset name missing distro identifier\n";
exit(1);
}
if (str_contains($result, $arch)) {
echo "PASS: Linux asset name contains architecture\n";
} else {
echo "FAIL: Linux asset name missing architecture\n";
exit(1);
}
} elseif ($os === 'Darwin') {
if (str_contains($result, 'darwin')) {
echo "PASS: macOS asset name contains 'darwin'\n";
} else {
echo "FAIL: macOS asset name missing 'darwin'\n";
exit(1);
}
// Platform-specific checks (uniform output across platforms)
$identifierOk = ($os === 'Linux' && (str_contains($result, 'ubuntu') || str_contains($result, 'alpine')))
|| ($os === 'Darwin' && str_contains($result, 'darwin'));
if (!$identifierOk) {
echo "FAIL: Asset name missing platform identifier\n";
exit(1);
}
echo "PASS: Asset name contains platform identifier\n";

$expectedArch = $os === 'Darwin' && $arch === 'arm64' ? 'aarch64' : $arch;
if (!str_contains($result, $expectedArch)) {
echo "FAIL: Asset name missing architecture\n";
exit(1);
}
echo "PASS: Asset name contains architecture\n";
}

echo "PASS: All resolveAssetName tests completed\n";
Expand All @@ -62,6 +55,6 @@ echo "PASS: All resolveAssetName tests completed\n";
PASS: resolveAssetName returns '%s'
PASS: Asset name ends with .tar.gz
PASS: Asset name contains 'libzvec_ffi'
PASS: Linux asset name contains distro identifier
PASS: Linux asset name contains architecture
PASS: Asset name contains platform identifier
PASS: Asset name contains architecture
PASS: All resolveAssetName tests completed
Loading