Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unchanged files with check annotations (beta) #405

Open
VictorComette opened this issue Jan 5, 2024 · 2 comments
Open

Unchanged files with check annotations (beta) #405

VictorComette opened this issue Jan 5, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@VictorComette
Copy link

VictorComette commented Jan 5, 2024

Describe a bug

I'm unable to prevent coverage annotation on unchanged files. I've setup the action with annotations: coverage and expected to have annotations to changed files only, as stated in the docs:

coverage - Will annotate those sections of your code that test did not cover. Limited to changed lines when used on a Pull Request

Even so, GH is adding a entire section on the diff entitled "Unchanged files with check annotations (beta)" with a bunch of annotations.

As we are starting a long effort of covering a huge legacy application with tests, this is becoming an issue due to the extensive number of files without coverage.

I see this should be addressed already, per this closed issue, but it's not working for me.

Expected behavior

To have coverage annotations on changed files only (changed lines if possible).

Details

  • Action version: v2.2.4

  • OS, where your action is running (windows, linux): linux (ubuntu)

  • action.yml file
    ```yml
    name: Build and Test
    
    on:
      workflow_call:
        secrets: ...
        ...
        
     jobs:
       build-and-test:
       ...
         - name: Test
            id: test
            run:  npm run test:coverage:ci
            # jest --verbose --ci --coverage --json --testLocationInResults --outputFile=report.json
    
          - name: Find Current Pull Request
            id: findPr
            uses: jwalton/[email protected]
    
          - name: Report Test Coverage
            uses: ArtiomTr/[email protected]
            with:
              prnumber: ${{ steps.findPr.outputs.number }}
              annotations: coverage
              coverage-file: report.json
              base-coverage-file: report.json
    ```
    
  • Screenshots
    image

Additional context

@VictorComette VictorComette added the bug Something isn't working label Jan 5, 2024
@ArtiomTr
Copy link
Owner

ArtiomTr commented Mar 3, 2024

Hello @VictorComette, can you please provide minimal reproducible example of this issue? If not, maybe you can email your report.json file as well as PR diff to [email protected]?

@StevenBoutcher
Copy link

I'm seeing this issue using the recommended default setup for this action on v2.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants