Skip to content

Commit 3bddf77

Browse files
committedDec 13, 2024
ci: separate python tests and artifacts
Currently the python-test job runs pytest and then creates python related artifacts for use by other jobs. But the python-test job isn't triggered by changes to the python scripts and libraries. Instead, changes to python scripts and libraries can currently be merged without running pytest and, if they do generate errors, they will only appear in ci later when trying to generate the python artifacts. Add pytest to the existing linting jobs and expand the rules so that it will be triggered by changes to python scripts and libraries. Remove pytest from the job that creates artifacts. This will ensure that the artifacts are still valid while catching script/library errors before they are merged. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32340>
1 parent 90cb87e commit 3bddf77

File tree

4 files changed

+18
-9
lines changed

4 files changed

+18
-9
lines changed
 

‎.gitlab-ci.yml

+1
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ include:
212212
- bin/git_sha1_gen.py
213213
- bin/install_megadrivers.py
214214
- bin/symbols-check.py
215+
- bin/ci/**/*
215216
# GitLab CI
216217
- .gitlab-ci.yml
217218
- .gitlab-ci/**/*

‎.gitlab-ci/build/gitlab-ci.yml

+6-5
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
# no need to wait on the "first one" to be done.
8787
# - job: windows-msvc
8888
# optional: true
89-
- job: python-test
89+
- job: python-artifacts
9090
optional: true
9191

9292

@@ -812,9 +812,9 @@ debian-ppc64el:
812812
DRI_LOADERS:
813813
-D glvnd=disabled
814814

815-
# This job tests our Python scripts, and also emits our scripts into
816-
# artifacts, so they can be reused for job submission to hardware devices.
817-
python-test:
815+
# This job emits our scripts into artifacts so they can be reused for
816+
# job submission to hardware devices.
817+
python-artifacts:
818818
stage: build-for-tests
819819
extends:
820820
- .use-debian/x86_64_pyutils
@@ -824,5 +824,6 @@ python-test:
824824
S3_ARTIFACT_NAME: mesa-python-ci-artifacts
825825
timeout: 10m
826826
script:
827-
- .gitlab-ci/run-pytest.sh
828827
- .gitlab-ci/prepare-artifacts-python.sh
828+
tags:
829+
- placeholder-job

‎.gitlab-ci/lava/lava-gitlab-ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ variables:
4646
artifacts: false
4747
- job: debian/x86_64_pyutils
4848
artifacts: false
49-
- job: python-test
49+
- job: python-artifacts
5050
artifacts: false
5151

5252
.lava-test:arm32:

‎.gitlab-ci/test/gitlab-ci.yml

+10-3
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ rustfmt:
4343
- rustfmt --version
4444
- rustfmt --verbose src/**/lib.rs
4545

46-
yaml-toml-shell-test:
46+
yaml-toml-shell-py-test:
4747
extends:
4848
- .use-debian/x86_64_pyutils
4949
- .no-auto-retry # this job can't be flaky
@@ -57,20 +57,27 @@ yaml-toml-shell-test:
5757
- uncollapsed_section_switch shellcheck "shellcheck"
5858
- .gitlab-ci/run-shellcheck.sh
5959
- section_end
60+
- uncollapsed_section_switch pytest "pytest"
61+
- .gitlab-ci/run-pytest.sh
62+
- section_end
6063
rules:
6164
- !reference [.disable-farm-mr-rules, rules]
6265
- !reference [.never-post-merge-rules, rules]
6366
- !reference [.no_scheduled_pipelines-rules, rules]
6467
- if: $GITLAB_USER_LOGIN == "marge-bot"
65-
changes: &toml_lint_files
68+
changes: &lint_files
6669
- .gitlab-ci/test/gitlab-ci.yml
6770
- .gitlab-ci/**/*.sh
6871
- .shellcheckrc
6972
- bin/toml_lint.py
7073
- src/**/ci/*.toml
74+
- .gitlab-ci/tests/**/*
75+
- bin/ci/**/*
7176
when: on_success
72-
- changes: *toml_lint_files
77+
- changes: *lint_files
7378
when: manual
79+
tags:
80+
- placeholder-job
7481

7582
.test-gl:
7683
extends:

0 commit comments

Comments
 (0)
Please sign in to comment.