kafka

Форк
0
/
deflake.yml 
85 строк · 3.2 Кб
1
# Licensed to the Apache Software Foundation (ASF) under one or more
2
# contributor license agreements.  See the NOTICE file distributed with
3
# this work for additional information regarding copyright ownership.
4
# The ASF licenses this file to You under the Apache License, Version 2.0
5
# (the "License"); you may not use this file except in compliance with
6
# the License.  You may obtain a copy of the License at
7
#
8
#    http://www.apache.org/licenses/LICENSE-2.0
9
#
10
# Unless required by applicable law or agreed to in writing, software
11
# distributed under the License is distributed on an "AS IS" BASIS,
12
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
# See the License for the specific language governing permissions and
14
# limitations under the License.
15

16
name: 'Deflake a test'
17
on:
18
  workflow_dispatch:
19
    inputs:
20
      test-module:
21
        description: 'Gradle sub-module which contains the test being de-flaked. Should be like :core'
22
        required: true
23
        type: string
24
      test-pattern:
25
        description: 'Test class to de-flake (must be a ClusterTest). Should be like *SomeTest*'
26
        required: true
27
        type: string
28
      test-repeat:
29
        description: 'Number of times to invoke the test'
30
        required: true
31
        type: number
32
        default: 1
33
      java-version:
34
        description: 'Java version to use.'
35
        required: true
36
        type: string
37
        default: '17'
38

39
jobs:
40
  deflake:
41
    runs-on: ubuntu-latest
42
    name: Deflake JUnit tests
43
    steps:
44
      - name: Checkout code
45
        uses: actions/checkout@v4
46
        with:
47
          persist-credentials: false
48
      - name: Setup Gradle
49
        uses: ./.github/actions/setup-gradle
50
        with:
51
          java-version: ${{ inputs.java-version }}
52
          gradle-cache-read-only: true
53
          develocity-access-key: ${{ secrets.GE_ACCESS_TOKEN }}
54
      - name: Test
55
        timeout-minutes: 60
56
        id: junit-test
57
        env:
58
          TEST_REPEAT: ${{ inputs.test-repeat }}
59
          TEST_MODULE: ${{ inputs.test-module }}
60
          TEST_PATTERN: ${{ inputs.test-pattern }}
61
        run: |
62
          set +e
63
          ./gradlew --info --build-cache --scan --continue \
64
          -PtestLoggingEvents=started,passed,skipped,failed \
65
          -PignoreFailures=true -PmaxParallelForks=2 \
66
          -Pkafka.cluster.test.repeat=$TEST_REPEAT \
67
          -PmaxTestRetries=$TEST_REPEAT -PmaxTestRetryFailures=0 \
68
          -PmaxQuarantineTestRetries=$TEST_REPEAT -PmaxQuarantineTestRetryFailures=0 \
69
          ${TEST_MODULE}:test ${TEST_MODULE}:quarantinedTest --tests $TEST_PATTERN
70
          exitcode="$?"
71
          echo "exitcode=$exitcode" >> $GITHUB_OUTPUT
72
      - name: Archive JUnit reports
73
        uses: actions/upload-artifact@v4
74
        id: junit-upload-artifact
75
        with:
76
          name: junit-reports-${{ inputs.java-version }}
77
          path: |
78
            **/build/reports/tests/test/*
79
          if-no-files-found: ignore
80
      - name: Parse JUnit tests
81
        run: python .github/scripts/junit.py >> $GITHUB_STEP_SUMMARY
82
        env:
83
          GITHUB_WORKSPACE: ${{ github.workspace }}
84
          REPORT_URL: ${{ steps.junit-upload-artifact.outputs.artifact-url }}
85
          GRADLE_EXIT_CODE: ${{ steps.junit-test.outputs.exitcode }}
86

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.