Skip to content

Commit e725604

Browse files
committed
update workflows and tests: switch to Ubuntu ARM native for e2e, refine library copy logic with improved mocking and logging
1 parent a86a3fb commit e725604

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

.github/workflows/e2e-android-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ jobs:
2727
strategy:
2828
matrix:
2929
include:
30-
- os: ubuntu-latest # Ubuntu x64 with ARM64 emulation
30+
- os: ubuntu-24.04-arm # Ubuntu ARM64 native
3131
android-api: 30
3232
arch: arm64
33-
- os: macos-latest # macOS on Apple Silicon (M1/M2)
33+
- os: macOS-latest # macOS on Apple Silicon (M1/M2)
3434
android-api: 30
3535
arch: arm64
3636
runs-on: ${{ matrix.os }}

tests/packaging/test_packaging_packager.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -476,16 +476,22 @@ def test_copy_libs_logs_debug(self, mock_ensure_dir, package_config, single_mode
476476
# Mock library files
477477
mock_lib = MagicMock()
478478
mock_lib.is_file.return_value = True
479-
mock_lib.name = "libtest.so"
479+
mock_lib.relative_to.return_value = Path("libtest.so")
480480

481481
libs_dir = MagicMock()
482-
libs_dir.glob.side_effect = [[mock_lib], []] # First pattern finds file, second finds none
482+
libs_dir.exists.return_value = True
483+
libs_dir.rglob.return_value = [mock_lib] # Return mock library from rglob
484+
485+
dest_dir = MagicMock()
486+
dest_dir.rglob.return_value = [mock_lib] # For counting total libs
483487

484488
with patch("ovmobilebench.packaging.packager.shutil.copy2"):
485-
with patch("ovmobilebench.packaging.packager.logger") as mock_logger:
486-
packager._copy_libs(libs_dir, Path("/dest"))
489+
with patch.object(packager, "_copy_ndk_stl_lib"): # Mock NDK lib copy
490+
with patch("ovmobilebench.packaging.packager.logger") as mock_logger:
491+
packager._copy_libs(libs_dir, dest_dir)
487492

488-
mock_logger.debug.assert_called_with("Copied library: libtest.so")
493+
mock_logger.debug.assert_called_with("Copied library: libtest.so")
494+
mock_logger.info.assert_called_with(f"Copied 1 libraries from {libs_dir}")
489495

490496
@patch("ovmobilebench.packaging.packager.ensure_dir")
491497
def test_empty_models_list(self, mock_ensure_dir):

0 commit comments

Comments
 (0)