|
21 | 21 | description: "tests to skip (delete the ones you wanna keep, do not leave empty)" |
22 | 22 | default: "valkey,modules,sentinel,cluster,unittest,large-memory" |
23 | 23 | test_args: |
24 | | - description: "extra test arguments" |
| 24 | + description: "extra test arguments; use valgrind_test instead of --single for targeted valgrind runs" |
| 25 | + default: "" |
| 26 | + valgrind_test: |
| 27 | + description: "single test file or directory to run in valgrind jobs instead of the full shards" |
25 | 28 | default: "" |
26 | 29 | cluster_test_args: |
27 | 30 | description: "extra cluster / sentinel test arguments" |
|
45 | 48 | type: string |
46 | 49 | default: "" |
47 | 50 | test_args: |
48 | | - description: "extra test arguments" |
| 51 | + description: "extra test arguments; use valgrind_test instead of --single for targeted valgrind runs" |
| 52 | + required: false |
| 53 | + type: string |
| 54 | + default: "" |
| 55 | + valgrind_test: |
| 56 | + description: "single test file or directory to run in valgrind jobs instead of the full shards" |
49 | 57 | required: false |
50 | 58 | type: string |
51 | 59 | default: "" |
@@ -822,13 +830,18 @@ jobs: |
822 | 830 | echo "$CACHE" |
823 | 831 | if [ "$(( $CACHE-$CACHE0 ))" -gt "8000000" ]; then exit 1; fi |
824 | 832 | test-valgrind-test: |
| 833 | + name: test-valgrind-test (${{ matrix.shard }}) |
825 | 834 | runs-on: ubuntu-latest |
826 | 835 | if: | |
827 | 836 | (github.event_name == 'workflow_call' || github.event_name == 'workflow_dispatch' || |
828 | 837 | (github.event_name == 'schedule' && github.repository == 'valkey-io/valkey') || |
829 | 838 | (github.event_name == 'pull_request' && github.event.pull_request.base.ref != 'unstable' && github.event.action != 'labeled')) && |
830 | 839 | !contains(github.event.inputs.skipjobs, 'valgrind') && !contains(github.event.inputs.skiptests, 'valkey') |
831 | 840 | timeout-minutes: 1440 |
| 841 | + strategy: |
| 842 | + fail-fast: false |
| 843 | + matrix: |
| 844 | + shard: ${{ fromJSON(inputs.valgrind_test && '["targeted"]' || '["unit", "cluster", "integration-type"]') }} |
832 | 845 | steps: |
833 | 846 | - name: prep |
834 | 847 | if: github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call' |
@@ -858,12 +871,22 @@ jobs: |
858 | 871 | sudo apt-get install tcl8.6 tclx valgrind -y |
859 | 872 | - name: test |
860 | 873 | if: true && !contains(github.event.inputs.skiptests, 'valkey') |
861 | | - run: ./runtest --valgrind --no-latency --failures-output test-failures/valkey.json --verbose --clients 1 --timeout 2400 --dump-logs ${{github.event.inputs.test_args}} |
| 874 | + env: |
| 875 | + VALGRIND_TEST: ${{ inputs.valgrind_test }} |
| 876 | + run: | |
| 877 | + shard_args=() |
| 878 | + case "${{ matrix.shard }}" in |
| 879 | + unit) shard_args=(--single tests/unit) ;; |
| 880 | + cluster) shard_args=(--single tests/unit/cluster) ;; |
| 881 | + integration-type) shard_args=(--single tests/integration --single tests/unit/type) ;; |
| 882 | + targeted) shard_args=(--single "$VALGRIND_TEST") ;; |
| 883 | + esac |
| 884 | + ./runtest --valgrind --no-latency --failures-output test-failures/valkey.json --verbose --clients 1 --timeout 2400 --dump-logs "${shard_args[@]}" ${{github.event.inputs.test_args}} |
862 | 885 | - name: Upload test failures |
863 | 886 | if: always() |
864 | 887 | uses: ./.github/actions/upload-test-failures |
865 | 888 | with: |
866 | | - job-name: ${{ github.job }} |
| 889 | + job-name: ${{ github.job }}-${{ matrix.shard }} |
867 | 890 | test-valgrind-misc: |
868 | 891 | runs-on: ubuntu-latest |
869 | 892 | if: | |
@@ -920,13 +943,18 @@ jobs: |
920 | 943 | with: |
921 | 944 | job-name: ${{ github.job }} |
922 | 945 | test-valgrind-no-malloc-usable-size-test: |
| 946 | + name: test-valgrind-no-malloc-usable-size-test (${{ matrix.shard }}) |
923 | 947 | runs-on: ubuntu-latest |
924 | 948 | if: | |
925 | 949 | (github.event_name == 'workflow_call' || github.event_name == 'workflow_dispatch' || |
926 | 950 | (github.event_name == 'schedule' && github.repository == 'valkey-io/valkey') || |
927 | 951 | (github.event_name == 'pull_request' && github.event.pull_request.base.ref != 'unstable' && github.event.action != 'labeled')) && |
928 | 952 | !contains(github.event.inputs.skipjobs, 'valgrind') && !contains(github.event.inputs.skiptests, 'valkey') |
929 | 953 | timeout-minutes: 1440 |
| 954 | + strategy: |
| 955 | + fail-fast: false |
| 956 | + matrix: |
| 957 | + shard: ${{ fromJSON(inputs.valgrind_test && '["targeted"]' || '["unit", "cluster", "integration-type"]') }} |
930 | 958 | steps: |
931 | 959 | - name: prep |
932 | 960 | if: github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call' |
@@ -956,12 +984,22 @@ jobs: |
956 | 984 | sudo apt-get install tcl8.6 tclx valgrind -y |
957 | 985 | - name: test |
958 | 986 | if: true && !contains(github.event.inputs.skiptests, 'valkey') |
959 | | - run: ./runtest --valgrind --no-latency --failures-output test-failures/valkey.json --verbose --clients 1 --timeout 2400 --dump-logs ${{github.event.inputs.test_args}} |
| 987 | + env: |
| 988 | + VALGRIND_TEST: ${{ inputs.valgrind_test }} |
| 989 | + run: | |
| 990 | + shard_args=() |
| 991 | + case "${{ matrix.shard }}" in |
| 992 | + unit) shard_args=(--single tests/unit) ;; |
| 993 | + cluster) shard_args=(--single tests/unit/cluster) ;; |
| 994 | + integration-type) shard_args=(--single tests/integration --single tests/unit/type) ;; |
| 995 | + targeted) shard_args=(--single "$VALGRIND_TEST") ;; |
| 996 | + esac |
| 997 | + ./runtest --valgrind --no-latency --failures-output test-failures/valkey.json --verbose --clients 1 --timeout 2400 --dump-logs "${shard_args[@]}" ${{github.event.inputs.test_args}} |
960 | 998 | - name: Upload test failures |
961 | 999 | if: always() |
962 | 1000 | uses: ./.github/actions/upload-test-failures |
963 | 1001 | with: |
964 | | - job-name: ${{ github.job }} |
| 1002 | + job-name: ${{ github.job }}-${{ matrix.shard }} |
965 | 1003 | test-valgrind-no-malloc-usable-size-misc: |
966 | 1004 | runs-on: ubuntu-latest |
967 | 1005 | if: | |
|
0 commit comments