Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add alpine check #20229

Closed
wants to merge 4 commits into from
Closed
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
5 changes: 5 additions & 0 deletions test/common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,11 @@ Platform check for Advanced Interactive eXecutive (AIX).

Attempts to 'kill' `pid`

### isAlpine
* [<boolean>]

Platform check for Alpine Linux.

### isFreeBSD
* [<boolean>]

Expand Down
12 changes: 12 additions & 0 deletions test/common/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) &&
Expand Down
3 changes: 3 additions & 0 deletions test/parallel/test-process-env-tz.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down