From 5cd787bf853b8fd77c520cee386120ee5d455700 Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Sat, 16 Dec 2023 18:00:05 +0000 Subject: [PATCH] CI: Upgrade to latest FreeBSD, improve test resilience --- .cirrus.yml | 5 +++-- test/unit/libvips.js | 14 ++++++++++---- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index c1b202c7d..a0b1785b0 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -1,5 +1,5 @@ freebsd_instance: - image_family: freebsd-13-2 + image_family: freebsd-14-0-snap task: name: FreeBSD @@ -10,7 +10,8 @@ task: - pkg update -f - pkg upgrade -y - pkg install -y devel/git devel/pkgconf graphics/vips www/node20 www/npm + - pkg-config --modversion vips-cpp install_script: - npm install --build-from-source test_script: - - npm test + - npx mocha --no-config --spec=test/unit/io.js --timeout=30000 diff --git a/test/unit/libvips.js b/test/unit/libvips.js index 3e013518f..7c26bf820 100644 --- a/test/unit/libvips.js +++ b/test/unit/libvips.js @@ -96,22 +96,28 @@ describe('libvips binaries', function () { describe('Build time directories', () => { it('sharp-libvips include', () => { const dir = libvips.buildSharpLibvipsIncludeDir(); - assert.strictEqual(fs.statSync(dir).isDirectory(), true); + if (dir) { + assert.strictEqual(fs.statSync(dir).isDirectory(), true); + } }); it('sharp-libvips cplusplus', () => { const dir = libvips.buildSharpLibvipsCPlusPlusDir(); - assert.strictEqual(fs.statSync(dir).isDirectory(), true); + if (dir) { + assert.strictEqual(fs.statSync(dir).isDirectory(), true); + } }); it('sharp-libvips lib', () => { const dir = libvips.buildSharpLibvipsLibDir(); - assert.strictEqual(fs.statSync(dir).isDirectory(), true); + if (dir) { + assert.strictEqual(fs.statSync(dir).isDirectory(), true); + } }); }); describe('Runtime detection', () => { it('platform', () => { const [platform] = libvips.runtimePlatformArch().split('-'); - assert.strict(['darwin', 'linux', 'linuxmusl', 'win32'].includes(platform)); + assert.strict(['darwin', 'freebsd', 'linux', 'linuxmusl', 'win32'].includes(platform)); }); it('arch', () => { const [, arch] = libvips.runtimePlatformArch().split('-');