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>
This commit is contained in:
Deborah Brouwer
2024-11-25 01:48:50 -08:00
parent 90cb87e918
commit 3bddf77f61
4 changed files with 18 additions and 9 deletions

View File

@@ -212,6 +212,7 @@ include:
- bin/git_sha1_gen.py
- bin/install_megadrivers.py
- bin/symbols-check.py
- bin/ci/**/*
# GitLab CI
- .gitlab-ci.yml
- .gitlab-ci/**/*

View File

@@ -86,7 +86,7 @@
# no need to wait on the "first one" to be done.
# - job: windows-msvc
# optional: true
- job: python-test
- job: python-artifacts
optional: true
@@ -812,9 +812,9 @@ debian-ppc64el:
DRI_LOADERS:
-D glvnd=disabled
# This job tests our Python scripts, and also emits our scripts into
# artifacts, so they can be reused for job submission to hardware devices.
python-test:
# This job emits our scripts into artifacts so they can be reused for
# job submission to hardware devices.
python-artifacts:
stage: build-for-tests
extends:
- .use-debian/x86_64_pyutils
@@ -824,5 +824,6 @@ python-test:
S3_ARTIFACT_NAME: mesa-python-ci-artifacts
timeout: 10m
script:
- .gitlab-ci/run-pytest.sh
- .gitlab-ci/prepare-artifacts-python.sh
tags:
- placeholder-job

View File

@@ -46,7 +46,7 @@ variables:
artifacts: false
- job: debian/x86_64_pyutils
artifacts: false
- job: python-test
- job: python-artifacts
artifacts: false
.lava-test:arm32:

View File

@@ -43,7 +43,7 @@ rustfmt:
- rustfmt --version
- rustfmt --verbose src/**/lib.rs
yaml-toml-shell-test:
yaml-toml-shell-py-test:
extends:
- .use-debian/x86_64_pyutils
- .no-auto-retry # this job can't be flaky
@@ -57,20 +57,27 @@ yaml-toml-shell-test:
- uncollapsed_section_switch shellcheck "shellcheck"
- .gitlab-ci/run-shellcheck.sh
- section_end
- uncollapsed_section_switch pytest "pytest"
- .gitlab-ci/run-pytest.sh
- section_end
rules:
- !reference [.disable-farm-mr-rules, rules]
- !reference [.never-post-merge-rules, rules]
- !reference [.no_scheduled_pipelines-rules, rules]
- if: $GITLAB_USER_LOGIN == "marge-bot"
changes: &toml_lint_files
changes: &lint_files
- .gitlab-ci/test/gitlab-ci.yml
- .gitlab-ci/**/*.sh
- .shellcheckrc
- bin/toml_lint.py
- src/**/ci/*.toml
- .gitlab-ci/tests/**/*
- bin/ci/**/*
when: on_success
- changes: *toml_lint_files
- changes: *lint_files
when: manual
tags:
- placeholder-job
.test-gl:
extends: