diff --git a/test/common/README.md b/test/common/README.md index 08d7bbb762fbb4..c6f156b936f093 100644 --- a/test/common/README.md +++ b/test/common/README.md @@ -219,6 +219,11 @@ Platform check for Advanced Interactive eXecutive (AIX). Attempts to 'kill' `pid` +### isAlpine +* [<boolean>] + +Platform check for Alpine Linux. + ### isFreeBSD * [<boolean>] diff --git a/test/common/index.js b/test/common/index.js index 95bb8dd804881f..186e970a302c1e 100644 --- a/test/common/index.js +++ b/test/common/index.js @@ -60,6 +60,18 @@ exports.isOpenBSD = process.platform === 'openbsd'; exports.isLinux = process.platform === 'linux'; exports.isOSX = process.platform === 'darwin'; +Object.defineProperty(exports, 'isAlpine', { + get: () => { + if (!exports.isLinux) + return false; + const lddVersion = spawnSync('ldd', ['--version'], { encoding: 'utf8' }); + if (!lddVersion) + return false; + return !lddVersion.stdout.includes('LIBC'); + }, + enumerable: true +}); + exports.enoughTestMem = os.totalmem() > 0x70000000; /* 1.75 Gb */ const cpus = os.cpus(); exports.enoughTestCpu = Array.isArray(cpus) && diff --git a/test/parallel/test-process-env-tz.js b/test/parallel/test-process-env-tz.js index 7e077588d46e64..a0eddeffff09bc 100644 --- a/test/parallel/test-process-env-tz.js +++ b/test/parallel/test-process-env-tz.js @@ -9,6 +9,9 @@ if (common.isWindows) // Using a different TZ format. if (common.isAIX || common.isSunOS) // Reports 2018 CEST as CET. common.skip('tzdata too old'); +if (common.isAlpine) // Reports UTC + common.skip('reports utc'); + const date = new Date('2018-04-14T12:34:56.789Z'); process.env.TZ = 'Europe/Amsterdam';