Skip to content

Commit

Permalink
ci: add log verification
Browse files Browse the repository at this point in the history
  • Loading branch information
sevenautumns committed Nov 5, 2024
1 parent e86e70d commit 563423c
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 5 deletions.
34 changes: 33 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,36 @@ jobs:
- name: Check CGroup
run: systemd-run --user --scope cat /proc/self/cgroup
- name: Run example ${{ matrix.example }}
run: nix develop --command systemd-run-example-${{ matrix.example }} --duration $DURATION
shell: nix develop --command bash -e {0}
run: systemd-run-example-${{ matrix.example }} --duration $DURATION 2>&1 | tee ./output.log
- name: Verify output
run: |
! grep "ERROR" ./output.log || false
! grep "panic" ./output.log || false
if [ "${{ matrix.example }}" = "hello_part" ]; then
! grep "WARN" ./output.log || false
grep "Received via Sampling Port: CustomMessage" ./output.log ||
{ printf "no custom message received"; exit 1; }
fi
if [ "${{ matrix.example }}" = "fuel_tank" ]; then
! grep "WARN" ./output.log || false
fi
if [ "${{ matrix.example }}" = "ping" ]; then
grep "received valid response" ./output.log ||
{ printf "no valid response received"; exit 1; }
fi
if [ "${{ matrix.example }}" = "dev_random" ]; then
! grep "WARN" ./output.log || false
grep "got some randomness" ./output.log ||
{ printf "missing randomness log info"; exit 1; }
fi
if [ "${{ matrix.example }}" = "ping_queue" ]; then
grep "Received valid response" ./output.log ||
{ printf "no valid response received"; exit 1; }
fi
if [ "${{ matrix.example }}" = "redirect_stdio" ]; then
! grep "WARN" ./output.log || false
grep "Terminating partition" ./output.log ||
{ printf "partition didn't terminate as expected"; exit 1; }
fi
4 changes: 2 additions & 2 deletions examples/ping/ping.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ major_frame: 1s
partitions:
- id: 0
name: ping_client
duration: 10ms
duration: 30ms
offset: 0ms
period: 1s
image: ping_client
- id: 1
name: ping_server
duration: 20ms
duration: 30ms
offset: 450ms
period: 1s
image: ping_server
Expand Down
4 changes: 2 additions & 2 deletions examples/ping_queue/ping_queue.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ major_frame: 1s
partitions:
- id: 0
name: ping_queue_client
duration: 10ms
duration: 30ms
offset: 0ms
period: 1s
image: ping_queue_client
- id: 1
name: ping_queue_server
duration: 20ms
duration: 30ms
offset: 450ms
period: 1s
image: ping_queue_server
Expand Down

0 comments on commit 563423c

Please sign in to comment.