-
Notifications
You must be signed in to change notification settings - Fork 0
/
4parallel-Jenkinsfile
177 lines (172 loc) · 9.23 KB
/
4parallel-Jenkinsfile
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
pipeline {
agent {label 'slave-xretorch'}
environment {
ET_EUS_API = "http://selenoid:4444/wd/hub"
CURRENT_DATE = " date +\'[%m-%d-%y] %T - \'"
//Used to avoid the UnixHTTPConnectionPool(host='localhost', port=None): Read timed out and
DOCKER_CLIENT_TIMEOUT = 120
COMPOSE_HTTP_TIMEOUT = 120
}//EndEnvironment
options {
disableConcurrentBuilds()
}//EndPipOptions
stages{
stage('SETUP-Infrastructure') {
steps{
//Change the permisions to the scripts folder the
sh 'chmod +x -R ./retorchfiles/scripts'
sh './retorchfiles/scripts/coilifecycles/coi-setup.sh'
}// EndStepsSETUPINF
}//EndStageSETUPInf
stage('Stage 0'){
failFast false
parallel{
stage('TJobC IdResource: Attenders LoginService OpenViduMock ') {
steps {
catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') {
sh 'retorchfiles/scripts/tjoblifecycles/tjob-setup.sh tjobc 0'
sh 'retorchfiles/scripts/tjoblifecycles/tjob-testexecution.sh tjobc 0 "FullTeachingEndToEndRESTTests#attendersRestOperations"'
sh 'retorchfiles/scripts/tjoblifecycles/tjob-teardown.sh tjobc 0'
}//EndExecutionStageErrorTJobC
}//EndStepsTJobC
}//EndStageTJobC
stage('TJobD IdResource: Configuration LoginService OpenViduMock ') {
steps {
catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') {
sh 'retorchfiles/scripts/tjoblifecycles/tjob-setup.sh tjobd 0'
sh 'retorchfiles/scripts/tjoblifecycles/tjob-testexecution.sh tjobd 0 "FullTeachingEndToEndRESTTests#courseRestOperations,CourseTeacherTest#teacherEditCourseValues"'
sh 'retorchfiles/scripts/tjoblifecycles/tjob-teardown.sh tjobd 0'
}//EndExecutionStageErrorTJobD
}//EndStepsTJobD
}//EndStageTJobD
stage('TJobE IdResource: Configuration LoginService OpenVidu ') {
steps {
catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') {
sh 'retorchfiles/scripts/tjoblifecycles/tjob-setup.sh tjobe 0'
sh 'retorchfiles/scripts/tjoblifecycles/tjob-testexecution.sh tjobe 0 "FullTeachingEndToEndEChatTests#oneToOneChatInSessionChrome"'
sh 'retorchfiles/scripts/tjoblifecycles/tjob-teardown.sh tjobe 0'
}//EndExecutionStageErrorTJobE
}//EndStepsTJobE
}//EndStageTJobE
stage('TJobF IdResource: Course LoginService OpenViduMock ') {
steps {
catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') {
sh 'retorchfiles/scripts/tjoblifecycles/tjob-setup.sh tjobf 0'
sh 'retorchfiles/scripts/tjoblifecycles/tjob-testexecution.sh tjobf 0 "LoggedLinksTests#spiderLoggedTest,UnLoggedLinksTests#spiderUnloggedTest,CourseTeacherTest#teacherDeleteCourseTest"'
sh 'retorchfiles/scripts/tjoblifecycles/tjob-teardown.sh tjobf 0'
}//EndExecutionStageErrorTJobF
}//EndStepsTJobF
}//EndStageTJobF
}//End Parallel
}//End Stage
stage('Stage 1'){
failFast false
parallel{
stage('TJobH IdResource: Information LoginService OpenViduMock ') {
steps {
catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') {
sh 'retorchfiles/scripts/tjoblifecycles/tjob-setup.sh tjobh 1'
sh 'retorchfiles/scripts/tjoblifecycles/tjob-testexecution.sh tjobh 1 "FullTeachingEndToEndRESTTests#courseInfoRestOperations"'
sh 'retorchfiles/scripts/tjoblifecycles/tjob-teardown.sh tjobh 1'
}//EndExecutionStageErrorTJobH
}//EndStepsTJobH
}//EndStageTJobH
stage('TJobI IdResource: Files LoginService OpenViduMock ') {
steps {
catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') {
sh 'retorchfiles/scripts/tjoblifecycles/tjob-setup.sh tjobi 1'
sh 'retorchfiles/scripts/tjoblifecycles/tjob-testexecution.sh tjobi 1 "FullTeachingEndToEndRESTTests#filesRestOperations"'
sh 'retorchfiles/scripts/tjoblifecycles/tjob-teardown.sh tjobi 1'
}//EndExecutionStageErrorTJobI
}//EndStepsTJobI
}//EndStageTJobI
stage('TJobJ IdResource: Forum LoginService OpenViduMock ') {
steps {
catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') {
sh 'retorchfiles/scripts/tjoblifecycles/tjob-setup.sh tjobj 1'
sh 'retorchfiles/scripts/tjoblifecycles/tjob-testexecution.sh tjobj 1 "LoggedForumTest#forumLoadEntriesTest"'
sh 'retorchfiles/scripts/tjoblifecycles/tjob-teardown.sh tjobj 1'
}//EndExecutionStageErrorTJobJ
}//EndStepsTJobJ
}//EndStageTJobJ
stage('TJobK IdResource: Forum LoginService OpenViduMock ') {
steps {
catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') {
sh 'retorchfiles/scripts/tjoblifecycles/tjob-setup.sh tjobk 1'
sh 'retorchfiles/scripts/tjoblifecycles/tjob-testexecution.sh tjobk 1 "LoggedForumTest#forumNewCommentTest,LoggedForumTest#forumNewEntryTest,LoggedForumTest#forumNewReply2CommentTest,FullTeachingEndToEndRESTTests#forumRestOperations"'
sh 'retorchfiles/scripts/tjoblifecycles/tjob-teardown.sh tjobk 1'
}//EndExecutionStageErrorTJobK
}//EndStepsTJobK
}//EndStageTJobK
}//End Parallel
}//End Stage
stage('Stage 2'){
failFast false
parallel{
stage('TJobM IdResource: Session LoginService OpenVidu ') {
steps {
catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') {
sh 'retorchfiles/scripts/tjoblifecycles/tjob-setup.sh tjobm 2'
sh 'retorchfiles/scripts/tjoblifecycles/tjob-testexecution.sh tjobm 2 "FullTeachingTestEndToEndVideoSessionTests#oneToOneVideoAudioSessionChrome,FullTeachingLoggedVideoSessionTests#sessionTest"'
sh 'retorchfiles/scripts/tjoblifecycles/tjob-teardown.sh tjobm 2'
}//EndExecutionStageErrorTJobM
}//EndStepsTJobM
}//EndStageTJobM
stage('TJobN IdResource: Session LoginService OpenViduMock ') {
steps {
catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') {
sh 'retorchfiles/scripts/tjoblifecycles/tjob-setup.sh tjobn 2'
sh 'retorchfiles/scripts/tjoblifecycles/tjob-testexecution.sh tjobn 2 "FullTeachingEndToEndRESTTests#sessionRestOperations"'
sh 'retorchfiles/scripts/tjoblifecycles/tjob-teardown.sh tjobn 2'
}//EndExecutionStageErrorTJobN
}//EndStepsTJobN
}//EndStageTJobN
stage('TJobG IdResource: Course LoginService OpenViduMock ') {
steps {
catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') {
sh 'retorchfiles/scripts/tjoblifecycles/tjob-setup.sh tjobg 0'
sh 'retorchfiles/scripts/tjoblifecycles/tjob-testexecution.sh tjobg 0 "CourseStudentTest#studentCourseMainTest,CourseTeacherTest#teacherCourseMainTest,CourseTeacherTest#teacherCreateAndDeleteCourseTest"'
sh 'retorchfiles/scripts/tjoblifecycles/tjob-teardown.sh tjobg 0'
}//EndExecutionStageErrorTJobG
}//EndStepsTJobG
}//EndStageTJobG
stage('TJobL IdResource: LoginService OpenViduMock ') {
steps {
catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') {
sh 'retorchfiles/scripts/tjoblifecycles/tjob-setup.sh tjobl 1'
sh 'retorchfiles/scripts/tjoblifecycles/tjob-testexecution.sh tjobl 1 "UserTest#loginTest"'
sh 'retorchfiles/scripts/tjoblifecycles/tjob-teardown.sh tjobl 1'
}//EndExecutionStageErrorTJobL
}//EndStepsTJobL
}//EndStageTJobL
}//End Parallel
}//End Stage
stage('TEARDOWN-Infrastructure'){
stages{
stage('PublishReports'){
steps{
sh 'retorchfiles/scripts/coilifecycles/coi-teardown.sh'
sh 'retorchfiles/scripts/saveTJobLifecycledata.sh'
publishHTML (target : [allowMissing: false,
alwaysLinkToLastBuild: true,
keepAll: true,
reportDir: 'target/site/',
reportFiles: 'surefire-report.html',
reportName: 'Test Execution Report'])
}//EndStepsPublishReports
}//EndStagePublishReports
}//EndStagesINFTearDown
}//EndStageTearDown
}//EndStagesPipeline
post {
always {
archiveArtifacts artifacts: 'artifacts/*.csv', onlyIfSuccessful: true }//EndAlways
cleanup {
cleanWs()
sh """(eval \$CURRENT_DATE ; echo "Cleaning Environment ") | cat |tr '\n' ' ' """
echo 'Switch off all containers...'
sh """docker stop \$(docker ps | grep tjob | awk '{print \$1}') || echo 'All the containers are stopped!'"""
sh """docker rm --volumes \$(docker ps -a | grep tjob | awk '{print \$1}') || echo 'All the containers are removed!'"""
}//EndCleanUp
}//EndPostActions
}//EndPipeline