-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathe2e.gradle
61 lines (52 loc) · 1.71 KB
/
e2e.gradle
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
// Copyright (c) 2018 Gonzalo Müller Bravo.
// Licensed under the MIT License (MIT), see LICENSE.txt
apply plugin: 'com.moowork.node'
description = 'End to end test.'
group = 'Utility'
// CONSTANTS
////////////
final INCREMENTAL_E2E_INFO = {
inputs.files fileLister.obtainFullFileTree("$projectDir/src", [includes: [FRONT$CODE_FILES]])
inputs.files fileLister.obtainFullFileTree("$projectDir/local_js", [includes: [FRONT$CODE_FILES]])
}
// Plugin settings
//////////////////
node {
version = FRONT$NODE_VERSION
download = true
workDir = parent.node.workDir
npmWorkDir = parent.node.npmWorkDir
nodeModulesDir = parent.node.nodeModulesDir
}
// TASKS
////////
task assess(type: NpmTask) {
// NpmTask task settings
args = ['eslintE2E']
// gradle task settings
description = 'Analyze and assess End to End test code.'
inputs.files fileLister.obtainFullFileTree("$projectDir", [includes: [FRONT$ESLINT_CFG_FILE]])
outputs.upToDateWhen { true }
}
assess eslintTaskConfiguration << INCREMENTAL_E2E_INFO
codeCommonTasks.complementAssessTask(assess)
task test(type: NpmTask) {
// NpmTask task settings
args = ['e2eTest'
, "--e2e_dir=$projectDir/src/test"
, "--e2e_env=$runningEnvironment"
, "--e2e_url=http://localhost:8080/"
, "--e2e_jar=${project(':back').fixedJar.archivePath}"
, "--e2e_report_dir=$buildDir"]
// gradle task settings
description = 'Run the end to end tests.'
dependsOn ':front:npmInstall', ':back:fixedJar'
outputs.dir buildDir
doLast {
logger.quiet "See e2e test report at $buildDir"
}
}
test mainNpmTaskConfiguration << INCREMENTAL_E2E_INFO
codeCommonTasks.complementTestTask(test)
task check
codeCommonTasks.complementCheckTask(check)