From da88d86227ac792c251e0adbb2a0c9aaeed1ce60 Mon Sep 17 00:00:00 2001 From: Jason Macnak Date: Fri, 6 Nov 2026 08:29:53 -0800 Subject: [PATCH] Add a workflow for running some dEQP tests against a Mesa MR IIUC, we should be able to do things like ``` gh workflow run test_mesa_pr_with_deqp.yml \ -R google/gfxstream \ -f mesa-merge-request-number=45927 \ -f deqp-suite=deqp_vk_descriptor_related_tests ``` afterwards. Test: untested, the workflow needs to be in the main branch before it can be run --- .github/workflows/presubmit_bazel.yml | 33 ++++++++++++- .github/workflows/test_mesa_pr_with_deqp.yml | 51 ++++++++++++++++++++ tests/deqp/BUILD.bazel | 49 +++++++++++++++++++ third_party/mesa/mesa.MODULE.bazel | 1 + 4 files changed, 132 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/test_mesa_pr_with_deqp.yml diff --git a/.github/workflows/presubmit_bazel.yml b/.github/workflows/presubmit_bazel.yml index 430be4375..7a03de978 100644 --- a/.github/workflows/presubmit_bazel.yml +++ b/.github/workflows/presubmit_bazel.yml @@ -13,6 +13,11 @@ on: type: string default: '' + # Additional args used only in `bazel test `: + additional-bazel-test-args: + type: string + default: '' + # Cache configuration identifier used to isolate incompatible build # configurations (e.g. 'default' vs 'asan') into separate cache keys: cache-config: @@ -26,6 +31,12 @@ on: type: string default: '...' + # Optional Mesa GitLab merge request number (e.g. '45927') to patch into + # third_party/mesa before building and testing: + mesa-merge-request-number: + type: string + default: '' + # Whether or not to run the `bazel test` step: run-tests: type: boolean @@ -48,7 +59,7 @@ on: host/vulkan:gfxstream_vk_memory_allocation_helper_tests host/vulkan:vk_common_operations_tests host/vulkan:vk_format_utils_tests - tests/deqp/... + tests/deqp:deqp_vk_smoke_tests tests/end2end:gfxstream_end2end_tests permissions: @@ -72,6 +83,22 @@ jobs: # behind in .git/config. persist-credentials: false + - name: Apply Mesa merge request patch + if: inputs.mesa-merge-request-number != '' + env: + MESA_MR: ${{ inputs.mesa-merge-request-number }} + run: | + if [[ ! "${MESA_MR}" =~ ^[0-9]+$ ]]; then + echo "Error: mesa-merge-request-number must be numeric, got '${MESA_MR}'" >&2 + exit 1 + fi + PATCH_NAME="PATCH.mr_${MESA_MR}.patch" + curl -sSfL "https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/${MESA_MR}.patch" \ + -o "third_party/mesa/${PATCH_NAME}" + sed -i "s|# PLACEHOLDER_FOR_MESA_MR_PATCH_FILE|\"//third_party/mesa:${PATCH_NAME}\",|" \ + third_party/mesa/mesa.MODULE.bazel + git diff third_party/mesa/mesa.MODULE.bazel + - name: Install bazel (Linux) if: runner.os == 'Linux' run: sudo bash toolchain/bazel/install_bazel.sh @@ -120,9 +147,11 @@ jobs: env: TEST_TARGETS: ${{ inputs.test-targets }} ADDITIONAL_BAZEL_ARGS: ${{ inputs.additional-bazel-args }} + ADDITIONAL_BAZEL_TEST_ARGS: ${{ inputs.additional-bazel-test-args }} run: | bazel test $TEST_TARGETS \ --disk_cache=$HOME/bazel-disk-cache \ --test_output=streamed \ --verbose_failures \ - $ADDITIONAL_BAZEL_ARGS + $ADDITIONAL_BAZEL_ARGS \ + $ADDITIONAL_BAZEL_TEST_ARGS diff --git a/.github/workflows/test_mesa_pr_with_deqp.yml b/.github/workflows/test_mesa_pr_with_deqp.yml new file mode 100644 index 000000000..274782c5a --- /dev/null +++ b/.github/workflows/test_mesa_pr_with_deqp.yml @@ -0,0 +1,51 @@ +name: Test Mesa PR with dEQP + +on: + workflow_dispatch: + inputs: + mesa-merge-request-number: + description: 'Mesa GitLab Merge Request number (e.g. 45927)' + required: false + default: '' + type: string + deqp-suite: + description: 'Preset dEQP test suite to run' + required: true + default: 'deqp_vk_smoke_tests' + type: choice + options: + - deqp_vk_smoke_tests + - deqp_vk_descriptor_related_tests + - deqp_vk_image_related_tests + - deqp_vk_memory_related_tests + - deqp_vk_sync_related_tests + custom-deqp-patterns: + description: 'Optional comma-separated dEQP case patterns (overrides preset suite if set)' + required: false + default: '' + type: string + graphics-drivers: + description: 'Host graphics driver configuration' + required: true + default: 'gles_angle_vulkan_lavapipe' + type: choice + options: + - gles_angle_vulkan_lavapipe + - gles_angle_vulkan_swiftshader + +permissions: + contents: read + +jobs: + run-gfxstream-bazel-deqp-tests: + uses: ./.github/workflows/presubmit_bazel.yml + with: + runner: ubuntu-22.04 + mesa-merge-request-number: ${{ inputs.mesa-merge-request-number }} + cache-config: ${{ inputs.graphics-drivers == 'gles_angle_vulkan_lavapipe' && 'lavapipe' || 'swiftshader' }} + build-targets: //tests/deqp:${{ inputs.deqp-suite }} + test-targets: //tests/deqp:${{ inputs.deqp-suite }} + additional-bazel-args: --graphics_drivers=${{ inputs.graphics-drivers }} + additional-bazel-test-args: >- + --test_timeout=3600 + ${{ inputs.custom-deqp-patterns != '' && format('--test_arg=--deqp_cases={0}', inputs.custom-deqp-patterns) || '' }} diff --git a/tests/deqp/BUILD.bazel b/tests/deqp/BUILD.bazel index fba9b3868..35206aa69 100644 --- a/tests/deqp/BUILD.bazel +++ b/tests/deqp/BUILD.bazel @@ -9,3 +9,52 @@ gfxstream_deqp_vk_test( name = "deqp_vk_smoke_tests", deqp_cases = ["dEQP-VK.api.smoke.*"], ) + +gfxstream_deqp_vk_test( + name = "deqp_vk_descriptor_related_tests", + size = "enormous", + deqp_cases = [ + "dEQP-VK.api.descriptor_pool.*", + "dEQP-VK.api.descriptor_set.*", + "dEQP-VK.api.maintenance3_check.descriptor_set", + "dEQP-VK.api.object_management.multithreaded_*", + "dEQP-VK.binding_model.*", + "dEQP-VK.descriptor_indexing.*", + ], +) + +gfxstream_deqp_vk_test( + name = "deqp_vk_image_related_tests", + size = "enormous", + deqp_cases = [ + "dEQP-VK.api.copy_and_blit.*", + "dEQP-VK.api.image_clearing.*", + "dEQP-VK.image.*", + "dEQP-VK.texture.*", + "dEQP-VK.ycbcr.*", + ], +) + +gfxstream_deqp_vk_test( + name = "deqp_vk_memory_related_tests", + size = "enormous", + deqp_cases = [ + "dEQP-VK.api.buffer_memory_requirements.*", + "dEQP-VK.api.external.memory.*", + "dEQP-VK.api.get_memory_commitment.*", + "dEQP-VK.memory.*", + "dEQP-VK.sparse_resources.*", + ], +) + +gfxstream_deqp_vk_test( + name = "deqp_vk_sync_related_tests", + size = "enormous", + deqp_cases = [ + "dEQP-VK.api.command_buffers.*", + "dEQP-VK.api.external.fence.*", + "dEQP-VK.api.external.semaphore.*", + "dEQP-VK.synchronization.*", + "dEQP-VK.synchronization2.*", + ], +) diff --git a/third_party/mesa/mesa.MODULE.bazel b/third_party/mesa/mesa.MODULE.bazel index 8e52d517e..2f847fc5e 100644 --- a/third_party/mesa/mesa.MODULE.bazel +++ b/third_party/mesa/mesa.MODULE.bazel @@ -22,6 +22,7 @@ git_repository( ], patches = [ "//third_party/mesa:PATCH.0001_disable_vk_envvar_modification_for_testing.patch", + # PLACEHOLDER_FOR_MESA_MR_PATCH_FILE ], remote = "https://android.googlesource.com/platform/external/mesa3d.git", )