Skip to content

Commit

Permalink
Split integration test job
Browse files Browse the repository at this point in the history
  • Loading branch information
timower committed Nov 13, 2023
1 parent a5b4eeb commit 60b5479
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 11 deletions.
39 changes: 35 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,40 @@ jobs:
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)

- uses: yogeshlonkar/wait-for-jobs@v0
- name: Upload Test Binary
uses: actions/upload-artifact@v2
with:
name: host-package
path: build/host/tools/rm2fb-emu/rm2fb-test

integration-tests:
runs-on: ubuntu-latest
needs: [build, build-host]

strategy:
matrix:
fw_version: ['2.15.1', '3.3.2', '3.5.2']

steps:
- uses: actions/checkout@v3
with:
jobs: 'build'
lfs: 'true'

- name: Install Deps
run: sudo apt-get install -y libsdl2-2.0-0

- name: Download package
uses: actions/download-artifact@v2
with:
name: package
path: packages/

- name: Download host package
uses: actions/download-artifact@v2
with:
name: host-package
path: tools/

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
Expand All @@ -82,13 +106,20 @@ jobs:

- name: Integration Tests
id: intest
run: mkdir ./tmp && ./test/integration/test.sh ${{ env.IMAGE_NAME }} ./packages/ ./build/host ./tmp
run: |
chmod +x ./tools/rm2fb-test
mkdir ./tmp
./test/integration/test.sh \
${{ env.IMAGE_NAME }}${{ matrix.fw_version }} \
./packages/ \
./tools/rm2fb-test \
./tmp
- name: Upload test results
if: ${{ failure() && steps.intest.conclusion == 'failure' }}
uses: actions/upload-artifact@v2
with:
name: test_failures
name: test_failures_${{ matrix.fw_version }}
path: ./tmp


Expand Down
12 changes: 5 additions & 7 deletions test/integration/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -eux

DOCKER_IMAGE=$1
IPKS_PATH=$(readlink -f "$2")
HOST_BUILD_PATH=$(readlink -f "$3")
TEST_BINARY=$(readlink -f "$3")


TEST_DIR=$(dirname -- "$(readlink -f -- "$0")")
Expand All @@ -28,8 +28,7 @@ check_screenshot() {
NAME="$1"
SH_PATH="${TMP_DIR}/${NAME}"

"$HOST_BUILD_PATH"/tools/rm2fb-emu/rm2fb-test \
127.0.0.1 8888 screenshot "${SH_PATH}"
"$TEST_BINARY" 127.0.0.1 8888 screenshot "${SH_PATH}"

for matches in "$@"
do
Expand All @@ -45,8 +44,7 @@ check_screenshot() {
}

tap_at() {
"$HOST_BUILD_PATH"/tools/rm2fb-emu/rm2fb-test \
127.0.0.1 8888 touch "$1" "$2"
"$TEST_BINARY" 127.0.0.1 8888 touch "$1" "$2"
}

image=$(docker run --name rm-docker --rm -d -p 2222:22 -p 8888:8888 "$DOCKER_IMAGE")
Expand All @@ -62,9 +60,9 @@ scp -P 2222 "$IPKS_PATH"/*.ipk root@localhost:
# Update & install display to make sure rm2fb.ipa replaces it.
do_ssh systemctl restart systemd-timesyncd
do_ssh opkg update
# do_ssh opkg install display || true # This fails as rm2fb fails to start.

do_ssh opkg install ./*.ipk
# Xochitl fails to install on 3.5 :(
do_ssh opkg install ./*.ipk || true
do_ssh systemctl daemon-reload

do_ssh systemctl start rm2fb
Expand Down

0 comments on commit 60b5479

Please sign in to comment.