Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,19 @@ on:
types: [created]

jobs:
debug:
runs-on: ubuntu-latest
steps:
- run: echo "event name ${{github.event_name}}"
- run: echo "event type ${{github.event_type}}"
- run: echo "Is PR ${{github.event.issue.pull_request}}"
- run: echo "Comment body ${{github.event.issue.comment.body}}"

build:
runs-on: ubuntu-latest
if: ${{ github.event.type != 'IssueCommentEvent' || (github.event.type == 'IssueCommentEvent' && contains(github.event.comment.html_url, '/pull/') && contains(github.event.issue.comment.body, '/checkCoverage')) }}
if: ${{ github.event_name != 'issue_comment' || (github.event_name == 'issue_comment'
&& github.event.issue.pull_request
&& contains(github.event.issue.comment.body, '/checkCoverage')) }}

name: Check test coverage

Expand All @@ -33,6 +43,15 @@ jobs:
python config/transformJacocoResult.py
cat build/reports/jacoco/test/output_table.html >> $GITHUB_STEP_SUMMARY

- name: Comment
if: ${{ github.event.event_name == 'issue_comment' }}
env:
PR_NUMBER: ${{ github.event.issue.number }}
GH_TOKEN: ${{ github.token }}
run: |
content=$(cat build/reports/jacoco/test/output_table.html)
gh pr comment $PR_NUMBER --body "$content"

- name: Upload coverage result
if: always()
uses: actions/upload-artifact@v4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@

class SessionEventRegistry implements ApplicationListener<@NonNull AbstractSessionEvent> {

private Map<String, AbstractSessionEvent> events = new HashMap<>();
private final Map<String, AbstractSessionEvent> events = new HashMap<>();

private ConcurrentMap<String, Object> locks = new ConcurrentHashMap<>();
private final ConcurrentMap<String, Object> locks = new ConcurrentHashMap<>();

@Override
public void onApplicationEvent(AbstractSessionEvent event) {
Expand Down