Skip to content

Commit

Permalink
Fix TC-TIMESYNC-2.5, add all to CI (#28021)
Browse files Browse the repository at this point in the history
* Fix start and end times for dst

* Add tests to CI

* add pics files

* Wrong test
  • Loading branch information
cecille authored and pull[bot] committed Jan 30, 2024
1 parent 4956439 commit f432b43
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 30 deletions.
96 changes: 68 additions & 28 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ on:
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

env:
CHIP_NO_LOG_TIMESTAMPS: true

jobs:
test_suites_linux:
name: Test Suites - Linux
Expand All @@ -40,15 +41,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:1
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 @@ -66,9 +70,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 @@ -212,7 +219,9 @@ jobs:
--bridge-app ./out/linux-x64-bridge-${BUILD_VARIANT}/chip-bridge-app \
"
- name: Run Tests using the python parser sending commands to chip-tool
- name:
Run Tests using the python parser sending commands to
chip-tool
# https://github.com/project-chip/connectedhomeip/issues/27673
if: matrix.build_variant != 'no-ble-tsan-clang'
run: |
Expand Down Expand Up @@ -271,15 +280,19 @@ jobs:
uses: actions/upload-artifact@v3
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@v3
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 @@ -289,14 +302,16 @@ jobs:

strategy:
matrix:
build_variant: [no-ble-asan-clang]
build_variant: [no-ble-asan-clang]
# Since no-ble-tsan-clang doesn't run any tests, this is just wasted CI time for now
chip_tool: [""]
env:
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-latest
Expand All @@ -317,9 +332,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 Down Expand Up @@ -353,8 +369,10 @@ jobs:
--bridge-app ./out/darwin-x64-bridge-${BUILD_VARIANT}/chip-bridge-app \
"
- name: Run Tests using the python parser sending commands to chip-tool
# https://github.com/project-chip/connectedhomeip/issues/27673
- name:
Run Tests using the python parser sending commands to
chip-tool
# https://github.com/project-chip/connectedhomeip/issues/27673
if: matrix.build_variant != 'no-ble-tsan-clang'
run: |
./scripts/run_in_build_env.sh \
Expand All @@ -377,21 +395,27 @@ jobs:
uses: actions/upload-artifact@v3
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@v3
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@v3
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 @@ -400,14 +424,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:1
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 @@ -416,9 +443,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 @@ -448,7 +478,15 @@ 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_decode 1" --script "src/python_testing/TC_ACE_1_3.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021"'
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_decode 1" --script "src/python_testing/TC_CGEN_2_4.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021"'
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_decode 1" --script "src/python_testing/TC_DA_1_2.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"'
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_decode 1" --script "src/python_testing/TC_TIMESYNC_3_1.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021"'
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_decode 1" --script "src/python_testing/TC_TIMESYNC_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"'
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_decode 1" --script "src/python_testing/TC_TIMESYNC_2_2.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"'
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_decode 1" --script "src/python_testing/TC_TIMESYNC_2_4.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"'
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_decode 1" --script "src/python_testing/TC_TIMESYNC_2_5.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"'
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_decode 1" --script "src/python_testing/TC_TIMESYNC_2_6.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"'
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_decode 1" --script "src/python_testing/TC_TIMESYNC_2_7.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"'
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_decode 1" --script "src/python_testing/TC_TIMESYNC_2_8.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"'
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_decode 1" --script "src/python_testing/TC_TIMESYNC_2_9.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"'
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_decode 1" --script "src/python_testing/TC_TIMESYNC_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"'
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_decode 1" --script "src/python_testing/TC_DA_1_5.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"'
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_decode 1" --script "src/python_testing/TestCommissioningTimeSync.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021"'
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_decode 1" --script "src/python_testing/TC_IDM_1_2.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021"'
Expand Down Expand Up @@ -499,8 +537,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
4 changes: 2 additions & 2 deletions src/python_testing/TC_TIMESYNC_2_5.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ async def test_TC_TIMESYNC_2_5(self):
for i in range(dst_max_size_dut):
year = 3.156e+13
six_months = 1.577e+13
vstart = year*i + six_months
vuntil = year * (i+1)
vstart = th_utc + year*i + six_months
vuntil = th_utc + year * (i+1)
dst.append(dst_struct(offset=3600, validStarting=vstart, validUntil=vuntil))
await self.send_set_dst_cmd(dst=dst)

Expand Down

0 comments on commit f432b43

Please sign in to comment.