From c69d88c45aa81b5083c98590c6ff7514527d3920 Mon Sep 17 00:00:00 2001 From: Badlop Date: Fri, 22 Dec 2023 15:12:05 +0100 Subject: [PATCH] Runtime: Rebars: Add log tests similar to the Mix job --- .github/workflows/runtime.yml | 43 +++++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/.github/workflows/runtime.yml b/.github/workflows/runtime.yml index cc5dc1df7..6202a97cf 100644 --- a/.github/workflows/runtime.yml +++ b/.github/workflows/runtime.yml @@ -81,33 +81,62 @@ jobs: rel/ejabberd/bin/ejabberdctl start \ && rel/ejabberd/bin/ejabberdctl started rel/ejabberd/bin/ejabberdctl register user1 localhost s0mePass - rel/ejabberd/bin/ejabberdctl registered_users localhost + rel/ejabberd/bin/ejabberdctl register user2 localhost s0mePass + rel/ejabberd/bin/ejabberdctl registered_users localhost > registered.log cat rel/ejabberd/logs/* - - name: Test rel + - name: Run rel if: matrix.rebar != 'rebar' run: | make rel _build/prod/rel/ejabberd/bin/ejabberdctl start \ && _build/prod/rel/ejabberd/bin/ejabberdctl started _build/prod/rel/ejabberd/bin/ejabberdctl register user1 localhost s0mePass - _build/prod/rel/ejabberd/bin/ejabberdctl registered_users localhost + _build/prod/rel/ejabberd/bin/ejabberdctl registered_users localhost > registered.log _build/prod/rel/ejabberd/bin/ejabberdctl stop \ && _build/prod/rel/ejabberd/bin/ejabberdctl stopped - cat _build/prod/rel/ejabberd/logs/* - - name: Test dev + - name: Run dev if: matrix.rebar != 'rebar' run: | make dev _build/dev/rel/ejabberd/bin/ejabberdctl start \ && _build/dev/rel/ejabberd/bin/ejabberdctl started - _build/dev/rel/ejabberd/bin/ejabberdctl register user1 localhost s0mePass - _build/dev/rel/ejabberd/bin/ejabberdctl registered_users localhost + _build/dev/rel/ejabberd/bin/ejabberdctl register user2 localhost s0mePass + _build/dev/rel/ejabberd/bin/ejabberdctl registered_users localhost >> registered.log _build/dev/rel/ejabberd/bin/ejabberdctl stop \ && _build/dev/rel/ejabberd/bin/ejabberdctl stopped + + - name: View logs + if: matrix.rebar != 'rebar' + run: | + echo "===> Registered:" + cat registered.log + echo "===> Prod:" + cat _build/prod/rel/ejabberd/logs/* + echo "===> Dev:" cat _build/dev/rel/ejabberd/logs/* + - name: Check rel + if: matrix.rebar != 'rebar' + run: | + grep -q '^user1$' registered.log + grep -q '^user2$' registered.log + grep -q 'is started' _build/prod/rel/ejabberd/logs/ejabberd.log + grep -q 'is stopped' _build/prod/rel/ejabberd/logs/ejabberd.log + test $(find _build/prod/ -empty -name error.log) + grep -q 'is started' _build/dev/rel/ejabberd/logs/ejabberd.log + grep -q 'is stopped' _build/dev/rel/ejabberd/logs/ejabberd.log + test $(find _build/dev/ -empty -name error.log) + + - name: View logs failures + if: matrix.rebar != 'rebar' + run: | + cat _build/prod/rel/ejabberd/logs/ejabberd.log + cat _build/prod/rel/ejabberd/logs/error.log + cat _build/dev/rel/ejabberd/logs/ejabberd.log + cat _build/dev/rel/ejabberd/logs/error.log + mix: name: Mix strategy: