-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Python] Make it easier to run Python tests in CI (#15714)
* Run Python Test script on CI * Redirect log for pretty output * Update output * Fix * Update doc * Update script * Fix * Disable re-CASE * Update test * Add no-wifi variant * Fix log * Remove test in build.yaml * Enrich functions for enable and disable tests * Remove wait time, update doc * Fix * These words should not by typo?
- Loading branch information
Showing
13 changed files
with
708 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -216,3 +216,169 @@ jobs: | |
path: objdir-clone/ | ||
# objdirs are big; don't hold on to them too long. | ||
retention-days: 5 | ||
repl_tests_linux: | ||
name: REPL Tests - Linux | ||
timeout-minutes: 120 | ||
|
||
strategy: | ||
matrix: | ||
build_variant: [no-ble-no-wifi-tsan] | ||
|
||
env: | ||
BUILD_VARIANT: ${{matrix.build_variant}} | ||
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.56 | ||
options: | ||
--privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 | ||
net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1" | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
- 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 Python REPL and example apps | ||
timeout-minutes: 50 | ||
run: | | ||
scripts/run_in_build_env.sh './scripts/build_python.sh --install_wheel build-env' | ||
./scripts/run_in_build_env.sh \ | ||
"./scripts/build/build_examples.py \ | ||
--target linux-x64-all-clusters-${BUILD_VARIANT} \ | ||
build \ | ||
--copy-artifacts-to objdir-clone \ | ||
" | ||
- name: Run Tests | ||
timeout-minutes: 30 | ||
run: | | ||
scripts/run_in_build_env.sh './scripts/tests/run_python_test.py --app chip-all-clusters-app --factoryreset -- -t 3600 --disable-test ClusterObjectTests.TestTimedRequestTimeout' | ||
- name: Uploading core files | ||
uses: actions/upload-artifact@v2 | ||
if: ${{ failure() }} && ${{ !env.ACT }} | ||
with: | ||
name: | ||
crash-core-linux-python-repl | ||
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@v2 | ||
if: ${{ failure() }} && ${{ !env.ACT }} | ||
with: | ||
name: | ||
crash-objdir-linux-python-repl | ||
path: objdir-clone/ | ||
# objdirs are big; don't hold on to them too long. | ||
retention-days: 5 | ||
|
||
repl_tests_darwin: | ||
name: REPL Tests - Darwin | ||
timeout-minutes: 120 | ||
|
||
strategy: | ||
matrix: | ||
build_variant: [no-ble-no-wifi-tsan] | ||
env: | ||
BUILD_VARIANT: ${{matrix.build_variant}} | ||
TSAN_OPTIONS: "halt_on_error=1" | ||
|
||
if: github.actor != 'restyled-io[bot]' | ||
runs-on: macos-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
- name: Setup Environment | ||
# coreutils for stdbuf | ||
run: brew install openssl pkg-config coreutils | ||
- name: | ||
Try to ensure the directories for core dumping and diagnostic | ||
log collection exist and we can write them. | ||
run: | | ||
sudo chown ${USER} /cores || true | ||
mkdir -p ~/Library/Logs/DiagnosticReports || true | ||
mkdir objdir-clone || true | ||
- name: Fix pkgconfig link | ||
working-directory: /usr/local/lib/pkgconfig | ||
run: | | ||
pwd | ||
ls -la /usr/local/Cellar/ | ||
ls -la /usr/local/Cellar/[email protected] | ||
OPEN_SSL_VERSION=`ls -la /usr/local/Cellar/[email protected] | cat | tail -n1 | awk '{print $NF}'` | ||
ln -s /usr/local/Cellar/[email protected]/$OPEN_SSL_VERSION/lib/pkgconfig/* . | ||
- name: Bootstrap | ||
timeout-minutes: 25 | ||
run: scripts/build/gn_bootstrap.sh | ||
- name: Uploading bootstrap logs | ||
uses: actions/upload-artifact@v2 | ||
if: ${{ always() }} && ${{ !env.ACT }} | ||
with: | ||
name: | ||
bootstrap-logs-darwin-${{ matrix.build_variant }}${{ matrix.chip_tool }} | ||
path: | | ||
.environment/gn_out/.ninja_log | ||
.environment/pigweed-venv/*.log | ||
- name: Build Python REPL and example apps | ||
timeout-minutes: 50 | ||
run: | | ||
scripts/run_in_build_env.sh './scripts/build_python.sh --install_wheel build-env' | ||
./scripts/run_in_build_env.sh \ | ||
"./scripts/build/build_examples.py \ | ||
--target darwin-x64-all-clusters-${BUILD_VARIANT} \ | ||
build \ | ||
--copy-artifacts-to objdir-clone \ | ||
" | ||
- name: Run Tests | ||
timeout-minutes: 30 | ||
run: | | ||
scripts/run_in_build_env.sh './scripts/tests/run_python_test.py --app chip-all-clusters-app --factoryreset --app-params "--discriminator 3840 --interface-id -1" -- -t 3600 --disable-test ClusterObjectTests.TestTimedRequestTimeout' | ||
- name: Uploading core files | ||
uses: actions/upload-artifact@v2 | ||
if: ${{ failure() }} && ${{ !env.ACT }} | ||
with: | ||
name: | ||
crash-core-darwin-python-repl | ||
path: /cores/ | ||
# Cores are big; don't hold on to them too long. | ||
retention-days: 5 | ||
- name: Uploading diagnostic logs | ||
uses: actions/upload-artifact@v2 | ||
if: ${{ failure() }} && ${{ !env.ACT }} | ||
with: | ||
name: | ||
crash-log-darwin-python-repl | ||
path: ~/Library/Logs/DiagnosticReports/ | ||
- name: Uploading objdir for debugging | ||
uses: actions/upload-artifact@v2 | ||
if: ${{ failure() }} && ${{ !env.ACT }} | ||
with: | ||
name: | ||
crash-objdir-darwin-python-repl | ||
path: objdir-clone/ | ||
# objdirs are big; don't hold on to them too long. | ||
retention-days: 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.