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 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
pedroMMM and others added 2 commits Jan 1, 2020
@aelsabbahy

This comment has been minimized.

Copy link
Owner

aelsabbahy commented Jan 17, 2020

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

This comment has been minimized.

Copy link
Owner

aelsabbahy commented Jan 20, 2020

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

@pedroMMM

This comment has been minimized.

Copy link
Contributor Author

pedroMMM commented Jan 20, 2020

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

This comment has been minimized.

Copy link
Owner

aelsabbahy commented Jan 20, 2020

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 aelsabbahy:master Jan 20, 2020
1 of 2 checks passed
1 of 2 checks passed
codeclimate 392 issues to fix
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@pedroMMM

This comment has been minimized.

Copy link
Contributor Author

pedroMMM commented Jan 21, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants
You can’t perform that action at this time.