csMACnz / coveralls.net

Coveralls uploader for .Net Code coverage
MIT License
87 stars 27 forks source link

Dotnet 3x error #94

Closed shargon closed 2 years ago

shargon commented 4 years ago

When I try to install under dotnet 3x, it doesn't work.

Command line:

dotnet tool install -g coveralls.net --version 1.0.0
export PATH="$PATH:$HOME/.dotnet/tools"
csmacnz.Coveralls --version

Output :

It was not possible to find any compatible framework version
The specified framework 'Microsoft.NETCore.App', version '2.1.0' was not found.
  - The following frameworks were found:
      3.0.0 at [/usr/share/dotnet/shared/Microsoft.NETCore.App]
changhuixu commented 4 years ago

same here.

csMACnz commented 4 years ago

Thanks for letting me know, I'll take a look at what the best option here is soon.

csMACnz commented 4 years ago

Two workarounds:

The issue is that i either fork into two versions (one for each runtime) or I force everyone onto dotnet 3.0 runtime. It is likely that now we have had the runtime for a few weeks i can just make the breaking upgrade, and anyone on the old runtime can keep using the older version. I will know more once i get in there to make the upgrade. Otherwise my 300kb nuget becomes a massive 30+Mb package with all platform runtimes, and no longer portable.

changhuixu commented 4 years ago

I would like to see dotnet 3.0 runtime version. Thank you. It is the same situation in my work place... We have to move forward and encourage upgrades for applications in legacy stacks.

Kaliumhexacyanoferrat commented 4 years ago

I did not test this with coveralls.net, but setting the environment variable DOTNET_ROLL_FORWARD to Major should probably work as a temporary workaround.

changhuixu commented 4 years ago

In the end, I used https://github.com/coverallsapp/github-action This github action works great.

pfbrowning commented 4 years ago

This affected me as well. I'd love to use this library in the future when it supports .NET Core 3.1 without having to resort to one of the aforementioned workarounds. In the meantime I settled on using the Github action instead.

csMACnz commented 4 years ago

Thanks for all your patience on this. I finally have a 3.1 build. Version 2.0.0-beta.1 is built against the dotnet 3.1.200 sdk.

I haven't had a chance to roll it through all the test examples yet, hence it is still Beta (It has been able to publish it's own coverage though so that gives me confidence nothing has broken).

stop-cran commented 4 years ago

@csMACnz could you please upload the new version to Nuget as a beta/pre-release version?

csMACnz commented 4 years ago

I'm having issues with expired keys/tokens but will get the beta up there when i can.

zacanger commented 4 years ago

Thanks for building this tool. Just bumping this issue, I ran into this while setting it up in some pipelines. For anyone using this in Docker, this is working for me for now:

RUN curl -sL https://github.com/csMACnz/coveralls.net/releases/download/1.0.0/coveralls.net.1.0.0-linux.zip > coveralls.zip && \
      unzip coveralls.zip -d coveralls && \
      mv coveralls /usr/lib/ && \
      chmod +x /usr/lib/coveralls/csmacnz.Coveralls && \
      ln -s /usr/lib/coveralls/csmacnz.Coveralls /usr/bin/
thedonmon commented 4 years ago

Anyone know how to get this working for a Travis-CI build with netcore 3.1 installed? Currently getting this error after running dotnet tool install

zacanger commented 4 years ago

@thedonmon the snippet I have above would probably work, without the RUN directive, assuming curl and unzip are available.

thedonmon commented 4 years ago

Ok, yea i've tried so many different things finally got the exe to run but now running into this issue... Now just trying to grab the opencover xml. So if i add this in the before script:

before_script:
  - |
    curl -sL https://github.com/csMACnz/coveralls.net/releases/download/1.0.0/coveralls.net.1.0.0-linux.zip > coveralls.zip && \
     unzip coveralls.zip -d coveralls && \
     mv coveralls /usr/lib/ && \
     chmod +x /usr/lib/coveralls/csmacnz.Coveralls && \
     ln -s /usr/lib/coveralls/csmacnz.Coveralls /usr/bin/
    |

I should be able to run csmacnz.Coveralls --opencover -i $COVERALLS_FILEPATH --repoToken $COVERALLS_REPO_TOKEN --commitId $TRAVIS_COMMIT --commitBranch $TRAVIS_BRANCH --commitAuthor "$REPO_COMMIT_AUTHOR" --commitEmail "$REPO_COMMIT_AUTHOR_EMAIL" --commitMessage "$REPO_COMMIT_MESSAGE" --jobId $TRAVIS_JOB_ID --serviceName "travis-ci" --useRelativePaths in the script section? Im giving it a shot now

Thanks for the quick reply @zacanger

thedonmon commented 4 years ago

Ok, yea i've tried so many different things finally got the exe to run but now running into this issue... Now just trying to grab the opencover xml. So if i add this in the before script:

before_script:
  - |
    curl -sL https://github.com/csMACnz/coveralls.net/releases/download/1.0.0/coveralls.net.1.0.0-linux.zip > coveralls.zip && \
     unzip coveralls.zip -d coveralls && \
     mv coveralls /usr/lib/ && \
     chmod +x /usr/lib/coveralls/csmacnz.Coveralls && \
     sudo ln -s /usr/lib/coveralls/csmacnz.Coveralls /usr/bin/

I should be able to run csmacnz.Coveralls --opencover -i $COVERALLS_FILEPATH --repoToken $COVERALLS_REPO_TOKEN --commitId $TRAVIS_COMMIT --commitBranch $TRAVIS_BRANCH --commitAuthor "$REPO_COMMIT_AUTHOR" --commitEmail "$REPO_COMMIT_AUTHOR_EMAIL" --commitMessage "$REPO_COMMIT_MESSAGE" --jobId $TRAVIS_JOB_ID --serviceName "travis-ci" --useRelativePaths in the script section? Im giving it a shot now

Thanks for the quick reply @zacanger

Update it worked, just had to add sudo to the symlink cmd (ln)

csMACnz commented 4 years ago

I've just pushed 2.0.0-beta0002 to nuget, which should support .Net 3.1 without all the hoops 🤞