Skip to content

Commit

Permalink
Add script to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
mkardous-silabs committed May 14, 2024
1 parent 4d61830 commit 40cdf03
Showing 1 changed file with 64 additions and 27 deletions.
91 changes: 64 additions & 27 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ name: Tests
on:
push:
branches-ignore:
- 'dependabot/**'
- "dependabot/**"
pull_request:
merge_group:
workflow_dispatch:

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name ==
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
Expand All @@ -42,15 +43,18 @@ jobs:
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"
TSAN_OPTIONS:
"halt_on_error=1
suppressions=scripts/tests/chiptest/tsan-linux-suppressions.txt"
LSAN_OPTIONS: detect_leaks=1

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

container:
image: ghcr.io/project-chip/chip-build:50
options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0
options:
--privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0
net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1"

steps:
Expand All @@ -68,9 +72,12 @@ jobs:
- name: Checkout submodules & Bootstrap
uses: ./.github/actions/checkout-submodules-and-bootstrap
with:
platform: linux
bootstrap-log-name: bootstrap-logs-linux-${{ matrix.build_variant }}${{ matrix.chip_tool }}
- name: Try to ensure the directories for core dumping exist and we
platform: linux
bootstrap-log-name:
bootstrap-logs-linux-${{ matrix.build_variant }}${{
matrix.chip_tool }}
- name:
Try to ensure the directories for core dumping exist and we
can write them.
run: |
mkdir /tmp/cores || true
Expand Down Expand Up @@ -220,7 +227,9 @@ jobs:
--copy-artifacts-to objdir-clone \
"
- name: Run Tests using the python parser sending commands to chip-tool
- name:
Run Tests using the python parser sending commands to
chip-tool
run: |
./scripts/run_in_build_env.sh \
"./scripts/tests/run_test_suite.py \
Expand All @@ -240,7 +249,9 @@ jobs:
--rvc-app ./out/linux-x64-rvc-${BUILD_VARIANT}/chip-rvc-app \
"
- name: Run purposeful failure tests using the python parser sending commands to chip-tool
- name:
Run purposeful failure tests using the python parser sending
commands to chip-tool
run: |
./scripts/run_in_build_env.sh \
"./scripts/tests/run_test_suite.py \
Expand Down Expand Up @@ -303,15 +314,19 @@ jobs:
uses: actions/upload-artifact@v4
if: ${{ failure() && !env.ACT }}
with:
name: crash-core-linux-${{ matrix.build_variant }}${{ matrix.chip_tool }}
name:
crash-core-linux-${{ matrix.build_variant }}${{
matrix.chip_tool }}
path: /tmp/cores/
# Cores are big; don't hold on to them too long.
retention-days: 5
- name: Uploading objdir for debugging
uses: actions/upload-artifact@v4
if: ${{ failure() && !env.ACT }}
with:
name: crash-objdir-linux-${{ matrix.build_variant }}${{ matrix.chip_tool }}
name:
crash-objdir-linux-${{ matrix.build_variant }}${{
matrix.chip_tool }}
path: objdir-clone/
# objdirs are big; don't hold on to them too long.
retention-days: 5
Expand All @@ -327,7 +342,9 @@ jobs:
BUILD_VARIANT: ${{matrix.build_variant}}
CHIP_TOOL_VARIANT: ${{matrix.chip_tool}}
TSAN_OPTIONS: "halt_on_error=1"
LSAN_OPTIONS: detect_leaks=1 suppressions=scripts/tests/chiptest/lsan-mac-suppressions.txt
LSAN_OPTIONS:
detect_leaks=1
suppressions=scripts/tests/chiptest/lsan-mac-suppressions.txt

if: github.actor != 'restyled-io[bot]'
runs-on: macos-13
Expand All @@ -348,9 +365,10 @@ jobs:
- name: Checkout submodules & Bootstrap
uses: ./.github/actions/checkout-submodules-and-bootstrap
with:
platform: darwin
bootstrap-log-name: bootstrap-logs-darwin-${{ matrix.build_variant }}${{ matrix.chip_tool }}

platform: darwin
bootstrap-log-name:
bootstrap-logs-darwin-${{ matrix.build_variant }}${{
matrix.chip_tool }}

