Skip to content

Commit 26a4b6d

Browse files
authored
GH Actions smoke test for TH install (#1046)
* GH Actions smoke test for TH install update frontend image rev remove 'ubuntu' as a username requirement * changed image incorrectly * revert change to docker-compose since it is no longer needed * remove debugging step
1 parent b7e29a6 commit 26a4b6d

6 files changed

Lines changed: 63 additions & 24 deletions

File tree

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Install and smoke test TH
2+
on:
3+
workflow_dispatch:
4+
push:
5+
paths:
6+
- '.github/workflows/th-install-and-smoke-test.yml'
7+
- 'scripts/**'
8+
- 'cli/**'
9+
- 'backend/**'
10+
- 'docker-compose*.yml'
11+
12+
jobs:
13+
arm64-smoke-test:
14+
runs-on: ubuntu-24.04-arm
15+
timeout-minutes: 180
16+
env:
17+
TH_TEST_CASE_ID: TC-ACE-1.1
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
with:
22+
submodules: recursive
23+
24+
- name: submodule info
25+
run: |
26+
git submodule status --recursive
27+
28+
- name: Install Test Harness
29+
run: |
30+
printf '2\n' | ./scripts/ubuntu/auto-install.sh
31+
./scripts/ubuntu/auto-update.sh $(git rev-parse --abbrev-ref HEAD)
32+
33+
- name: Start Test Harness services
34+
run: |
35+
./scripts/start.sh
36+
37+
- name: Output available tests from TH CLI
38+
run: |
39+
th-cli available-tests --compact
40+
41+
- name: Run a sample test with th-cli against a sample app
42+
run: |
43+
"$HOME/apps/chip-all-clusters-app" \
44+
--discriminator 3840 \
45+
--passcode 20202021 \
46+
--KVS /tmp/chip-kvs \
47+
--trace-to json:/tmp/chip-all-clusters-app.json > /tmp/chip-all-clusters-app.log 2>&1 &
48+
sleep 2
49+
printf "1\n" | th-cli run-tests \
50+
--tests-list "${TH_TEST_CASE_ID}" \
51+
--config backend/test_collections/matter/default_project.config \
52+
--title "arm64-ci-smoke" \
53+
--no-color

scripts/ubuntu/1-install-dependencies.sh

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,9 @@ sudo sed -i "s/#\$nrconf{kernelhints} = -1;/\$nrconf{kernelhints} = -1;/g" /etc/
3232
sudo sed -i "s/#\$nrconf{restart} = 'i';/\$nrconf{restart} = 'a';/" /etc/needrestart/needrestart.conf
3333

3434
sudo DEBIAN_FRONTEND=noninteractive apt-get update -y
35-
sudo DEBIAN_FRONTEND=noninteractive apt-get upgrade -y
3635

37-
readarray packagelist < "$UBUNTU_SCRIPT_DIR/package-dependency-list.txt"
38-
39-
SAVEIFS=$IFS
40-
IFS=$(echo -en "\r")
41-
for package in ${packagelist[@]}; do
42-
print_script_step "Installing package: ${package[@]}"
43-
sudo DEBIAN_FRONTEND=noninteractive apt-get satisfy "${package%%[[:space:]]}" -y --allow-downgrades
44-
done
45-
IFS=$SAVEIFS
36+
print_script_step "Installing packages"
37+
sudo DEBIAN_FRONTEND=noninteractive apt-get --no-upgrade satisfy "$(paste -sd, $UBUNTU_SCRIPT_DIR/package-dependency-list.txt)" -y --allow-downgrades
4638

4739
print_script_step "Install Poetry, needed for Test Harness CLI"
4840
curl -sSL https://install.python-poetry.org | python3 -

scripts/ubuntu/1.2-install-additional-dependencies.sh

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,8 @@ sudo DEBIAN_FRONTEND=noninteractive apt-get install --only-upgrade -y \
5959
libselinux1-dev \
6060
zlib1g-dev || true
6161

62-
readarray -t packagelist < "$UBUNTU_SCRIPT_DIR/additional-dependency-list.txt"
62+
print_script_step "Installing additional packages"
6363

64-
for package in "${packagelist[@]}"; do
65-
[ -z "$package" ] && continue
66-
67-
print_script_step "Installing additional package: $package"
68-
69-
sudo DEBIAN_FRONTEND=noninteractive apt-get satisfy "$package" -y --allow-downgrades
70-
done
64+
sudo DEBIAN_FRONTEND=noninteractive apt-get --no-upgrade satisfy "$(paste -sd, $UBUNTU_SCRIPT_DIR/additional-dependency-list.txt)" -y --allow-downgrades
7165

7266
print_end_of_script

scripts/ubuntu/2-machine-cofiguration.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ After=network.target
9797
[Service]
9898
Type=oneshot
9999
User=$USER
100-
Group=ubuntu
100+
Group=$(id -gn)
101101
ExecStart=$ROOT_DIR/scripts/start.sh
102102
[Install]
103103
WantedBy=default.target

scripts/update-th-code.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ print_script_step "Stashing local changes"
3838
git stash --include-untracked
3939
git submodule foreach 'git stash --include-untracked'
4040

41-
print_script_step "Pulling Test Harness code"
41+
print_script_step "Pulling Test Harness code for branch: $ROOT_BRANCH"
4242
git fetch
4343
git checkout $ROOT_BRANCH
4444
git pull

scripts/utils.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,14 @@ check_ubuntu_os_version()
8585

8686
check_user_name()
8787
{
88-
USER_NAME=$(whoami)
89-
if [ "$USER_NAME" != "ubuntu" ]; then
88+
USER_NAME=$(id -un)
89+
if [ "$USER_NAME" = "root" ]; then
9090
printf "\n\n"
9191
printf "###################################################################################\n"
92-
printf "###### The Matter certification tool requires the username to be 'ubuntu' #######\n"
92+
printf "###### The Matter certification tool must be run from a non-root user account ######\n"
9393
printf "###################################################################################\n"
9494
printf "# #\n"
95-
printf "# After creating the 'ubuntu' user, log in and run the auto-install script again. #\n"
95+
printf "# Log in with your regular user account and run the auto-install script again. #\n"
9696
printf "# #\n"
9797
printf "###################################################################################\n"
9898
return 1

0 commit comments

Comments
 (0)