aboutsummaryrefslogtreecommitdiff
path: root/jdkX-jtreg-test-persist-results.yaml
blob: 90e3819a4e0816d371004948180732fb204ed56c (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
- job:
    name: jdkX-jtreg-test-persist-results
    project-type: matrix
    defaults: global
    description: |
        * Writes the results to $HOME/srv/openjdkX/openjdk-jtreg-nightly-tests.
    properties:
        - authorization:
            linaro:
                - job-read
            openjdk-members:
                - job-extended-read
                - job-build
                - job-cancel
                - job-workspace
        - build-discarder:
            days-to-keep: 30
            num-to-keep: 10
            artifact-num-to-keep: 5
    parameters:
        - string:
            name: YEAR
            default: 'default'
        - string:
            name: DAY_OF_YEAR
            default: 'default'
    disabled: false
    node: aarch64-06
    display-name: 'OpenJDK X - Write jtreg tests results'
    axes:
        - axis:
            type: user-defined
            name: JVM_VARIANT
            values:
                - server
                - client
        - axis:
            type: user-defined
            name: BUILD_TYPE
            values:
                - release
        - axis:
            type: user-defined
            name: JTREG_CATEGORY
            values:
                - jdk
                - hotspot
                - langtools
        - axis:
            type: slave
            name: label
            values:
                - aarch64-06
    execution-strategy:
        sequential: true
    wrappers:
        - workspace-cleanup:
            dirmatch: false
        - timestamps
        - matrix-tie-parent:
            node: aarch64-06
    builders:
        - copyartifact:
            project: jdkX-jtreg-test
            filter: 'out/jtreg-results-${JTREG_CATEGORY}-${JVM_VARIANT}-${BUILD_TYPE}.tar.gz'
            target: incoming
            flatten: true
        - copyartifact:
            project: jdkX-build-image
            filter: 'out/jdkX-server-${BUILD_TYPE}.tar.gz'
            target: incoming
            flatten: true
        - shell: |
            #!/bin/bash

            set -exu

            tree -f .

            PERSIST=$HOME/srv/openjdkX
            export JDK_VERSION=X

            result_tarball=${WORKSPACE}/incoming/BUILD_TYPE=${BUILD_TYPE},JTREG_CATEGORY=${JTREG_CATEGORY},JVM_VARIANT=${JVM_VARIANT},label=${label}/jtreg-results-${JTREG_CATEGORY}-${JVM_VARIANT}-${BUILD_TYPE}.tar.gz

            image_tarball=${WORKSPACE}/incoming/BUILD_TYPE=${BUILD_TYPE},JVM_VARIANT=server,label=${label}/jdkX-server-${BUILD_TYPE}.tar.gz

            : ${YEAR:=$(date +%Y)}
            : ${DAY_OF_YEAR:=$(date +%j)}

            basedir=$PERSIST/openjdk-jtreg-nightly-tests
            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
            image_dir=${basedir}/builds/${JVM_VARIANT}-${BUILD_TYPE},label=${label}/${YEAR}/${DAY_OF_YEAR}/images/jdk

            rm -rf  ${image_dir}
            mkdir -p ${image_dir}

            tar -C ${basedir} \
              --transform="s/YYY__DAY_OF_YEAR__YYY/$DAY_OF_YEAR/;s/XXX__YEAR__XXX/$YEAR/" \
              --show-transformed-names \
              --overwrite \
              -xvf ${result_tarball}

            tar -C ${image_dir} \
              --strip-components=1 \
              --show-transformed-names \
              --overwrite \
              -xvf ${image_tarball}

            # Change location.
            # Match the exact output of the cron-based scripts.
            sed_expr1=$(echo s!XXX__YEAR__XXX!$YEAR!g)
            sed_expr2=$(echo s!YYY__DAY_OF_YEAR__YYY!$DAY_OF_YEAR!g)

            find ${work_dir} -type f -exec perl -p -i -e "$sed_expr1" {} \;
            find ${work_dir} -type f -exec perl -p -i -e "$sed_expr2" {} \;

            find ${report_dir} -type f -exec perl -p -i -e "$sed_expr1" {} \;
            find ${report_dir} -type f -exec perl -p -i -e "$sed_expr2" {} \;