- name: Build Apps
run: |
Expand All @@ -370,7 +388,9 @@ jobs:
--copy-artifacts-to objdir-clone \
"
- name: Run Tests using the python parser sending commands to chip-tool
- name:
Run Tests using the python parser sending commands to
chip-tool
run: |
./scripts/run_in_build_env.sh \
"./scripts/tests/run_test_suite.py \
Expand All @@ -391,7 +411,9 @@ jobs:
--rvc-app ./out/darwin-x64-rvc-${BUILD_VARIANT}/chip-rvc-app \
"
- name: Run purposeful failure tests using the python parser sending commands to chip-tool
- name:
Run purposeful failure tests using the python parser sending
commands to chip-tool
run: |
./scripts/run_in_build_env.sh \
"./scripts/tests/run_test_suite.py \
Expand All @@ -410,21 +432,27 @@ jobs:
uses: actions/upload-artifact@v4
if: ${{ failure() && !env.ACT }}
with:
name: crash-core-darwin-${{ matrix.build_variant }}${{ matrix.chip_tool }}
name:
crash-core-darwin-${{ matrix.build_variant }}${{
matrix.chip_tool }}
path: /cores/
# Cores are big; don't hold on to them too long.
retention-days: 5
- name: Uploading diagnostic logs
uses: actions/upload-artifact@v4
if: ${{ failure() && !env.ACT }}
with:
name: crash-log-darwin-${{ matrix.build_variant }}${{ matrix.chip_tool }}
name:
crash-log-darwin-${{ matrix.build_variant }}${{
matrix.chip_tool }}
path: ~/Library/Logs/DiagnosticReports/
- name: Uploading objdir for debugging
uses: actions/upload-artifact@v4
if: ${{ failure() && !env.ACT }}
with:
name: crash-objdir-darwin-${{ matrix.build_variant }}${{ matrix.chip_tool }}
name:
crash-objdir-darwin-${{ matrix.build_variant }}${{
matrix.chip_tool }}
path: objdir-clone/
# objdirs are big; don't hold on to them too long.
retention-days: 5
Expand All @@ -433,14 +461,17 @@ jobs:
name: REPL Tests - Linux

env:
TSAN_OPTIONS: "halt_on_error=1 suppressions=scripts/tests/chiptest/tsan-linux-suppressions.txt"
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: ghcr.io/project-chip/chip-build:50
options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0
options:
--privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0
net.ipv4.conf.all.forwarding=0 net.ipv6.conf.all.forwarding=0"

steps:
Expand All @@ -449,9 +480,12 @@ jobs:
- name: Checkout submodules & Bootstrap
uses: ./.github/actions/checkout-submodules-and-bootstrap
with:
platform: linux
bootstrap-log-name: bootstrap-logs-linux-${{ matrix.build_variant }}${{ matrix.chip_tool }}
- name: Try to ensure the directories for core dumping exist and we
platform: linux
bootstrap-log-name:
bootstrap-logs-linux-${{ matrix.build_variant }}${{
matrix.chip_tool }}
- name:
Try to ensure the directories for core dumping exist and we
can write them.
run: |
mkdir /tmp/cores || true
Expand Down Expand Up @@ -508,6 +542,7 @@ jobs:
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_FAN_3_4.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_FAN_3_5.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-lit-icd-ipv6only-no-ble-no-wifi-tsan-clang-test/lit-icd-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_ICDM_2_1.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-lit-icd-ipv6only-no-ble-no-wifi-tsan-clang-test/lit-icd-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_ICDM_3_1.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-lit-icd-ipv6only-no-ble-no-wifi-tsan-clang-test/lit-icd-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json --enable-key 000102030405060708090a0b0c0d0e0f" --script "src/python_testing/TC_ICDManagementCluster.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_IDM_1_2.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json --enable-key 000102030405060708090a0b0c0d0e0f" --script "src/python_testing/TC_IDM_1_4.py" --script-args "--hex-arg PIXIT.DGGEN.TEST_EVENT_TRIGGER_KEY:000102030405060708090a0b0c0d0e0f --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
Expand Down Expand Up @@ -606,8 +641,10 @@ jobs:
- name: Checkout submodules & Bootstrap
uses: ./.github/actions/checkout-submodules-and-bootstrap
with:
platform: darwin
bootstrap-log-name: bootstrap-logs-darwin-${{ matrix.build_variant }}${{ matrix.chip_tool }}
platform: darwin
bootstrap-log-name:
bootstrap-logs-darwin-${{ matrix.build_variant }}${{
matrix.chip_tool }}

- name: Build Python REPL and example apps
run: |
Expand Down

0 comments on commit 40cdf03

Please sign in to comment.