<commit_before># Copyright (c) 2020-2021 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Tests

on:
    push:
    pull_request:
    workflow_dispatch:

concurrency:
    group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name ==
        'pull_request' && github.event.number) || (github.event_name ==
        'workflow_dispatch' && github.run_number) || github.sha }}
    cancel-in-progress: true

jobs:
    test_suites_linux:
        name: Test Suites - Linux
        timeout-minutes: 120

        strategy:
            matrix:
                build_variant: [no-ble-tsan-clang]
                chip_tool: ["", -same-event-loop]
        env:
            BUILD_VARIANT: ${{matrix.build_variant}}
            CHIP_TOOL_VARIANT: ${{matrix.chip_tool}}
            TSAN_OPTIONS: "halt_on_error=1 suppressions=scripts/tests/chiptest/tsan-linux-suppressions.txt"

        if: github.actor != 'restyled-io[bot]'
        runs-on: ubuntu-latest

        container:
            image: connectedhomeip/chip-build:0.5.64
            options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0
                net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1"

        steps:
            - uses: Wandalen/wretry.action@v1.0.11
              name: Checkout
              with:
                  action: actions/checkout@v3
                  with: |
                      token: ${{ github.token }}
                  attempt_limit: 3
                  attempt_delay: 2000
            - name: Checkout submodules
              run: scripts/checkout_submodules.py --shallow --platform linux
            - name: Try to ensure the directories for core dumping exist and we
                  can write them.
              run: |
                  mkdir /tmp/cores || true
                  sysctl -w kernel.core_pattern=/tmp/cores/core.%u.%p.%t || true
                  mkdir objdir-clone || true
            - name: Bootstrap
              timeout-minutes: 10
              run: scripts/build/gn_bootstrap.sh
            - name: Uploading bootstrap logs
              uses: actions/upload-artifact@v2
              if: ${{ always() }} && ${{ !env.ACT }}
              with:
                  name: bootstrap-logs-linux-${{ matrix.build_variant }}${{ matrix.chip_tool }}
                  path: |
                      .environment/gn_out/.ninja_log
                      .environment/pigweed-venv/*.log
            - name: Build Apps
              timeout-minutes: 30
              run: |
                  ./scripts/run_in_build_env.sh \
                     "./scripts/build/build_examples.py \
                        --target linux-x64-chip-tool${CHIP_TOOL_VARIANT}-${BUILD_VARIANT} \
                        --target linux-x64-all-clusters-test-group-${BUILD_VARIANT} \
                        --target linux-x64-lock-${BUILD_VARIANT} \
                        --target linux-x64-tv-app-${BUILD_VARIANT} \
                        build \
                        --copy-artifacts-to objdir-clone \
                     "
            - name: Run Tests
              timeout-minutes: 30
              run: |
                  ./scripts/run_in_build_env.sh \
                  "./scripts/tests/run_test_suite.py \
                     --chip-tool ./out/linux-x64-chip-tool${CHIP_TOOL_VARIANT}-${BUILD_VARIANT}/chip-tool \
                     run \
                     --iterations 1 \
                     --all-clusters-app ./out/linux-x64-all-clusters-test-group-${BUILD_VARIANT}/chip-all-clusters-app \
                     --lock-app ./out/linux-x64-lock-${BUILD_VARIANT}/chip-lock-app \
                     --tv-app ./out/linux-x64-tv-app-${BUILD_VARIANT}/chip-tv-app \
                  "
            - name: Uploading core files
              uses: actions/upload-artifact@v2
              if: ${{ failure() }} && ${{ !env.ACT }}<commit_msg>[Tests] Increase the tests timeout from 30 minutes to 40 minutes (#17838)<commit_after># Copyright (c) 2020-2021 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Tests

on:
    push:
    pull_request:
    workflow_dispatch:

concurrency:
    group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name ==
        'pull_request' && github.event.number) || (github.event_name ==
        'workflow_dispatch' && github.run_number) || github.sha }}
    cancel-in-progress: true

jobs:
    test_suites_linux:
        name: Test Suites - Linux
        timeout-minutes: 120

        strategy:
            matrix:
                build_variant: [no-ble-tsan-clang]
                chip_tool: ["", -same-event-loop]
        env:
            BUILD_VARIANT: ${{matrix.build_variant}}
            CHIP_TOOL_VARIANT: ${{matrix.chip_tool}}
            TSAN_OPTIONS: "halt_on_error=1 suppressions=scripts/tests/chiptest/tsan-linux-suppressions.txt"

        if: github.actor != 'restyled-io[bot]'
        runs-on: ubuntu-latest

        container:
            image: connectedhomeip/chip-build:0.5.64
            options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0
                net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1"

        steps:
            - uses: Wandalen/wretry.action@v1.0.11
              name: Checkout
              with:
                  action: actions/checkout@v3
                  with: |
                      token: ${{ github.token }}
                  attempt_limit: 3
                  attempt_delay: 2000
            - name: Checkout submodules
              run: scripts/checkout_submodules.py --shallow --platform linux
            - name: Try to ensure the directories for core dumping exist and we
                  can write them.
              run: |
                  mkdir /tmp/cores || true
                  sysctl -w kernel.core_pattern=/tmp/cores/core.%u.%p.%t || true
                  mkdir objdir-clone || true
            - name: Bootstrap
              timeout-minutes: 10
              run: scripts/build/gn_bootstrap.sh
            - name: Uploading bootstrap logs
              uses: actions/upload-artifact@v2
              if: ${{ always() }} && ${{ !env.ACT }}
              with:
                  name: bootstrap-logs-linux-${{ matrix.build_variant }}${{ matrix.chip_tool }}
                  path: |
                      .environment/gn_out/.ninja_log
                      .environment/pigweed-venv/*.log
            - name: Build Apps
              timeout-minutes: 30
              run: |
                  ./scripts/run_in_build_env.sh \
                     "./scripts/build/build_examples.py \
                        --target linux-x64-chip-tool${CHIP_TOOL_VARIANT}-${BUILD_VARIANT} \
                        --target linux-x64-all-clusters-test-group-${BUILD_VARIANT} \
                        --target linux-x64-lock-${BUILD_VARIANT} \
                        --target linux-x64-tv-app-${BUILD_VARIANT} \
                        build \
                        --copy-artifacts-to objdir-clone \
                     "
            - name: Run Tests
              timeout-minutes: 40
              run: |
                  ./scripts/run_in_build_env.sh \
                  "./scripts/tests/run_test_suite.py \
                     --chip-tool ./out/linux-x64-chip-tool${CHIP_TOOL_VARIANT}-${BUILD_VARIANT}/chip-tool \
                     run \
                     --iterations 1 \
                     --all-clusters-app ./out/linux-x64-all-clusters-test-group-${BUILD_VARIANT}/chip-all-clusters-app \
                     --lock-app ./out/linux-x64-lock-${BUILD_VARIANT}/chip-lock-app \
                     --tv-app ./out/linux-x64-tv-app-${BUILD_VARIANT}/chip-tv-app \
                  "
            - name: Uploading core files
              uses: actions/upload-artifact@v2
              if: ${{ failure() }} && ${{ !env.ACT }}
{'fraction_non_alphanumeric': 0.1128338614757809, 'fraction_numerical': 0.015052059755545496, 'mean_word_length': 1.527745995423341, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3922484', 'n_tokens_mistral': 2684, 'n_tokens_neox': 2438, 'n_words': 529}