vitess.io/vitess@v0.16.2/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_suite.yml (about)

     1  # DO NOT MODIFY: THIS FILE IS GENERATED USING "make generate_ci_workflows"
     2  
     3  name: Cluster (onlineddl_vrepl_stress_suite)
     4  on: [push, pull_request]
     5  concurrency:
     6    group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (onlineddl_vrepl_stress_suite)')
     7    cancel-in-progress: true
     8  
     9  env:
    10    LAUNCHABLE_ORGANIZATION: "vitess"
    11    LAUNCHABLE_WORKSPACE: "vitess-app"
    12    GITHUB_PR_HEAD_SHA: "${{ github.event.pull_request.head.sha }}"
    13  
    14  jobs:
    15    build:
    16      name: Run endtoend tests on Cluster (onlineddl_vrepl_stress_suite)
    17      runs-on: ubuntu-22.04
    18  
    19      steps:
    20      - name: Skip CI
    21        run: |
    22          if [[ "${{contains( github.event.pull_request.labels.*.name, 'Skip CI')}}" == "true" ]]; then
    23            echo "skipping CI due to the 'Skip CI' label"
    24            exit 1
    25          fi
    26  
    27      - name: Check if workflow needs to be skipped
    28        id: skip-workflow
    29        run: |
    30          skip='false'
    31          if [[ "${{github.event.pull_request}}" ==  "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then
    32            skip='true'
    33          fi
    34          echo Skip ${skip}
    35          echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
    36  
    37      - name: Check out code
    38        if: steps.skip-workflow.outputs.skip-workflow == 'false'
    39        uses: actions/checkout@v3
    40  
    41      - name: Check for changes in relevant files
    42        if: steps.skip-workflow.outputs.skip-workflow == 'false'
    43        uses: frouioui/paths-filter@main
    44        id: changes
    45        with:
    46          token: ''
    47          filters: |
    48            end_to_end:
    49              - 'go/**/*.go'
    50              - 'test.go'
    51              - 'Makefile'
    52              - 'build.env'
    53              - 'go.sum'
    54              - 'go.mod'
    55              - 'proto/*.proto'
    56              - 'tools/**'
    57              - 'config/**'
    58              - 'bootstrap.sh'
    59              - '.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_suite.yml'
    60              - 'go/test/endtoend/onlineddl/vrepl_suite/testdata'
    61  
    62      - name: Set up Go
    63        if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
    64        uses: actions/setup-go@v3
    65        with:
    66          go-version: 1.20.3
    67  
    68      - name: Set up python
    69        if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
    70        uses: actions/setup-python@v4
    71  
    72      - name: Tune the OS
    73        if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
    74        run: |
    75          # Limit local port range to not use ports that overlap with server side
    76          # ports that we listen on.
    77          sudo sysctl -w net.ipv4.ip_local_port_range="22768 65535"
    78          # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio
    79          echo "fs.aio-max-nr = 1048576" | sudo tee -a /etc/sysctl.conf
    80          sudo sysctl -p /etc/sysctl.conf
    81  
    82      - name: Get dependencies
    83        if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
    84        run: |
    85          
    86          # Get key to latest MySQL repo
    87          sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29
    88          # Setup MySQL 8.0
    89          wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.24-1_all.deb
    90          echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections
    91          sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config*
    92          sudo apt-get update
    93          # Install everything else we need, and configure
    94          sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5
    95  
    96          sudo service mysql stop
    97          sudo service etcd stop
    98          sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/
    99          sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
   100          go mod download
   101  
   102          # install JUnit report formatter
   103          go install github.com/vitessio/go-junit-report@HEAD
   104  
   105      - name: Setup launchable dependencies
   106        if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
   107        run: |
   108          # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
   109          pip3 install --user launchable~=1.0 > /dev/null
   110  
   111          # verify that launchable setup is all correct.
   112          launchable verify || true
   113  
   114          # Tell Launchable about the build you are producing and testing
   115          launchable record build --name "$GITHUB_RUN_ID" --source .
   116  
   117      - name: Run cluster endtoend test
   118        if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
   119        timeout-minutes: 45
   120        run: |
   121          # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file
   122          # which musn't be more than 107 characters long.
   123          export VTDATAROOT="/tmp/"
   124          source build.env
   125  
   126          set -x
   127  
   128          # run the tests however you normally do, then produce a JUnit XML file
   129          eatmydata -- go run test.go -docker=false -follow -shard onlineddl_vrepl_stress_suite | tee -a output.txt | go-junit-report -set-exit-code > report.xml
   130  
   131      - name: Print test output and Record test result in launchable
   132        if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
   133        run: |
   134          # send recorded tests to launchable
   135          launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
   136  
   137          # print test output
   138          cat output.txt