dwyl / cid

❄️cid ("content id") is a human-friendly (readable/typeable) unique ID function built for distributed/decentralised systems.
GNU General Public License v2.0
33 stars 3 forks source link

Cannot get codecov badge to work #28

Closed RobStallion closed 5 years ago

RobStallion commented 5 years ago

Have been trying to add codecov badge but cannot seem to get it to work for some reason. Relates to this pr https://github.com/dwyl/cid/pull/25#issuecomment-458969612

RobStallion commented 5 years ago

Screenshot taken from travis

image


==> Travis CI detected.
    project root: .
    Fixing merge commit SHA
--> token set from env
    Yaml not found, that's ok! Learn more at http://docs.codecov.io/docs/codecov-yaml
==> Running gcov in . (disable via -X gcov)
==> Python coveragepy not found
==> Searching for coverage reports in:
    + .
--> No coverage report found.
    Please visit http://docs.codecov.io/docs/supported-languages
RobStallion commented 5 years ago

Went to the following link mentioned in the above from travis... http://docs.codecov.io/docs/supported-languages

This link lists a bunch of supported languages, elixir being one of them. The elixir link.

Looked at the elixir link example and saw that they had defined a coveralls.json command in there mix.exs file

      preferred_cli_env: [
        "coveralls": :test,
        "coveralls.html": :test,
        "coveralls.json": :test,
      ],

I have added this to ours now...

      preferred_cli_env: [
        coveralls: :test,
        "coveralls.detail": :test,
        "coveralls.post": :test,
        "coveralls.html": :test,
        "coveralls.json": :test,
        all_tests: :test
      ]
nelsonic commented 5 years ago

@robstallion did you manage to get it working?

if not, please see: https://github.com/dwyl/phoenix-chat-example/blob/master/.travis.yml

RobStallion commented 5 years ago

@nelsonic Not yet no πŸ˜– + πŸ˜•

nelsonic commented 5 years ago

Checkout how it’s done in the Chat example: https://github.com/dwyl/phoenix-chat-example/

RobStallion commented 5 years ago

Looking at it now πŸ‘

RobStallion commented 5 years ago

aliais from https://github.com/dwyl/phoenix-chat-example/

  defp aliases do
    [
      "ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"],
      "ecto.reset": ["ecto.drop", "ecto.setup"],
      test: ["ecto.create --quiet", "ecto.migrate", "test"],
      cover: ["coveralls.json"],
      "cover.html": ["coveralls.html"]
    ]
  end

(cover is the important one here)

.travis.yml from https://github.com/dwyl/phoenix-chat-example/

language: elixir
elixir: # Latest version of Elixir
  - 1.7
addons: # ensure that Travis-CI provisions a DB for our test:
  postgresql: '9.5'
env:
  - MIX_ENV=test
script: # run the tests:
  - mix cover
after_success:
  - bash <(curl -s https://codecov.io/bash)

Added this to cid

script:
  - mix coveralls.json

But still having the same issue

RobStallion commented 5 years ago

I really can't see what I am missing πŸ˜–

RobStallion commented 5 years ago

Added 25minute label because I feel like that's all it should have taken but I am doing something wrong and it has taken much longer

nelsonic commented 5 years ago

@RobStallion try adding the "Repository Upload Token" as a Travis-CI Environment Variable. (LMK if you are still stuck, we can do a quick Google Hangout to get it resolved ...)

RobStallion commented 5 years ago

@nelsonic I'm guessing that is this token you are talking about... image (have changed the token now)

which I have tried adding (was just putting that into a comment when you responded) with no luck.

A hangouts would be GREAT. Just let me know when you are free. (I have a really strong feeling I am going to be kicking myself forever over this)

nelsonic commented 5 years ago

@RobStallion standard "abv" hangouts link? (I'm on it now...)

nelsonic commented 5 years ago

"Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth." ~ Sherlock Holmes / Arthur Conan Doyle

What I always think when I'm debugging something ... πŸ’» Reduce the variables/unknowns until you have just the root cause of the problem. 🐞

nelsonic commented 5 years ago

@RobStallion thanks for the hangout call to debug this. πŸ’» <> πŸ’» I learned not to override the mix test command. πŸ‘ Looking forward to reading your writeup on this. πŸ“ Please consider adding a codecov.md file to https://github.com/dwyl/learn-elixir πŸ’§ and linking to it from the main README.md πŸ”— it doesn't have to take more than 1 x πŸ… and will be a huge help to anyone else trying to replicate this in the near future. πŸ†˜ Thanks again! ✨

RobStallion commented 5 years ago

@nelsonic

@RobStallion thanks for the hangout call to debug this. πŸ’» <> πŸ’»

Thank you for the hangout call

Will do for the rest πŸ‘

nelsonic commented 5 years ago

T25m ... 3 hours later ... πŸ™„

homer-gif-simple

😜

RobStallion commented 5 years ago

image

image

image

image TEARS OF JOY

Cleop commented 5 years ago

@RobStallion - so what was the issue? It looks from your commit like the test aliases were breaking it? Can you explain this in any more detail?