0

I've got a project which builds, runs unit tests and generates coverage reports set up. The last part which is failing is to upload the reports to Codecov from Travis. It works locally from my Windows PC.

Travis configuration:

language: csharp
solution: ./Backend/Sppd.TeamTuner.sln
mono: latest
dist: xenial
dotnet: 2.2

script:
- ./build.sh --target Run-Upload-All-Tests

Failing part of cake script:

#tool nuget:?package=Codecov&version=1.4.0
#addin nuget:?package=Cake.Codecov&version=0.6.0

Task("Upload-Coverage")
    .Does(() =>
{
    Codecov($"{testCoverageResults}/{unitTestResultsFileName}", "x");
    Codecov($"{testCoverageResults}/{integrationTestResultsFileName}", "x");
    Codecov($"{testCoverageResults}/{apiTestResultsFileName}", "x");
});

The build fails with: run-detectors: unable to find an interpreter for /home/travis/build/taconaut/Sppd.TeamTuner/tools/Codecov.1.4.0/tools/codecov.exe

Is this something I can influence? I'm unsure if this has something to do with the OS, Travis, Codecov, Cake.Codecov or a reference I should add.

It runs fine from powershell:

              _____          _
             / ____|        | |
            | |     ___   __| | ___  ___ _____   __
            | |    / _ \ / _  |/ _ \/ __/ _ \ \ / /
            | |___| (_) | (_| |  __/ (_| (_) \ V /
             \_____\___/ \____|\___|\___\___/ \_/
                                         exe-1.4.0

2019-05-05 19:33:39 WRN No CI detected.
2019-05-05 19:33:39 INF Git detected.
2019-05-05 19:33:40 INF Project root: E:\dev\Sppd.TeamTuner
2019-05-05 19:33:40 INF Yaml not found, that's ok! Learn more at http://docs.codecov.io/docs/codecov-yaml
2019-05-05 19:33:40 INF Reading reports.
2019-05-05 19:33:40 INF E:/dev/Sppd.TeamTuner/coverage-results/coverage-results-api.opencover.xml
2019-05-05 19:33:40 INF Uploading Reports.
2019-05-05 19:33:41 INF url: https://codecov.io
2019-05-05 19:33:41 INF query: https://codecov.io/upload/v4?branch=feature/coverlet-support&commit=94dec25c4111330a6d29a813105461b216fde473&build=&tag=&pr=&name=&flags=&slug=taconaut%2FSppd.TeamTuner&package=exe-1.4.0&build_url=&yaml=&job=&service=
2019-05-05 19:33:41 INF Pinging Codecov
2019-05-05 19:33:44 INF Uploading to S3 https://codecov.io
2019-05-05 19:33:44 INF View reports at: https://codecov.io/github/taconaut/Sppd.TeamTuner/commit/94dec25c4111330a6d29a813105461b216fde473
Philippe
  • 1,949
  • 4
  • 31
  • 57
  • 1
    Unfortunately, for the moment Codecov-exe do not support Travis. Version 1.4.0 don't support anything other than Windows as well, although version 1.5.0 added support for Linux and OS X, this is only available through Codecov.Tool and through pre-compiled archives on the release page. – AdmiringWorm May 06 '19 at 05:19
  • @AdmiringWorm is there a guide how to use Codecov.Tool for this? I'm pretty new to all this. – Philippe May 06 '19 at 06:54
  • 1
    No guide for that unfortunately. But you first need to enable installation of .net core tools: see https://stackoverflow.com/questions/52477022/cake-install-dotnet-core-tool The instead of restoring the tool with `#tool nuget:?package=Codecov&version=1.4.0`, use `#tool dotnet:?package=Codecov.Tool&version=1.5.0` This will only get you part of the way though, you also need to pass in all the needed parameters to codecov-exe to allow the use on travis, see https://cakebuild.net/api/Cake.Codecov/CodecovSettings/ for all parameters that can be passed. At this point it is uncertain what is needed – AdmiringWorm May 06 '19 at 11:19
  • Thanks for your help! As it doesn't seem trivial I'll leave this aside for now. I wanted to setup a workaround with a Jenkins instance on Windows, but encountered another issue (you might have seen my PR on Cake.Codecov) – Philippe May 06 '19 at 12:07
  • I'm afraid that I have not seen your PR on Cake.Codecov, there is only 1 open PR, and it is for bumping the version of one of our build dependencies. – AdmiringWorm May 06 '19 at 16:20
  • My bad, I meant Cake.Coverlet – Philippe May 06 '19 at 17:08

0 Answers0