Skip to content

Commit

Permalink
feat: add support for issue metadata and dynamic summary
Browse files Browse the repository at this point in the history
It replaces the old comment logic with the new one that uses issue metadata
to story helper data. It allows us to create only one comment with a summary
of all tests and their results which is dynamically updated.

Also enable issue comments for our Testing Farm GitHub Action repository.
  • Loading branch information
jamacku authored and phracek committed Sep 24, 2024
1 parent d2b99fd commit a0f6ca1
Show file tree
Hide file tree
Showing 57 changed files with 7,904 additions and 871 deletions.
1 change: 1 addition & 0 deletions .github/workflows/base-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ jobs:
tmt_plan_regex: "smoke_plan"
pull_request_status_name: "Smoke test"
update_pull_request_status: "true"
create_issue_comment: "true"
1 change: 1 addition & 0 deletions .github/workflows/secrets_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ jobs:
pull_request_status_name: "Secrets test"
secrets: "SOME_DUMMY_SECRET=FOO_BAR_SECRET;OS_SECRET=DUMMY_SECRET_OS"
update_pull_request_status: "true"
create_issue_comment: "true"
1 change: 1 addition & 0 deletions .github/workflows/timeout-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
pull_request_status_name: "Timeout test"
update_pull_request_status: "true"
timeout: 60
create_issue_comment: "true"

- name: Check if testing farm test reached past the timeout limit
if: ${{ !cancelled() }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/variables_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ jobs:
pull_request_status_name: "Variables test"
variables: "SOME_DUMMY_VARIABLE=FOO_BAR_VARIABLE;OS_VARIABLE=DUMMY_OS"
update_pull_request_status: "true"
create_issue_comment: "true"
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ See [Testing Farm onboarding guide](https://docs.testing-farm.io/Testing%20Farm/
|------------|-------------|---------------|
| `github_token` | GitHub token passed from secrets | `${{ github.token }}` |
| `create_issue_comment` | If GitHub action will create a github issue comment | false |
| `pull_request_status_name` | GitHub pull request status name | Fedora |
| `pull_request_status_name` | GitHub pull request status name is also used as the name of the test in the Job Summary and in comments. | Fedora |
| `update_pull_request_status` | Action will update pull request status. | false |
| `environment_settings` | Pass custom settings to the test environment. | empty |
| `pipeline_settings` | Pass specific settings for the testing farm pipeline. For example, `'{ "type": "tmt-multihost" }'`. For details, see `settings.pipeline` field in [Request new test](https://api.testing-farm.io/redoc#operation/request_a_new_test_v0_1_requests_post). | empty |
Expand Down Expand Up @@ -97,7 +97,7 @@ See [Testing Farm onboarding guide](https://docs.testing-farm.io/Testing%20Farm/
> statuses: write
> ```
## Example
## Examples
### Pull request example
Expand Down Expand Up @@ -162,3 +162,16 @@ jobs:
with:
api_key: ${{ secrets.TF_API_KEY }}
```
### How to setup Pull Request summary comments
Set the following inputs:
- `create_issue_comment: 'true'`
- `pull_request_status_name: 'Test name'`
Action uses the `pull_request_status_name` as the name of the test. Also it is used to distinguish between different tests when running multiple tests in parallel.
<p align="center">
<img src="images/summary-comment.png" width="600" alt="Summary comment example" />
</p>
53 changes: 29 additions & 24 deletions dist/action.js

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

Loading

0 comments on commit a0f6ca1

Please sign in to comment.