aboutsummaryrefslogtreecommitdiff
path: root/tcwg-compare-results.yaml
blob: d2ef01c17cb79a355c1c233f3149ca8c0b834be9 (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
- job:
    name: tcwg-compare-results
    project-type: freestyle
    defaults: global
    properties:
        - authorization:
            anonymous:
                - job-read
                - job-extended-read
            linaro:
                - job-build
                - job-cancel
                - job-workspace
        - build-discarder:
            days-to-keep: 30
            num-to-keep: 300
    parameters:
        - string:
            name: ref_logs
            default: buildfarm/gcc-linaro-5-branch
            description: 'Reference log directory on $log_server'
        - string:
            name: new_logs
            default: buildfarm/gcc-linaro-5-branch
            description: 'Log directory on $log_server'
        - string:
            name: pass_thresh
            default: '0.95'
            description: 'Pass threshold, below which the comparison returns an error'
        - string:
            name: target_list
            default:
            description: 'List of targets to compare -- aarch64-linux-gnu armv8l-linux-gnueabihf arm-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf aarch64-none-elf aarch64_be-none-elf tcwg-x86_64-build tcwg-x86_32-build tcwg-tk1_32-build tcwg-apm_64-build tcwg-apm_32-build'
        - string:
            name: log_server
            default: dev-01.tcwglab:/home/tcwg-buildslave/logs
            description: 'Log_Server'
        - bool:
            name: show_results
            default: true
            description: 'Show results in the console'
        - string:
            name: cmp_version
            default: refs/heads/master
            description: 'Comparison scripts version to use'
        - bool:
            name: dryrun
            default: false
            description: 'Dry-run, do nothing, just print steps'
    disabled: false
    node: tcwg-x86_64-dev-01-short
    retry-count: 3
    display-name: 'TCWG AAA Compare results'
    scm:
        - git:
            url: https://git-us.linaro.org/toolchain/gcc-compare-results.git
            refspec: +refs/changes/*:refs/remotes/changes/*
            branches:
                - ${cmp_version}
            skip-tag: true
            shallow-clone: true
            wipe-workspace: true
    wrappers:
        - timeout:
            timeout: 60
        - timestamps
        - ssh-agent-credentials:
            # tcwg-buildslave user id
            users:
                - 'e0958a95-204f-4c14-a66c-5e2be6c5d50a'
        - build-name:
            name: '#${BUILD_NUMBER}-${ENV,var="ref_logs"}-${ENV,var="new_logs"}'
    builders:
        - shell: |
            #!/bin/bash

            set -e
            set -x

            basedir="${log_server#*:}"
            log_server="${log_server%:*}"

            status=0

            dest="/tmp/CompareResults.$BASHPID"

            trap "ssh ${log_server} rm -rf ${dest}" EXIT HUP INT QUIT TRAP KILL PIPE TERM

            if ! $dryrun; then
                LOGSDIR=${WORKSPACE}/artifacts/logs

                mkdir -p ${LOGSDIR}

                ssh ${log_server} mkdir -p ${dest}
                scp ./compare_jobs.sh \
                    ./compare_tests \
                    ./compare_dg_tests.pl \
                    ./host-hw-dependent-tests.txt \
                    ./unstable-tests.txt ${log_server}:${dest} || status=1
                ssh ${log_server} bash ${dest}/compare_jobs.sh \
                    -pass-thresh ${pass_thresh} \
                    $basedir/$ref_logs $basedir/$new_logs ${target_list} || status=1

                # Copy the generated reports
                scp ${log_server}:${dest}/\*-diff-\*.txt ${LOGSDIR} || true
                scp ${log_server}:${dest}/\*.html report.css ${LOGSDIR} || true

                # Print results in console
                if $show_results; then
                    cat ${LOGSDIR}/*.txt
                fi
            else
                echo DRYRUN: compare_jobs.sh \
                     -pass-thresh ${pass_thresh} \
                     $basedir/$ref_logs $basedir/$new_logs ${target_list}
            fi

            exit $status
    publishers:
        - archive:
            artifacts: 'artifacts/logs/*.html,artifacts/logs/*.css,artifacts/logs/*.txt'
            latest-only: false