Code Monkey home page Code Monkey logo

Comments (25)

eddyxu avatar eddyxu commented on July 17, 2024

@mkfifo Yeah, if you'd like, please feel free to do so.

from cpp-coveralls.

chrisosaurus avatar chrisosaurus commented on July 17, 2024

@eddyxu are you happy for it to always give up if no token is found, or do you want it hidden behind a flag?

I would much prefer for it to always give up.

from cpp-coveralls.

eddyxu avatar eddyxu commented on July 17, 2024

I'd prefer to raise Exception if no token was found. Most of the user should use travis-ci, so they are not affected. While for others, like you, it might be better to fix it other than hide it.

from cpp-coveralls.

chrisosaurus avatar chrisosaurus commented on July 17, 2024

Awesome, I will get onto that shortly.

@eddyxu how are travis-ci users not affected by this?

from cpp-coveralls.

eddyxu avatar eddyxu commented on July 17, 2024

@mkfifo My mistake. Still in work now. What I meant is that this token is required from coveralls.io, thus we should failure at the beginning when we find it is not set.

from cpp-coveralls.

chrisosaurus avatar chrisosaurus commented on July 17, 2024

This has been added to pull request #81 which deals with issue #80 and this issue #82

from cpp-coveralls.

chrisosaurus avatar chrisosaurus commented on July 17, 2024

for now I have rolled back the fix for issue #82 as it needs a little more work first

from cpp-coveralls.

chrisosaurus avatar chrisosaurus commented on July 17, 2024

I have now re-pushed and updated PR #81
I also had to change the testing file

from cpp-coveralls.

moteus avatar moteus commented on July 17, 2024

For travis you does not have to set repo token.

from cpp-coveralls.

chrisosaurus avatar chrisosaurus commented on July 17, 2024

@moteus how does that work?
Does travis-ci have the ability to submit to any coverall.io repo? Mine didn't seem to work without passing the token.

from cpp-coveralls.

moteus avatar moteus commented on July 17, 2024

REFERENCING A REPOSITORY

from cpp-coveralls.

chrisosaurus avatar chrisosaurus commented on July 17, 2024

@moteus thanks for that, I couldn't get that to work but maybe I was doing something incorrect.

In that case we do NOT want my code to raise an exception if no token is found, we only want that behavior in the case of running within a non-travis-ci environment.

This also changes my updates to the README file.

from cpp-coveralls.

chrisosaurus avatar chrisosaurus commented on July 17, 2024

In that case I have removed the code that raises this error from my main masterhttps://github.com/mkfifo/cpp-coveralls branch and pushed it into old-master https://github.com/mkfifo/cpp-coveralls/tree/old_master

from cpp-coveralls.

chrisosaurus avatar chrisosaurus commented on July 17, 2024

PR #81 now no longer includes anything touching this issue.

from cpp-coveralls.

chrisosaurus avatar chrisosaurus commented on July 17, 2024

I would still like cpp-coveralls to issue an error IF there is no token, but as pointed out a token is only required in certain contexts and I think it is hard for cpp-coveralls to work out which context it is in.

I also still cannot seem to get travis-ci and coveralls.io behaving nicely together...

from cpp-coveralls.

chrisosaurus avatar chrisosaurus commented on July 17, 2024

I would like to know how travis and cpp-coveralls work without any setup, I am using the free travis.

The instructions in coveralls.io tell me:

First, if you are using Travis CI , make sure it's building correctly. If you're using Travis Pro, add the following lines to a .coveralls.yml file in your repository's root:
service_name: travis-pro
repo_token: TOKEN_GOES_HERE

I tried having a travis.yml matching the one given in [1] with no other travis setup mentioning coveralls but I did not see the build updates make it to coveralls.

For example my project linear_hash has a travis.yml matching the example [2], my travis page is [3] and my coveralls page is [4]

The commit currently missing on coveralls.io (but that is present on github and travis) is [5]

I can see that the travis build has completed, but the coveralls page has NOT yet updated.

Am I missing some setup in travis.ci for automated coveralls.io population?
Do I have to wait longer?, as generally my coverall.io jobs appear immediately.

