Skip to content

Add partial automated support for Heroku CI builds #305

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

Merged
merged 1 commit into from
Feb 19, 2018

Conversation

dblandin
Copy link
Contributor

Heroku CI currently exposes the following environment variables during CI builds:

  • HEROKU_TEST_RUN_BRANCH: A string representing the branch of the commit under test
  • HEROKU_TEST_RUN_COMMIT_VERSION: A string representing the commit version under test (This is the SHA in most cases)
  • HEROKU_TEST_RUN_ID: A string uuid representing the unique ID of the test run

source: https://devcenter.heroku.com/articles/heroku-ci#configuration-using-app-json

The Code Climate test reporter relies on a git committed at timestamp to reliably render accurate test coverage annotations on codeclimate.com and on github.com via the browser extension.

For now, we can automatically apply the environment variables supported by Heroku CI, but a couple others will have to be manually supplied by the user:

export CI_NAME="heroku"
export GIT_COMMITTED_AT="$(date +%s)"

Related to: #226

Heroku CI currently exposes the following environment variables during
CI builds:

- `HEROKU_TEST_RUN_BRANCH`: A string representing the branch of the commit under test
- `HEROKU_TEST_RUN_COMMIT_VERSION`: A string representing the commit version under test (This is the SHA in most cases)
- `HEROKU_TEST_RUN_ID`: A string uuid representing the unique ID of the test run

source: https://devcenter.heroku.com/articles/heroku-ci#configuration-using-app-json

The Code Climate test reporter relies on a git committed at timestamp to
reliably render accurate test coverage annotations on codeclimate.com
and on github.com via the browser extension.

For now, we can automatically apply the environment variables supported
by Heroku CI, but a couple others will have to be manually supplied by
the user:

```
export CI_NAME="heroku"
export GIT_COMMITTED_AT="$(date +%s)"
```

Related to: #226
@dblandin dblandin requested a review from ale7714 February 19, 2018 19:10
@dblandin dblandin merged commit 871a40f into master Feb 19, 2018
@dblandin dblandin deleted the devon/add-heroku-ci-env-vars branch February 19, 2018 19:22
dblandin added a commit that referenced this pull request Feb 19, 2018
* [FIX] Add partial automated support for Heroku CI builds [#305][]
dblandin added a commit that referenced this pull request Feb 19, 2018
* [FIX] Add partial automated support for Heroku CI builds #305
@dblandin dblandin mentioned this pull request Feb 19, 2018
dblandin added a commit that referenced this pull request Feb 19, 2018
* [FIX] Add partial automated support for Heroku CI builds #305
@olivercodes
Copy link

is there a doc somewhere describing the setup process? Having some trouble with it

@maxjacobson
Copy link
Contributor

Hi @olivercodes,

Good call out, we should add some Heroku CI -specific instructions to our examples directory and/or our docs.

For now: you should be able to reference our ordinary setup instructions, and just know that there's one difference required to use the test-reporter on Heroku CI: you'll need to export 2 environment variables before invoking the test reporter:

export CI_NAME="heroku"
export GIT_COMMITTED_AT="$(date +%s)"

I'm not sure what kind of trouble you were having, but I hope that unblocks you. Feel free to ping us again if not. If possible, please open a new issue to track it: https://github.com/codeclimate/test-reporter/issues/new

@olivercodes
Copy link

Sure! Thanks @maxjacobson, I'll ping you guys on email and open an issue

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.

4 participants