Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#524] Add Code Coverage Support #533

Merged
merged 2 commits into from
Jan 20, 2020
Merged

Conversation

pedroMMM
Copy link
Contributor

@pedroMMM pedroMMM commented Jan 2, 2020

Checklist
  • make test-all (UNIX) passes. CI will also test this
  • documentation is changed or added
  • update CC_TEST_REPORTER_ID with Goss token (maintainer task)

Description of change

Add Code Coverage support to perform Static Code Analysis as discussed on #524. This is just the initial setup. When everyone has visibility into the code problems within Goss the contributors can see how their changes affect the overall quality and the maintainers can make informed decisions.

The Code Climate PR actions will only be active on PRs that are created after Code Climate is configured and this PR is merged.

Closes #524.

Setup Code Climate:

  1. Sign up for free to Code Climate for OSS via GitHub
  2. Add the Goss Repository on the OSS Dashboard
  3. Install Code Climate GitHub App
  4. Locate the Repo Settings menu on the Code Climate Repo Page
  5. Locate the GitHub menu on the Repo Settings page
  6. Enable Summary comments and Delete outdated comments and post a new one
  7. Disable Inline issue comments
  8. Activate Pull request status updates
  9. Install the Webhook on GitHub
  10. Locate the Test coverage menu on the Repo Settings page
  11. Disable Enforce Diff Coverage and Enforce Total Coverage then save.
  12. Generate a new TEST REPORTER ID and copy it
  13. Replace the CC_TEST_REPORTER_ID in this PR's .travis.yml with the previous Id
  14. Verify the Code Climate Webhook is installed on GitHub

@aelsabbahy
Copy link
Member

Thank you so much for the clear instructions. They were very simple and clear to follow. I did all the steps and added a commit with CC_TEST_REPORTER_ID as an encrypted token, not sure if that was correct or not (does encrypting it cause problems? should it be plaintext?).

I was a little confused by this:
https://github.com/codeclimate/test-reporter/blob/master/examples/go_examples.md#example-1

Do you know the best way to test this?

@aelsabbahy
Copy link
Member

My commit seems to have triggered the codecommit message, does that look correct to you?

@pedroMMM
Copy link
Contributor Author

Thank you so much for the clear instructions. They were very simple and clear to follow. I did all the steps and added a commit with CC_TEST_REPORTER_ID as an encrypted token, not sure if that was correct or not (does encrypting it cause problems? should it be plaintext?).

I was a little confused by this:
https://github.com/codeclimate/test-reporter/blob/master/examples/go_examples.md#example-1

Do you know the best way to test this?

I am not 100% sure but I think you verify if it worked by checking if the branch has produced any test report. Navigate to Test coverage menu on the Repo Settings page and check the Recent Reports.

My commit seems to have triggered the codecommit message, does that look correct to you?
Yes, this is the initial problem discovery. They will have to be accepted by the maintainers. After that only new problems will show up there.

@aelsabbahy
Copy link
Member

I'll merge this and create a dummy commit to test it out.

There might be some more tweaking to do, but this is a good start.

@aelsabbahy aelsabbahy merged commit 6abda7e into goss-org:master Jan 20, 2020
@pedroMMM
Copy link
Contributor Author

I'll merge this and create a dummy commit to test it out.

There might be some more tweaking to do, but this is a good start.
@aelsabbahy let me know if it worked well. Also, you can accept the Code Climate problems and it only cleans the PR checks but leaves the problems untouched in Code Climate.

BenjaminHerbert pushed a commit to BenjaminHerbert/goss that referenced this pull request May 28, 2020
* Add Code Coverage Support

* Add codeclimate token

Co-authored-by: Ahmed Elsabbahy <[email protected]>
@dklimpel dklimpel mentioned this pull request Jun 16, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fail CI build if golint finds problems (non-functional)
2 participants