aboutsummaryrefslogtreecommitdiff
path: root/jdk8-jcstress-test-persist-results.yaml
blob: a5dbae68b685633dfa2e03d6bf65c5fd59b4c18b (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
- job:
    name: jdk8-jcstress-test-persist-results
    project-type: matrix
    defaults: global
    description: |
        * Writes results to:<br>
          * /work/openjdk-testing/jcstress-nightly-runs<br>
          * /work/openjdk-testing/jcstress-results
    properties:
        - authorization:
            linaro:
                - job-read
            openjdk-members:
                - job-extended-read
                - job-build
                - job-cancel
        - 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: true
    node: j12-qrep-01
    display-name: 'OpenJDK 8 - Write jcstress tests results'
    axes:
        - axis:
            type: user-defined
            name: BUILD_TYPE
            values:
                - release
        - axis:
            type: slave
            name: label
            values:
                - j12-qrep-01
    execution-strategy:
        sequential: true
    wrappers:
        - workspace-cleanup:
            dirmatch: false
        - timestamps
        - matrix-tie-parent:
            node: j12-qrep-01
    builders:
        - copyartifact:
            project: jdk8-update-src-tree
            filter: 'out/build-date.sh'
            target: incoming
            flatten: true
        - copyartifact:
            project: jdk8-jcstress-test
            filter: 'out/jcstress-results-${BUILD_TYPE}.tar.gz'
            target: incoming
            flatten: true
        - shell: |
            #!/bin/bash

            set -exu

            PERSIST=$HOME/srv/openjdk8u

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

            JCSTRESS_RUN_DIR=$PERSIST/jcstress-nightly-runs
            JCSTRESS_RESULTS_DIR=$PERSIST/jcstress-results
            RESULTS_CSV=${JCSTRESS_RESULTS_DIR}/results.csv

            mkdir -p $JCSTRESS_RESULTS_DIR

            # Tolerate missing results.csv file.
            if [ ! -f $RESULTS_CSV ]; then
                touch $RESULTS_CSV
            fi

            mkdir -p ${JCSTRESS_RESULTS_DIR} ${JCSTRESS_RUN_DIR}/${YEAR}/${DAY_OF_YEAR}
            tar -C ${JCSTRESS_RUN_DIR}/${YEAR}/${DAY_OF_YEAR} --strip-components=1 -xzf incoming/BUILD_TYPE=${BUILD_TYPE},label=${label}/jcstress-results-${BUILD_TYPE}.tar.gz
            numeric_date=$(date +'%s' --date=$(date +'%Y-%m-%d'))
            echo "Previous Results"
            cat ${RESULTS_CSV}
            echo "${numeric_date},${JCSTRESS_RUN_DIR}/${YEAR}/${DAY_OF_YEAR},success" >> ${RESULTS_CSV}
            sort --unique --field-separator=',' --numeric-sort -o ${RESULTS_CSV} ${RESULTS_CSV}