[1] https://github.com/eddyxu/cpp-coveralls#linux
[2] https://github.com/mkfifo/linear_hash/blob/master/.travis.yml
[3] https://travis-ci.org/mkfifo/linear_hash/builds/59188736
[4] https://coveralls.io/r/mkfifo/linear_hash?branch=master
[5] chrisosaurus/linear_hash@fc53459

from cpp-coveralls.

eddyxu avatar eddyxu commented on July 17, 2024

@mkfifo It seems that it requires either service_job_id, which is TRAVIS_JOB_ID, or a repo token.

We can reference a repository in one of two ways:

  1. service_job_id String and service_name String
  2. repo_token String

In travis, service_job_id is get from TRAVIS_JOB_ID in __init__.py

   args.service_job_id = os.environ.get('TRAVIS_JOB_ID', '')

from cpp-coveralls.

chrisosaurus avatar chrisosaurus commented on July 17, 2024

@eddyxu thanks but that doesn't seem to be working for me, assuming the job id is automatically setup.

If you compare [1] to [2] that job is completely missing from coverall.io

So I am wondering what I need to do to have this automatically work?

As for the pull request what this means is I can have my code throw an exception if both the service_jobs_id AND the repo_token are not defined.

[1] https://travis-ci.org/mkfifo/linear_hash/builds/59188736
[2] https://coveralls.io/r/mkfifo/linear_hash?branch=master

from cpp-coveralls.

eddyxu avatar eddyxu commented on July 17, 2024

There is actually a result for your travis job on coveralls.io

https://coveralls.io/jobs/5536318

Could you try to run it with --verbose

from cpp-coveralls.

chrisosaurus avatar chrisosaurus commented on July 17, 2024

@eddyxu thanks for that, I am not seeing it on [1]

Running cpp-coverals with --verbose I get [2]

[1] https://coveralls.io/r/mkfifo/linear_hash?branch=master
[2] https://travis-ci.org/mkfifo/linear_hash/builds/59193237

from cpp-coveralls.

eddyxu avatar eddyxu commented on July 17, 2024

@mkfifo Take a look of https://coveralls.io/r/mkfifo/linear_hash?page=3

Build #12 11 and such are actually the results of the recent build. I am not sure whether it is a coveralls.io issue...

from cpp-coveralls.

chrisosaurus avatar chrisosaurus commented on July 17, 2024

@eddyxu thanks for that, if you look at [1] you can see the job number is "Job #11.1" and for [2] it is "Job #12.1" so whatever is generating this field is wrong:

{u'url': u'https://coveralls.io/jobs/5536318', u'message': u'Job #11.1'}

[1] https://travis-ci.org/mkfifo/linear_hash/builds/59188736#L328
[2] https://travis-ci.org/mkfifo/linear_hash/builds/59193237#L330

from cpp-coveralls.

chrisosaurus avatar chrisosaurus commented on July 17, 2024

Which I think is the result of the final print(result) in report.py post_report

def post_report(coverage):
    """Post coverage report to coveralls.io."""
    response = requests.post(URL, files={'json_file': json.dumps(coverage)})
    try:
        result = response.json()
    except ValueError:
        result = {'error': 'Failure to submit data. '
                  'Response [%(status)s]: %(text)s' % {
                      'status': response.status_code,
                      'text': response.text}}
    print(result)
    if 'error' in result:
        return result['error']
    return 0

Which makes me suspect a coveralls.io bug

from cpp-coveralls.

chrisosaurus avatar chrisosaurus commented on July 17, 2024

@moteus @eddyxu I have address the concerns around breaking the existing travis workflow and made a PR #84 which will raise an exception only if it cannot find the repo token and if it also cannot find the travis job id.

My issue reported above is still outstanding but I suspect that is a coverall.io bug.
EDIT: I also cannot seem to find where to report coveralls.io bugs...

from cpp-coveralls.

chrisosaurus avatar chrisosaurus commented on July 17, 2024

This issue was resolved in PR #84

The issue I was having is a bug with coveralls.io, unsure how to report it, but it doesn't change cpp-coveralls.

from cpp-coveralls.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.