Skip to content

Commit

Permalink
Add test for Testing Farm timeout.
Browse files Browse the repository at this point in the history
Check if timeout is handled properly

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
  • Loading branch information
phracek committed May 2, 2024
1 parent 7bc5ccc commit 6a8713f
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/timeout-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
on:
issue_comment:
types:
- created
jobs:
container-tests:
runs-on: ubuntu-22.04
name: "Timeout test for testing farm as a github action"

if: |
github.event.issue.pull_request
&& contains(github.event.comment.body, '[test]')
&& contains(fromJson('["OWNER", "MEMBER"]'), github.event.comment.author_association)
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
ref: "refs/pull/${{ github.event.issue.number }}/head"

- name: Run the tests
uses: ./
with:
api_key: ${{ secrets.TF_PUBLIC_API_KEY }}
git_url: "https://github.com/sclorg/testing-farm-as-github-action"
git_ref: "main"
tmt_plan_regex: "timeout_plan"
pull_request_status_name: "Timeout test"
update_pull_request_status: "true"
10 changes: 10 additions & 0 deletions plans/timeout_plan.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
summary: Basic timeout test
execute:
how: tmt
duration: 10m
script: |
set +x
echo "Set sleep time to an hour for sure."
sleep 60*60
echo "this should never happened because of timeout"
exit 0

0 comments on commit 6a8713f

Please sign in to comment.