aboutsummaryrefslogtreecommitdiffstats
path: root/jobs/osmo-gsm-tester-runner.yml
blob: f6774b7f856a3262f0bba4ff0ebc70b28381ca32 (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
189
190
191
192
193
194
195
## run jobs
- project:
    name: osmo-gsm-testers-runner
    stage:
      - prod
      - rnd
    jobs:
      - 'osmo-gsm-tester_run-{stage}'
      - 'osmo-gsm-tester_gerrit'
      - 'osmo-gsm-tester_ttcn3'

- scm:
    name: osmo-gsm-tester-gerrit
    scm:
      - git:
          url: ssh://jenkins@gerrit.osmocom.org:29418/osmo-gsm-tester
          credentials-id: d5eda5e9-b59d-44ba-88d2-43473cb6e42d
          branches:
            - $GERRIT_BRANCH
          refspec: $GERRIT_REFSPEC
          wipe-workspace: false
          skip-tag: true
          basedir: osmo-gsm-tester
          clean:
            before: true
          choosing-strategy: 'gerrit'

# The repo must be used seperate to workaround the bug "Can not expand OSMO_GSM_TESTER_BRANCH".
# The safe-guard check to not use un-defined variables seems to be broken.
- scm:
    name: osmo-gsm-tester-repo
    scm:
      - git:
          url: git://git.osmocom.org/osmo-gsm-tester
          branches:
            - ${OSMO_GSM_TESTER_BRANCH}
          wipe-workspace: false
          skip-tag: true
          basedir: osmo-gsm-tester

- builder:
    name: copy_artifact
    builders:
      - copyartifact:
          project: '{repo}'
          filter: '*.tgz, *.md5'
          which-build: last-successful
          stable: true

# all artifact in one place
- builder:
    name: copy_artifact_all
    builders:
      - copy_artifact:
         repo: osmo-gsm-tester_build-osmo-bsc
      - copy_artifact:
         repo: osmo-gsm-tester_build-osmo-bts
      - copy_artifact:
         repo: osmo-gsm-tester_build-osmo-ggsn
      - copy_artifact:
         repo: osmo-gsm-tester_build-osmo-hlr
      - copy_artifact:
         repo: osmo-gsm-tester_build-osmo-mgw
      - copy_artifact:
         repo: osmo-gsm-tester_build-osmo-msc
      - copy_artifact:
         repo: osmo-gsm-tester_build-osmo-pcu
      - copy_artifact:
         repo: osmo-gsm-tester_build-osmo-sgsn
      - copy_artifact:
         repo: osmo-gsm-tester_build-osmo-trx
      - copy_artifact:
         repo: osmo-gsm-tester_build-osmo-nitb
      - copy_artifact:
         repo: osmo-gsm-tester_build-osmo-stp
      - copy_artifact:
         repo: osmo-gsm-tester_build-osmo-bts-sysmo
      - copy_artifact:
         repo: osmo-gsm-tester_build-osmo-pcu-sysmo

- defaults:
    name: runner
    description: 'Run an actual GSM hardware test using the binaries from the osmo-gsm-tester_build* jobs'
    node: 'osmo-gsm-tester-prod'
    project-type: freestyle
    properties:
      - build-discarder:
          num-to-keep: 60
    parameters:
      - string:
          name: "OSMO_GSM_TESTER_BRANCH"
          default: "origin/master"
          description: "Which branch/sha should be used for testing"
      - string:
          name: "OSMO_GSM_TESTER_OPTS"
          default: ""
          description: "pass additional command line options to osmo-gsm-tester.py, e.g. to select specific suites:scenarios. Default: leave empty."

- job-template:
    name: 'osmo-gsm-tester_run-{stage}'
    defaults: runner
    node: 'osmo-gsm-tester-{stage}'
    triggers:
      - timed: "H H/2 * * *"
      - pollscm:
          cron: "H/5 * * * *"
      - reverse:
            jobs:
                - osmo-gsm-tester_build-osmo-bsc
                - osmo-gsm-tester_build-osmo-bts
                - osmo-gsm-tester_build-osmo-ggsn
                - osmo-gsm-tester_build-osmo-hlr
                - osmo-gsm-tester_build-osmo-mgw
                - osmo-gsm-tester_build-osmo-msc
                - osmo-gsm-tester_build-osmo-pcu
                - osmo-gsm-tester_build-osmo-sgsn
                - osmo-gsm-tester_build-osmo-trx
                - osmo-gsm-tester_build-osmo-nitb
                - osmo-gsm-tester_build-osmo-stp
                - osmo-gsm-tester_build-osmo-bts-sysmo
                - osmo-gsm-tester_build-osmo-pcu-sysmo
    builders:
      - copy_artifact_all
      - shell: !include-raw: osmo-gsm-tester_run-{stage}.sh
    publishers:
      - archive:
          artifacts: '*-run.tgz, *-bin.tgz'
          default-excludes: false
      - junit:
          results: 'trial-*/last_run/trial-*.xml'
          allow-empty-results: true
      - email:
          recipients: 'pespin@sysmocom.de'
          notify-every-unstable-build: true
    scm:
      - 'osmo-gsm-tester-repo'

# gerrit job
- job:
    name: 'osmo-gsm-tester_gerrit'
    defaults: runner
    scm:
      - 'osmo-gsm-tester-gerrit'
    triggers:
      - gerrit:
          server-name: 'gerrit.osmocom.org'
          trigger-on:
            - patchset-created-event:
                exclude-no-code-change: true
            - draft-published-event
          projects:
            - project-compare-type: 'PLAIN'
              project-pattern: 'osmo-gsm-tester'
              branches:
                - branch-compare-type: 'ANT'
                  branch-pattern: '**'
    builders:
      - shell: |
          # make sure no bin artifacts from a previous run remain
          rm -f *.tgz *.md5
      - copy_artifact_all
      - shell: !include-raw: osmo-gsm-tester_run-gerrit.sh
    publishers:
      - archive:
          artifacts: '*-run.tgz, *-bin.tgz'
          default-excludes: false
      - junit:
          results: 'trial-*/last_run/trial-*.xml'
          allow-empty-results: true

# ttcn3 job
- job:
    name: 'osmo-gsm-tester_ttcn3'
    defaults: runner
    scm:
      - 'osmo-gsm-tester-repo'
    triggers:
      - timed: "H H/2 * * *"
      - pollscm:
          cron: "H/5 * * * *"
    builders:
      - shell: |
          # make sure no bin artifacts from a previous run remain
          rm -f *.tgz *.md5
      - copy_artifact_all
      - copy_artifact:
         repo: osmo-gsm-tester_build-osmocom-bb
      - shell: !include-raw: osmo-gsm-tester_ttcn3.sh
    publishers:
      - archive:
          artifacts: '*-run.tgz, *-bin.tgz'
          default-excludes: false
      - junit:
          results: 'trial-*/last_run/trial-*.xml'
          allow-empty-results: true