aboutsummaryrefslogtreecommitdiff
path: root/jdk8-jtreg-test.yaml
blob: 2ee12b8b901817d3be465568e728768d78c5e3fd (plain)
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
178
179
180
181
182
183
184
185
186
187
188
- job:
    name: jdk8-jtreg-test
    project-type: matrix
    defaults: global
    description: |
        * Runs the jtreg tests.
    properties:
        - authorization:
            linaro:
                - job-read
            openjdk-members:
                - job-build
                - job-cancel
        - build-discarder:
            days-to-keep: 30
            num-to-keep: 10
            artifact-num-to-keep: 5
    disabled: false
    node: aarch64-06
    display-name: 'OpenJDK 8 - Run jtreg tests'
    axes:
        - axis:
            type: user-defined
            name: JVM_VARIANT
            values:
                - server
# SRDM: Disable client runs while waiting for LEG-347 to be fixed.
#                - client
        - axis:
            type: user-defined
            name: BUILD_TYPE
            values:
                - release
        - axis:
            type: user-defined
            name: JTREG_CATEGORY
            values:
                - hotspot
                - langtools
                - jdk
        - axis:
            type: slave
            name: label
            values:
                - aarch64-06
    execution-strategy:
        sequential: true
    wrappers:
        - xvfb:
            auto-display-name: true
            additional-options: '-p unix'
            debug: true
        - workspace-cleanup:
            dirmatch: false
        - timestamps
        - matrix-tie-parent:
            node: aarch64-06
    builders:
        - copyartifact:
            project: jtreg-build
            filter: 'jtreg-build-4.2.0-SNAPSHOT.tar.xz'
            target: incoming
            flatten: true
# copyartifact is slow and the file is local
# copy instead of going back and forth between master <-> slave
#        - copyartifact:
#            project: jdk8-build-image
#            filter: 'out/jdk8-${JVM_VARIANT}-${BUILD_TYPE}.tar.gz'
#            target: incoming
#            flatten: true
        - copyartifact:
            project: jdk8-update-src-tree
            filter: 'out/jdk8.tar.gz, out/build-date.sh'
            target: incoming
            flatten: true
        - shell: |
            #!/bin/bash

            echo "DISPLAY=${DISPLAY}"

            set -exu

            source incoming/build-date.sh

            IMAGE_DIR=${WORKSPACE}/jdk8-${JVM_VARIANT}-${BUILD_TYPE}
            PERSIST=$HOME/srv/openjdk


            # Only set =1 for debugging.
            use_subcategories=0

            if [ ${use_subcategories} -eq 1 ]; then 
              case ${JTREG_CATEGORY} in
                langtools)
                    JTREG_SUBCATEGORIES=tools/javap/typeAnnotations
                    ;;
                jdk)
                    JTREG_SUBCATEGORIES=jdk/net/Sockets
                    ;; 
                hotspot)
                    JTREG_SUBCATEGORIES=runtime/CommandLine
                    ;; 
              esac
            fi

            : ${JTREG_SUBCATEGORIES:=.}

            tar xf incoming/jdk8.tar.gz
            tar xf ~/workspace/jdk8-build-image/BUILD_TYPE/${BUILD_TYPE}/JVM_VARIANT/${JVM_VARIANT}/label/${NODE_NAME}/out/jdk8-${JVM_VARIANT}-${BUILD_TYPE}.tar.gz
            tar xf incoming/jtreg-build-4.2.0-SNAPSHOT.tar.xz

            # All the output directories and general frobbing
            # output is to match the existing layout as expected
            # by the cron-based publish and reporting scripts.
            # XXX There's probably a better way.

            YEAR=XXX__YEAR__XXX
            DAY_OF_YEAR=YYY__DAY_OF_YEAR__YYY

            new_basedir=$PERSIST/openjdk8-jtreg-nightly-tests

            basedir=cron_output
            mkdir -p ${basedir}/{src,builds,reports}

            src_dir=${basedir}/src/${YEAR}/${DAY_OF_YEAR}
            work_dir=${basedir}/builds/${JVM_VARIANT}-${BUILD_TYPE}/${YEAR}/${DAY_OF_YEAR}/JTwork-${JTREG_CATEGORY}
            report_dir=${basedir}/reports/${JVM_VARIANT}-${BUILD_TYPE}/${JTREG_CATEGORY}/$(uname -m)/${YEAR}/${DAY_OF_YEAR}/JTreport

            mkdir -p out ${src_dir} ${work_dir} ${report_dir}

            mv jdk8/* ${src_dir}

            blacklist=${WORKSPACE}/excludes.txt
            jdk_problem_list=${src_dir}/${JTREG_CATEGORY}/test/ProblemList.txt

            if [ -e $jdk_problem_list ]; then
                cat $jdk_problem_list > ${blacklist}
            fi

            aarch64_exclude_file=${src_dir}/test/exclude_aarch64.txt

            if [ -e ${aarch64_exclude_file} ]; then
                cat ${aarch64_exclude_file} >> ${blacklist}
            fi

            touch ${blacklist}

            echo "Blacklist"
            echo "========="
            cat ${blacklist}
            echo "---------"

            export JAVA_HOME=${WORKSPACE}/jdk8-${JVM_VARIANT}-${BUILD_TYPE}
            export PATH=$JAVA_HOME/bin:${PATH}

            PATH=${WORKSPACE}/jtreg/bin:${PATH}
            which java
            java -version

            # Ignore error in jtreg final result.
            set +e

            java -jar jtreg/lib/jtreg.jar \
              -dir:${src_dir}/${JTREG_CATEGORY}/test \
              -testjdk:${IMAGE_DIR} \
              -exclude:${blacklist} \
              -conc:auto \
              -r:${report_dir} \
              -w:${work_dir} \
              -a -agentvm -ignore:quiet -v1 ${JTREG_SUBCATEGORIES} | cat -n

            set -e

            # We don't care for the .class files.
            find ${work_dir} -name \*.class -exec rm {} \;

            # Match the exact output of the cron-based scripts.
            dest=$PERSIST/openjdk8-jtreg-nightly-tests
            sed_expr=$(echo s!${WORKSPACE}/${basedir}!$dest!g)
            find ${work_dir} -type f -exec perl -p -i -e "$sed_expr" {} \;
            find ${report_dir} -type f -exec perl -p -i -e "$sed_expr" {} \;

            mkdir -p out
            tar -C ${basedir} --show-transformed-names -acvf out/jtreg-results-${JTREG_CATEGORY}-${JVM_VARIANT}-${BUILD_TYPE}.tar.gz builds reports
            mv -v ${basedir}/src ${new_basedir}/src
    publishers:
        - archive:
            artifacts: 'out/jtreg-results-${JTREG_CATEGORY}-${JVM_VARIANT}-${BUILD_TYPE}.tar.gz'