Skip to content
This repository has been archived by the owner on Dec 26, 2023. It is now read-only.

setup help #22

Open
pepone opened this issue Feb 2, 2022 · 13 comments
Open

setup help #22

pepone opened this issue Feb 2, 2022 · 13 comments

Comments

@pepone
Copy link

pepone commented Feb 2, 2022

Hi,

I'm trying to setup nunit-reporter with my .NET 6 project

I have

    - name: Test
      run: dotnet test --no-build --verbosity normal --collect:"XPlat Code Coverage" --logger:"nunit;LogFilePath=TestResults/TestResults.xml"
    - name: NUnit Reporter
      uses: MirageNet/[email protected]
      if: always()
      with:
        path: tests/*/TestResults/TestResults.xml
        access-token: ${{ secrets.GITHUB_TOKEN }}

But the reporter step fails with

Run MirageNet/[email protected]
  with:
    path: tests/*/TestResults/TestResults.xml
    access-token: ***
    numFailures: 30
  env:
    DOTNET_ROOT: /home/runner/.dotnet
    SSH_AUTH_SOCK: /tmp/ssh-eAwEOAlnnS92/agent.1827
    SSH_AGENT_PID: 1828
Error: Resource not accessible by integration

Can you tell me what is wrong with my setup?

Cheers,
Jose

@paulpach
Copy link
Contributor

do you have a repro build?

@paulpach
Copy link
Contributor

Can you try with version 1.1.0?

@pepone
Copy link
Author

pepone commented Feb 28, 2022

tried with 1.10

Run MirageNet/[email protected]
  with:
    path: tests/Tests.ClientServer/TestResults/TestResults.xml
    access-token: ***
    numFailures: 30
    reportTitle: Test Report
  env:
    DOTNET_ROOT: /home/runner/.dotnet
    SSH_AUTH_SOCK: /tmp/ssh-m9dQwVqXv9Fo/agent.1946
    SSH_AGENT_PID: 1947
Error: Resource not accessible by integration

I'm using it from a private repository, not sure if that matters.

@paulpach
Copy link
Contributor

is this running in a PR for a fork by any chance?

I found this
And some good read here.

Assuming you are sending a PR from a fork, would it be possible for you to get an access token to the origin repo? if so, you can create a token there and use it instead of secrets.GITHUB_TOKEN

@pepone
Copy link
Author

pepone commented Feb 28, 2022

This is running in a PR from a fork. I setup a GitHub token and get a different error

Error: You must authenticate via a GitHub App.

My repository is a mix of Rust and C# on the rust side I run actions-rs/clippy@master and this correctly annotates the rust build without additional permissions, it is not clear why nunit-reporter needs additional permissions.

@paulpach
Copy link
Contributor

From the readme, it seems the entire motivation for actions-rs/clippy was to replace clippy-check so that it would not require GITHUB_TOKEN and it would work on prs from forks.

I'll check how they do that.

@paulpach
Copy link
Contributor

Ok, I implemented the same hack they did, can you try this branch before I merge it? like this:

- uses: MirageNet/nunit-reporter@accesscode
      if: always()
      with:
        path: Tests/*.xml

@pepone
Copy link
Author

pepone commented Feb 28, 2022

I gett Parameter token or opts.auth is required

@paulpach
Copy link
Contributor

paulpach commented Feb 28, 2022

make sure you put in @accesscode at the end, otherwise you are still using master

@pepone
Copy link
Author

pepone commented Mar 1, 2022

I retry but still get the same error

Run MirageNet/nunit-reporter@accesscode
  with:
    path: tests/Tests.ClientServer/TestResults/TestResults.xml
    numFailures: 30
    reportTitle: Test Report
  env:
    DOTNET_ROOT: /home/runner/.dotnet
    SSH_AUTH_SOCK: /tmp/ssh-SbmGYOTtJwOR/agent.181
    SSH_AGENT_PID: 181
Error: Parameter token or opts.auth is required

@pepone
Copy link
Author

pepone commented Mar 1, 2022

Seems the check is still in the dist/indes.js, missing rebuild?

throw new Error('Parameter token or opts.auth is required');

@pepone
Copy link
Author

pepone commented Mar 2, 2022

Hi @paulpach

Rebuild with the latest changes and no longer get token errors

Test Report for Test Report
  1 tests failed
  
  **908 tests passed**
  **1 tests failed**
  
  * Failed test Server_Exceptions in ServerTests  

But I don't see any annotations for the failed test in the Actions summary or elsewhere.

@paulpach
Copy link
Contributor

yeah, this is not working yet. they are doing something strange that I have not managed to reproduce

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants