forked from Project-OSRM/osrm-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcucumber.mjs
More file actions
81 lines (69 loc) · 2.11 KB
/
cucumber.mjs
File metadata and controls
81 lines (69 loc) · 2.11 KB
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
80
81
// See: https://github.com/cucumber/cucumber-js/blob/main/docs/profiles.md
export default function() {
const penv = process.env;
function int(s, def) {
return (s && parseInt(s)) || def;
}
function str(s, def) {
return s || def;
}
const commonWorldParameters = {
httpTimeout: int(penv.CUCUMBER_HTTP_TIMEOUT, 2000), // must be less than default timeout
testPath: str(penv.CUCUMBER_TEST_PATH, 'test'),
profilesPath: str(penv.CUCUMBER_PROFILES_PATH, 'profiles'),
logsPath: str(penv.CUCUMBER_LOGS_PATH, 'test/logs'),
cachePath: str(penv.CUCUMBER_CACHE_PATH, 'test/cache'),
buildPath: str(penv.OSRM_BUILD_DIR, 'build'),
loadMethod: str(penv.OSRM_LOAD_METHOD, 'datastore'),
algorithm: str(penv.OSRM_ALGORITHM, 'ch'),
port: int(penv.OSRM_PORT, 5000),
ip: str(penv.OSRM_IP, '127.0.0.1'),
}
const baseConfig = {
strict: true,
import: [
'features/support/',
'features/step_definitions/',
'features/lib/'
],
worldParameters : commonWorldParameters,
tags: 'not @stress and not @todo',
}
function wp(worldParameters) {
return { worldParameters: worldParameters };
}
const htmlReportFilename = `test/logs/cucumber-${process.env.algorithm}-${process.env.loadmethod}.report.html`
return {
// Default profile
default: {
... baseConfig,
},
// base configs
home: {
... baseConfig,
format: [
'progress-bar',
['html', htmlReportFilename]
],
},
github: {
... baseConfig,
format: [
'./features/lib/github_summary_formatter.js',
['html', htmlReportFilename]
],
publish: true
},
// patches to base configs
stress: { tags: '@stress'},
todo: { tags: '@todo'},
all: { tags: '' },
// algorithms
ch: wp({algorithm: 'ch'}),
mld: wp({algorithm: 'mld'}),
// data load methods
datastore: wp({loadMethod: 'datastore'}),
directly: wp({loadMethod: 'directly'}),
mmap: wp({loadMethod: 'mmap'}),
}
};