Skip to content

Commit

Permalink
Add test for Testing Farm timeout (#181)
Browse files Browse the repository at this point in the history
* Add test for Testing Farm timeout.
* Make time lower
* Remove reduntant url
* Fix calling curl

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
Co-authored-by: Jan Macku <jamacku@redhat.com>
  • Loading branch information
phracek and jamacku authored Jun 10, 2024
1 parent 98394fa commit d9a5049
Show file tree
Hide file tree
Showing 20 changed files with 342 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/timeout-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
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: ./
id: tf_results
with:
api_key: ${{ secrets.TF_PUBLIC_API_KEY }}
git_ref: "main"
tmt_plan_regex: "timeout_plan"
pull_request_status_name: "Timeout test"
update_pull_request_status: "true"
timeout: 10

- name: Check if log contains exceed limit
run: |
curl ${{ steps.tf_results.outputs.test_log_url }} > results.log
ret_val = $(grep 'duration \"10s\" exceeded' results.log)
if [[ $ret_val != 0 ]]; then
exit 1
fi
exit 0
12 changes: 12 additions & 0 deletions dist/error.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/error.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 40 additions & 0 deletions dist/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/main.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions dist/octokit.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/octokit.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions dist/post.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/post.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

53 changes: 53 additions & 0 deletions dist/pull-request.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/pull-request.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

78 changes: 78 additions & 0 deletions dist/schema/input.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/schema/input.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions dist/schema/testing-farm-api.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d9a5049

Please sign in to comment.