-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy path.mdeprc.js
79 lines (73 loc) · 2.51 KB
/
.mdeprc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
const fs = require('fs')
const os = require('os')
const uid = process.getuid()
const { execSync } = require('child_process')
if (os.platform() !== 'darwin') {
try {
const dockerHost = execSync(
"docker context inspect -f '{{ .Endpoints.docker.Host }}'",
{ encoding: 'utf-8' })
const socket = dockerHost.replace(/^unix:\/+/, '/').replace(/\n/, '')
process.env.DOCKER_SOCKET_PATH = socket
} catch (e) { }
}
exports.node = "20";
exports.in_one = true;
exports.auto_compose = true;
exports.with_local_compose = true;
exports.tester_flavour = "chrome-tester";
exports.rebuild = ['ms-flakeless'];
exports.docker_compose = './test/docker-compose.yml';
exports.test_framework = 'c8 ./node_modules/.bin/mocha';
exports.extras = {
tester: {
user: `${uid}:${uid}`,
shm_size: '256m',
volumes: ['${PWD}/test/configs:/configs:cached'],
expose: ['3000'],
environment: {
NODE_ENV: "test",
DB_SRV: "${DB_SRV:-}",
CI: "${CI:-}",
DEBUG: "${DEBUG:-''}",
NCONF_NAMESPACE: 'MS_USERS',
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 1,
VIRTUAL_HOST: 'ms-users.local',
VIRTUAL_PORT: '3000',
CERT_NAME: 'default',
SKIP_FB: process.env.SKIP_FB,
SKIP_MASTERS: process.env.SKIP_MASTERS,
},
},
};
exports.pre = 'rimraf ./coverage/tmp';
// exports.post_exec = 'pnpm c8 report -r text -r lcov';
switch (process.env.DB_SRV) {
case 'redisCluster':
exports.services = ['rabbitmq', 'redisCluster'];
exports.extras.tester.environment.NCONF_FILE_PATH = '["/configs/amqp.js","/configs/core.js","/configs/redis.cluster.js"]';
break;
case 'redisSentinel':
exports.services = ['rabbitmq', 'redisSentinel'];
exports.extras.tester.environment.NCONF_FILE_PATH = '["/configs/amqp.js","/configs/core.js","/configs/redis.sentinel.js"]';
// exports.extras.redis = {
// ports: ["6379:6379"]
// };
break;
}
if (fs.existsSync('.env')) {
exports.extras.tester.env_file = ['${PWD}/.env']
} else {
Object.assign(exports.extras.tester.environment, {
FACEBOOK_APP_TOKEN: '${FACEBOOK_APP_TOKEN}',
FACEBOOK_CLIENT_ID: '${FACEBOOK_CLIENT_ID}',
FACEBOOK_CLIENT_SECRET: '${FACEBOOK_CLIENT_SECRET}',
PUMP_JACK_PROFILE_TOKEN: '${PUMP_JACK_PROFILE_TOKEN}',
PUMP_JACK_API_KEY: '${PUMP_JACK_API_KEY}',
MASTERS_SIMULATION_API: '${MASTERS_SIMULATION_API}',
MASTERS_PROFILE_USERNAME: '${MASTERS_PROFILE_USERNAME}',
MASTERS_PROFILE_PASSWORD: '${MASTERS_PROFILE_PASSWORD}',
CF_TOKEN: '${CF_TOKEN}',
CF_ACCOUNT_ID: '${CF_ACCOUNT_ID}',
})
}