forked from dodoyoon/CTG-Randoop-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
50 lines (43 loc) · 1.94 KB
/
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
pipeline {
agent any
tools{
maven 'Maven 3.6'
}
stages {
stage('Build') {
steps {
sh 'mvn package -Dmaven.test.skip=true'
}
}
stage('Test'){
steps{
sh script:'''
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export PATH=$PATH:$JAVA_HOME/bin
export JUNIT_HOME=/usr/share/java
export CLASSPATH=$CLASSPATH:$JUNIT_HOME/junit4.jar
export JUNITPATH=$CLASSPATH:$JUNIT_HOME/junit4.jar:$CLASSPATH:$JUNIT_HOME/hamcrest-core-1.3.jar
export RANDOOP_PATH=/home/kaydeee329/shift
export RANDOOP_JAR=/home/kaydeee329/shift/randoop-all-4.2.3.jar
cd randoop
. ./randoop.sh || true
javac -classpath .:$JUNITPATH ErrorTest*.java RegressionTest*.java || true
java -classpath .:$JUNITPATH: org.junit.runner.JUnitCore ErrorTest > $(git rev-parse --show-toplevel)/randoop/err$BUILD_NUMBER.md || true
java -classpath .:$JUNITPATH: org.junit.runner.JUnitCore RegressionTest > $(git rev-parse --show-toplevel)/randoop/reg$BUILD_NUMBER.md || true
rm ErrorTest*
rm RegressionTest* || true
'''
}
}
stage('Filter & Result'){
steps{
sh script:'''
git push gerrit HEAD:refs/for/test
cd $(git rev-parse --show-toplevel)/randoop
python3 /home/kaydeee329/CTG-Randoop/randoop2json.py $(pwd)/err$BUILD_NUMBER.md
python3 /home/kaydeee329/CTG-Randoop/filter_result.py $(pwd)/err$(( ${BUILD_NUMBER#0} -1 )).md.json $(pwd)/err$BUILD_NUMBER.md.json 4 $(git rev-parse HEAD^1) $(git rev-parse HEAD) $(git rev-parse --show-toplevel)/src/main/java/org kaydeee329@localhost 3 || true
'''
}
}
}
}