• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1.test:
2  # Cancel job if a newer commit is pushed to the same branch
3  interruptible: true
4  variables:
5    GIT_STRATEGY: none # testing doesn't build anything from source
6  before_script:
7    - !reference [default, before_script]
8    # Note: Build dir (and thus install) may be dirty due to GIT_STRATEGY
9    - rm -rf install
10    - tar -xf artifacts/install.tar
11    - section_start ldd_section "Checking ldd on driver build"
12    - LD_LIBRARY_PATH=install/lib find install/lib -name "*.so" -print -exec ldd {} \;
13    - section_end ldd_section
14  artifacts:
15    when: always
16    name: "mesa_${CI_JOB_NAME}"
17    paths:
18      - results/
19  rules:
20    - !reference [.never-post-merge-rules, rules]
21
22.formatting-check:
23  # Cancel job if a newer commit is pushed to the same branch
24  interruptible: true
25  stage: code-validation
26  extends:
27    - .use-debian/x86_64_build
28  variables:
29    GIT_STRATEGY: fetch
30  timeout: 10m
31  script:
32    - git diff --color=always --exit-code  # Fails if there are diffs
33  tags:
34    - placeholder-job
35
36rustfmt:
37  extends:
38    - .formatting-check
39    - .lint-rustfmt-rules
40  before_script:
41    - shopt -s globstar
42    - rustfmt --version
43    - rustfmt --verbose src/**/lib.rs
44    - rustfmt --verbose src/**/main.rs
45
46.test-check:
47  # Cancel job if a newer commit is pushed to the same branch
48  interruptible: true
49  stage: code-validation
50  extends:
51    - .use-debian/x86_64_build
52  variables:
53    GIT_STRATEGY: fetch
54  timeout: 10m
55
56python-test:
57  extends:
58    - .test-check
59  script:
60    - cd bin/ci
61    - pip install --break-system-packages -r test/requirements.txt
62    - PYTHONPATH=. pytest -v
63  rules:
64    - !reference [.disable-farm-mr-rules, rules]
65    - !reference [.never-post-merge-rules, rules]
66    - changes:
67        - bin/ci/**/*
68
69.test-gl:
70  extends:
71    - .test
72    - .use-debian/x86_64_test-gl
73  needs:
74    - debian/x86_64_test-gl
75    - debian-testing
76    - !reference [.required-for-hardware-jobs, needs]
77  variables:
78    DEBIAN_ARCH: amd64
79
80.test-vk:
81  extends:
82    - .test
83    - .use-debian/x86_64_test-vk
84  needs:
85    - debian-testing
86    - debian/x86_64_test-vk
87    - !reference [.required-for-hardware-jobs, needs]
88  variables:
89    DEBIAN_ARCH: amd64
90
91.test-cl:
92  extends:
93    - .test
94    - .use-debian/x86_64_test-gl
95  needs:
96    - debian/x86_64_test-gl
97    - !reference [.required-for-hardware-jobs, needs]
98
99.test-android:
100  extends:
101    - .test
102    - .use-debian/x86_64_test-android
103  variables:
104    S3_ARTIFACT_NAME: mesa-x86_64-android-debug
105  needs:
106    - job: debian-testing
107      artifacts: true  # On the host we want the Linux build
108    - job: debian-android
109      artifacts: false  # The Android build will be downloaded later
110    - job: debian/x86_64_test-android
111      artifacts: false
112    - !reference [.required-for-hardware-jobs, needs]
113  timeout: 20m
114  script:
115    - ./install/cuttlefish-runner.sh
116  artifacts:
117    paths:
118      - results/
119
120.vkd3d-proton-test:
121  artifacts:
122    when: on_failure
123    name: "mesa_${CI_JOB_NAME}"
124    paths:
125      - results/vkd3d-proton.log
126  script:
127    - ./install/vkd3d-proton/run.sh
128
129.piglit-test:
130  artifacts:
131    name: "mesa_${CI_JOB_NAME}"
132    paths:
133      - results
134    reports:
135      junit: results/junit.xml
136  variables:
137    PIGLIT_NO_WINDOW: 1
138    HWCI_TEST_SCRIPT: "/install/piglit/piglit-runner.sh"
139  script:
140    - install/piglit/piglit-runner.sh
141
142.piglit-traces-test:
143  extends:
144    - .piglit-test
145  artifacts:
146    when: on_failure
147    name: "mesa_${CI_JOB_NAME}"
148    reports:
149      junit: results/junit.xml
150    paths:
151      - results/
152    exclude:
153      - results/*.shader_cache
154  variables:
155    PIGLIT_REPLAY_EXTRA_ARGS: --db-path ${CI_PROJECT_DIR}/replayer-db/ --minio_bucket=mesa-tracie-public --jwt-file=${CI_JOB_JWT_FILE}
156    # until we overcome Infrastructure issues, give traces extra 5 min before timeout
157    DEVICE_HANGING_TIMEOUT_SEC: 600
158  script:
159    - section_start variables "Variables passed through:"
160    - install/common/generate-env.sh
161    - section_end variables
162    - install/piglit/piglit-traces.sh
163
164.deqp-test:
165  script:
166    - rm -rf results # Clear out old results if the docker container was cached
167    - ./install/deqp-runner.sh
168  artifacts:
169    exclude:
170      - results/*.shader_cache
171    reports:
172      junit: results/junit.xml
173
174.deqp-test-vk:
175  extends:
176    - .deqp-test
177  variables:
178    DEQP_VER: vk
179
180.fossilize-test:
181  script:
182    - ./install/fossilize-runner.sh
183  artifacts:
184    when: on_failure
185    name: "mesa_${CI_JOB_NAME}"
186    paths:
187      - results/
188
189.baremetal-test:
190  extends:
191    - .test
192  # Cancel job if a newer commit is pushed to the same branch
193  interruptible: true
194  before_script:
195    - !reference [default, before_script]
196    # Use this instead of gitlab's artifacts download because it hits packet.net
197    # instead of fd.o.  Set FDO_HTTP_CACHE_URI to an http cache for your test lab to
198    # improve it even more (see https://docs.mesa3d.org/ci/bare-metal.html for
199    # setup).
200    - section_start artifacts_download "Downloading artifacts from s3"
201    # Note: Build dir (and thus install) may be dirty due to GIT_STRATEGY
202    - rm -rf install
203    - (set -x; curl -L --retry 4 -f --retry-all-errors --retry-delay 60 ${FDO_HTTP_CACHE_URI:-}https://${PIPELINE_ARTIFACTS_BASE}/${S3_ARTIFACT_NAME}.tar.zst | tar --zstd -x)
204    - section_end artifacts_download
205  variables:
206    BM_ROOTFS: /rootfs-${DEBIAN_ARCH}
207  artifacts:
208    when: always
209    name: "mesa_${CI_JOB_NAME}"
210    paths:
211      - results/
212      - serial*.txt
213    exclude:
214      - results/*.shader_cache
215    reports:
216      junit: results/junit.xml
217
218# ARM testing of bare-metal boards attached to an x86 gitlab-runner system
219.baremetal-test-arm32:
220  extends:
221    - .baremetal-test
222    - .use-debian/arm32_test
223  variables:
224    DEBIAN_ARCH: armhf
225    S3_ARTIFACT_NAME: mesa-arm32-default-debugoptimized
226  needs:
227    - debian/arm32_test
228    - job: debian-arm32
229      artifacts: false
230    - !reference [.required-for-hardware-jobs, needs]
231
232# ARM64 testing of bare-metal boards attached to an x86 gitlab-runner system
233.baremetal-test-arm64:
234  extends:
235    - .baremetal-test
236    - .use-debian/arm64_test
237  variables:
238    DEBIAN_ARCH: arm64
239    S3_ARTIFACT_NAME: mesa-arm64-default-debugoptimized
240  needs:
241    - debian/arm64_test
242    - job: debian-arm64
243      artifacts: false
244    - !reference [.required-for-hardware-jobs, needs]
245
246# ARM32/64 testing of bare-metal boards attached to an x86 gitlab-runner system, using an asan mesa build
247.baremetal-arm32-asan-test:
248  extends:
249    - .baremetal-test
250    - .use-debian/arm32_test
251  variables:
252    DEQP_RUNNER_OPTIONS: "--env LD_PRELOAD=libasan.so.8:/install/lib/libdlclose-skip.so"
253    S3_ARTIFACT_NAME: mesa-arm32-asan-debugoptimized
254  needs:
255    - debian/arm32_test
256    - job: debian-arm32-asan
257      artifacts: false
258    - !reference [.required-for-hardware-jobs, needs]
259
260.baremetal-arm64-asan-test:
261  extends:
262    - .baremetal-test
263    - .use-debian/arm64_test
264  variables:
265    DEQP_RUNNER_OPTIONS: "--env LD_PRELOAD=libasan.so.8:/install/lib/libdlclose-skip.so"
266    S3_ARTIFACT_NAME: mesa-arm64-asan-debugoptimized
267  needs:
268    - debian/arm64_test
269    - job: debian-arm64-asan
270      artifacts: false
271    - !reference [.required-for-hardware-jobs, needs]
272
273.baremetal-deqp-test:
274  variables:
275    HWCI_TEST_SCRIPT: "/install/deqp-runner.sh"
276    FDO_CI_CONCURRENT: 0 # Default to number of CPUs
277
278# For Valve's bare-metal testing farm jobs.
279.b2c-test:
280  # It would be nice to use ci-templates within Mesa CI for this job's
281  # image:, but the integration is not possible for the current
282  # use-case. Within this job, two containers are managed. 1) the
283  # gitlab runner container from which the job is submitted to the
284  # DUT, and 2) the test container (e.g. debian/x86_64_test-vk) within
285  # which the test cases will run on the DUT. Since ci-templates and
286  # the associated image setting macros in this file rely on variables
287  # like FDO_DISTRIBUTION_TAG for *the* image, there is no way to
288  # depend on more than one image per job. So, the job container is
289  # built as part of the CI in the boot2container project.
290  image: registry.freedesktop.org/gfx-ci/ci-tron/mesa-trigger:2024-01-05.1
291  timeout: 1h 40m
292  rules:
293    - if: $FORCE_KERNEL_TAG != null
294      when: never
295  variables:
296    # No need by default to pull the whole repo
297    GIT_STRATEGY: none
298    # boot2container initrd configuration parameters.
299    B2C_KERNEL_URL: 'https://gitlab.freedesktop.org/gfx-ci/ci-tron/-/package_files/519/download'  # Linux 6.1
300    B2C_INITRAMFS_URL: 'https://gitlab.freedesktop.org/mupuf/boot2container/-/releases/v0.9.10/downloads/initramfs.linux_amd64.cpio.xz'
301    B2C_JOB_SUCCESS_REGEX: '\[.*\]: Execution is over, pipeline status: 0\r$'
302    B2C_JOB_WARN_REGEX: '\*ERROR\* ring .* timeout'
303    B2C_LOG_LEVEL: 6
304    B2C_POWEROFF_DELAY: 15
305    B2C_SESSION_END_REGEX: '^.*It''s now safe to turn off your computer\r$'
306    B2C_SESSION_REBOOT_REGEX: ''
307    B2C_TIMEOUT_BOOT_MINUTES: 45
308    B2C_TIMEOUT_BOOT_RETRIES: 0
309    B2C_TIMEOUT_FIRST_MINUTES: 2
310    B2C_TIMEOUT_FIRST_RETRIES: 3
311    B2C_TIMEOUT_MINUTES: 5
312    B2C_TIMEOUT_OVERALL_MINUTES: 90
313    B2C_TIMEOUT_RETRIES: 0
314    B2C_JOB_VOLUME_EXCLUSIONS: "*.shader_cache,install/*,*/install/*,*/vkd3d-proton.cache*,vkd3d-proton.cache*,*.qpa"
315
316    # As noted in the top description, we make a distinction between the
317    # container used by gitlab-runner to queue the work, and the container
318    # used by the DUTs/test machines. To make this distinction quite clear,
319    # we rename the MESA_IMAGE variable into IMAGE_UNDER_TEST.
320    IMAGE_UNDER_TEST: "$MESA_IMAGE"
321
322    INSTALL_TARBALL_NAME: "install.tar"
323    INSTALL_TARBALL: "./artifacts/${INSTALL_TARBALL_NAME}"
324    CI_B2C_ARTIFACTS: "./artifacts/b2c"
325    CI_COMMON_SCRIPTS: "./artifacts/ci-common"
326    B2C_JOB_TEMPLATE: "${CI_B2C_ARTIFACTS}/b2c.yml.jinja2.jinja2"
327    JOB_FOLDER: "job_folder"
328
329  before_script:
330    # We don't want the tarball unpacking of .test, but will take the JWT bits.
331    - !reference [default, before_script]
332
333    - |
334      set -eux
335
336      # Useful as a hook point for runner admins. You may edit the
337      # config.toml for the Gitlab runner and use a bind-mount to
338      # populate the hook script with some executable commands. This
339      # allows quicker feedback than resubmitting pipelines and
340      # potentially having to wait for a debug build of Mesa to
341      # complete.
342      if [ -x /runner-before-script.sh ]; then
343         echo "Executing runner before-script hook..."
344         sh /runner-before-script.sh
345         if [ $? -ne 0 ]; then
346            echo "Runner hook failed, goodbye"
347            exit $?
348         fi
349      fi
350
351      [ -s "$INSTALL_TARBALL" ] || exit 1
352      [ -d "$CI_B2C_ARTIFACTS" ] || exit 1
353      [ -d "$CI_COMMON_SCRIPTS" ] || exit 1
354
355      export B2C_CONTAINER_CMD="bash -euc 'tar xf ${INSTALL_TARBALL_NAME}; ./install/common/init-stage2.sh'"
356
357      # The Valve CI gateway receives jobs in a YAML format. Create a
358      # job description from the CI environment.
359      python3 "$CI_B2C_ARTIFACTS"/generate_b2c.py
360
361      cat b2c.yml.jinja2
362
363      rm -rf ${JOB_FOLDER} || true
364      mkdir -v ${JOB_FOLDER}
365
366      # Create a script to regenerate the CI environment when this job
367      # begins running on the remote DUT.
368      set +x
369      "$CI_COMMON_SCRIPTS"/generate-env.sh > ${JOB_FOLDER}/set-job-env-vars.sh
370      echo "export SCRIPTS_DIR=./install" >> ${JOB_FOLDER}/set-job-env-vars.sh
371      echo "Variables passed through:"
372      cat ${JOB_FOLDER}/set-job-env-vars.sh
373      set -x
374
375      # Copy the mesa install tarball to the job folder, for later extraction
376      mv "${INSTALL_TARBALL}" "${JOB_FOLDER}"
377
378  script: |
379      slugify () {
380          echo "$1" | sed -r s/[~\^]+//g | sed -r s/[^a-zA-Z0-9]+/-/g | sed -r s/^-+\|-+$//g | tr A-Z a-z
381      }
382
383      # Submit the job to Valve's CI gateway service with the CI
384      # provisioned job_folder.
385      env PYTHONUNBUFFERED=1 executorctl \
386          run -w b2c.yml.jinja2 -j $(slugify "$CI_JOB_NAME") -s ${JOB_FOLDER} -i "$CI_RUNNER_DESCRIPTION"
387
388  # Anything our job places in results/ will be collected by the
389  # Gitlab coordinator for status presentation. results/junit.xml
390  # will be parsed by the UI for more detailed explanations of
391  # test execution.
392  after_script:
393    # Keep the results path the same as baremetal and LAVA
394    - mkdir -p "${JOB_FOLDER}"/results
395    - mv "${JOB_FOLDER}"/results results/
396    - !reference [default, after_script]
397
398  artifacts:
399    when: always
400    name: "mesa_${CI_JOB_NAME}"
401    paths:
402      - results
403    reports:
404      junit: results/**/junit.xml
405
406.b2c-test-vk:
407  extends:
408    - .use-debian/x86_64_test-vk
409    - .b2c-test
410  needs:
411    - debian/x86_64_test-vk
412    - debian-testing
413    - !reference [.required-for-hardware-jobs, needs]
414
415.b2c-test-gl:
416  extends:
417    - .use-debian/x86_64_test-gl
418    - .b2c-test
419  needs:
420    - debian/x86_64_test-gl
421    - debian-testing
422    - !reference [.required-for-hardware-jobs, needs]
423