Skip to content

Commit 5870fbc

Browse files
committed
fix: mutagen, sockets dont work well on os x
disable http mode in os x, emit warning about it. emit warning about mutagen & pnpm to ensure that pnpm uses copy settings instead of hardlinks
1 parent 3970761 commit 5870fbc

5 files changed

Lines changed: 364 additions & 341 deletions

File tree

bin/cmds/test_cmds/compose.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
const npmPath = require('npm-path');
22
const onDeath = require('death')({ SIGHUP: true, exit: true });
33
const { exec, echo, which } = require('shelljs');
4+
const execa = require('execa');
5+
const fs = require('fs');
6+
const { resolve } = require('path');
47

58
const isWin = process.platform === 'win32';
69

@@ -19,7 +22,21 @@ exports.handler = async (argv) => {
1922
const dockerComposeFiles = [];
2023

2124
if (mutagen) {
22-
argv.isMutagen = true;
25+
let isMutagen = true;
26+
if (process.env.PNPM_SCRIPT_SRC_DIR
27+
|| fs.existsSync(resolve(process.cwd(), 'pnpm-lock.yaml'))) {
28+
const { stdout } = await execa.command('pnpm config get package-import-method');
29+
if (!['clone', 'copy'].includes(stdout)) {
30+
process.emitWarning('pnpm + mutagen dont work with hardlinks enabled', {
31+
code: 'E_DEP_0002',
32+
type: 'MakeomaticDeploy',
33+
detail: 'run `pnpm config -g set package-import-method=copy` and pnpm i after',
34+
});
35+
isMutagen = false;
36+
}
37+
}
38+
39+
argv.isMutagen = isMutagen;
2340
}
2441

2542
if (argv.docker_compose_multi.length > 0) {

bin/cmds/test_cmds/run.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,13 @@ function removeCommonPrefix(from, compareWith) {
4444
exports.command = 'run';
4545
exports.desc = 'performs testing';
4646
exports.handler = async (argv) => {
47-
debug(argv);
47+
if (argv.http && os.platform() === 'darwin') {
48+
process.emitWarning('http is not supported on os x because we cant share unix sockets', {
49+
code: 'E_DEP_0001',
50+
type: 'MakeomaticDeploy',
51+
});
52+
argv.http = false;
53+
}
4854

4955
await require('./compose').handler(argv);
5056

jest.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
exports.coverageProvider = 'v8';
22
exports.testURL = 'http://tester.local';
33
exports.verbose = true;
4+
exports.testTimeout = 15000;

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,17 @@
3030
"eslint-plugin-import": "^2.25.4",
3131
"eslint-plugin-promise": "^6.0.0",
3232
"eslint-plugin-unicorn": "^40.1.0",
33-
"jest": "^27.4.7",
33+
"jest": "^27.5.0",
3434
"tempy": "^1.0.1",
3535
"typescript": "^4.5.5"
3636
},
3737
"dependencies": {
3838
"@commitlint/cli": "^16.1.0",
3939
"@sinclair/typebox": "^0.23.3",
40-
"@types/node": "^17.0.14",
40+
"@types/node": "^17.0.15",
4141
"bluebird": "^3.7.2",
4242
"chrome-launcher": "^0.15.0",
43-
"chrome-remote-interface": "^0.31.1",
43+
"chrome-remote-interface": "^0.31.2",
4444
"cross-env": "^7.0.3",
4545
"death": "^1.1.0",
4646
"debug": "^4.3.3",

0 commit comments

Comments
 (0)