-
Notifications
You must be signed in to change notification settings - Fork 134
Travis ci #308
base: master
Are you sure you want to change the base?
Travis ci #308
Conversation
Now `ghi milestone sample_title -m sample_description` will create a milestone with title as sample_title and description as sample_description. Fixes stephencelis#303
| @@ -1,5 +1,7 @@ | |||
| # ghi | |||
|
|
|||
| [](https://travis-ci.org/shubhamshuklaer/ghi) | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The link needs to be changed after merge.
|
Nice job @shubhamshuklaer, i will take a look and try to contribute some how. I think that we could squash some of those commits, cause will be difficult to review all this code with so much commits. |
|
@davidCarlos thanks. You are right. I will reduce the no of commits. Right now I am working on improving local testing. Since the tester will use a fake github account for testing and a genuine account for using ghi, this will cause clash. I was thinking of suggesting the testers to use a different user(computer user) for testing(he can switch user in terminal before running tests) and then that user will have different |
|
One more thing I will fix is the indentation style. It doesn't match the rest of the project. I will fix it before squashing commits. |
|
@davidCarlos can also evaluate whether the information in readme is enough to setup for local testing as well as setting up travis-ci for fork. |
|
One problem is that the secure(We marked display these in build log to false) env varriables Any suggestions for solving it?? They do give an option to say which tests to run on pull req. from fork but right now all tests need that secure ENV vars. It would be awesome if they give some button for the admin to click after he examines the pull request for any malicious(or otherwise) test.( I opened an issue for it travis-ci/travis-ci#6112) |
|
One more thing that needs to be fixed is deleting the tokens once done with the tests(We can add a flag if the user don't want to delete it). Since travis spins up different containers on each run(of test suit), each run gets a new token and a lot of tokens are accumulated in github. Its best to delete them(For security reasons as well as management). I will work on this today. |
Fixed the following things
TODO
|
99fd4a9 to
bee0f7a
Compare
Helpful while doing local testing. We don't want to mess with the user's original ~/.gitconfig. User will want to use a different github account for testing(Don't want to mess up the original account).
c389749 to
afb75ef
Compare
|
This is great! And what an undertaking! If it's complete (less the README link), I wonder if @AlexChesters has time to look it over and connect it to the PR mechanism here (to ensure future PRs don't break the build). |
.editorconfig
Outdated
| trim_trailing_whitespace = true | ||
|
|
||
| [*.rb] | ||
| indent_style = tab |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the project uses space instead of tabs. I will fix this.
|
@stephencelis |
|
The reason for keeping the username and password secure(Not available publically) even though its a fake account.
|
|
@shubhamshuklaer Been thinking on this. One possibility to avoid the need to run with an actual user/password would be to use the VCR gem to record the API requests: |
|
@stephencelis That is an awesome idea. But I don't know when I will be able to do it. If someone else is interested in doing it, that would be awesome. |
|
|
||
|  | ||
|
|
||
| ## Testing Guidlines |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: Guidlines => Guidelines
| * Before running tests `GITHUB_USER` and `GITHUB_PASSWORD` environment | ||
| variables must be exported. It is best to use a fake account as a bug can mess | ||
| up your original account. You can either export these 2 environment variables | ||
| through `~/.bashrc`(As ghi only uses these while generating its token, so after |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space missing before (As
| variables must be exported. It is best to use a fake account as a bug can mess | ||
| up your original account. You can either export these 2 environment variables | ||
| through `~/.bashrc`(As ghi only uses these while generating its token, so after | ||
| you generate the token for your original account(for regular use), fake account |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space missing before (for
| * Open a Travis CI account and activate travis-ci for the fork | ||
| * Create a fake github account for testing. The username, password and token | ||
| will be available to the tests and if by mistake the test prints it, it will be | ||
| available in public log. So its best to create a fake account and use a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo its => it's
| * At Travis-CI, on the settings page for the fork, add environment variables | ||
| `GITHUB_USER` and `GITHUB_PASSWORD`. Ensure that the "Display value in build | ||
| log" is set to false. It is possible to add these in ".travis.yml", but don't | ||
| as all forks as well as original repo will be using different accounts(We cannot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space missing before (We
| opts.on '--local', 'set for local repo only' do | ||
| assigns[:local] = true | ||
| end | ||
| opts.on '--just_print_token', "Just print the token don't add it to ~/.gitconfig(Useful while testing)" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space missing before (Useful
| @@ -0,0 +1,42 @@ | |||
| require "test/unit" | |||
| require "helper" | |||
| require "pp" | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pp no longer used in this file.
| @@ -0,0 +1,30 @@ | |||
| require "test/unit" | |||
| require "helper" | |||
| require "pp" | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pp no longer used in this file.
| @@ -0,0 +1,45 @@ | |||
| require "test/unit" | |||
| require "helper" | |||
| require "pp" | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pp not used.
| @@ -0,0 +1,30 @@ | |||
| require "helper" | |||
| require "json" | |||
| require "pp" | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pp not used.
|
@shubhamshuklaer I wanted to say thanks ✨ by adding a slew of specific notes in the code. Thanks! |
|
@olleolleolle Thanks a lot for the review. I am a bit out of touch with this PR right now. Will fix this when incorporating stephencelis' idea of using vcr gem. |
This still needs some work, So don't merge yet.This can be mergedThis contains 2 commits from #305 . Once that is merged I will rebase it off of master.
Fixes #302
For a working version check
https://github.com/shubhamshuklaer/ghi/tree/travis-ci
https://travis-ci.org/shubhamshuklaer/ghi
For merging check
https://github.com/shubhamshuklaer/ghi/tree/travis-ci#enable-travis-ci-in-fork
I am almost done, but I wanted to get suggestions from others. If anyone have any idea on how to improve it, please comment. Right now there are only the very basic tests. I won't be able to add any more tests myself(as time ran out), but if anyone wants to contribute they can open a pull request on
travis-cibranch on https://github.com/shubhamshuklaer/ghi or wait for this to get merged and then open a pull request on this repo.Because of the nature of the software, the tests overlap with each other. For eg. for testing
ghi edityou first need to create an issue, maybe a milestone too and then edit that issue. As a result editing issue also tests issue creation and milestone creation. But I have also kept separate tests for issue creation and milestone creation, so that they can be tested separately.