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

setting test credentials - now eleventy billion % easier #989

Merged
merged 18 commits into from
Dec 14, 2015

Conversation

shiftkey
Copy link
Member

I found myself on a fresh VM and realised I hadn't set up the test variables for Octokit.

So I scripted it out in some rough PowerShell (indicating which are optional parameters for tests which are specific to features not everyone runs - like private repositories or application tests):

> .\script\configure-integration-tests.ps1
BIG FREAKING WARNING!!!!!
You should use a test account when running the Octokit integration tests!


Set the account name to use for the integration tests (required): shiftkey-tester
Set the account password to use for the integration tests (optional):
Set the OAuth token to use for the integration tests (required): {token}
Do you have private repositories associated with your test account? Press Y to set this, otherwise we'll skip it: Y
Set the organization name to use for the integration tests (optional): shiftkey-tester-org-blah-blah
Set the application ClientID to use for the integration tests (optional): {token}
Set the application Secret to use for the integration tests (optional): {token}
> 

When you run the same script again, it'll display your existing values and ask if you want to update them:

> .\script\configure-integration-tests.ps1
BIG FREAKING WARNING!!!!!
You should use a test account when running the Octokit integration tests!


shiftkey-tester found as the configured account name
Want to change this? Press Y, otherwise we'll move on:
Set the account password to use for the integration tests (optional):
{token} found as the configured OAuth token
Want to change this? Press Y, otherwise we'll move on: 
...

Let me know if there's any way to make this experience a bit more friendly.

  • let me actually review this before someone eagerly merges it
  • set for your current session as well, so you don't go wondering why things didn't update
  • can run all the integration tests again
  • opt-out of basic authentication tests (it's optional)
  • correctly differentiate where tests require Basic Auth
  • open issues for now-muted tests
  • link to issues in code

@M-Zuber
Copy link
Contributor

M-Zuber commented Dec 10, 2015

This is already a big step up.
When I first tried contributing I had trouble setting things up as I had never used environment variables before.
Having even a simple script like this would have been a major help

@shiftkey shiftkey changed the title setting test credentials - now eleventy billion % easier [WIP] setting test credentials - now eleventy billion % easier Dec 10, 2015
@hnrkndrssn
Copy link
Contributor

LGTM 👍

@M-Zuber
Copy link
Contributor

M-Zuber commented Dec 10, 2015

Looks great to me. 👍
thank you for your hard work and apologies if i came across snappy above

@haacked
Copy link
Contributor

haacked commented Dec 10, 2015

Nice! Maybe a next step would be to have the script use Octokit.net to help you create the test accounts if you don't have them!

Nerd snipe

@M-Zuber
Copy link
Contributor

M-Zuber commented Dec 10, 2015

Meta all the things!!!

@shiftkey
Copy link
Member Author

Nice! Maybe a next step would be to have the script use Octokit.net to help you create the test accounts if you don't have them!

Not possible through the API :(

@haacked
Copy link
Contributor

haacked commented Dec 10, 2015

Not possible through the API :(

Darn.

@hnrkndrssn
Copy link
Contributor

image

😭

@haacked
Copy link
Contributor

haacked commented Dec 10, 2015

The potential for abuse is high for github.com. We get enough spammer accounts without making it even easier to automate. :)

@hnrkndrssn
Copy link
Contributor

Yep, can understand that 😀

@shiftkey
Copy link
Member Author

Tweaking the output a bit to make things clearer:

> .\script\configure-integration-tests.ps1

BIG FREAKING WARNING!!!!!
You should use a test account when running the Octokit integration tests!


shiftkey-tester found as the configured account name
Want to change this? Press Y, otherwise we'll move on:

Set the account password to use for the integration tests (optional):

XXX found as the configured OAuth token
Want to change this? Press Y, otherwise we'll move on:

Do you have private repositories associated with your test account? Press Y to set this, otherwise we'll skip it:

shiftkey-tester-org-blah-blah found as the configured organization name
Want to change this? Press Y, otherwise we'll move on:
Want to remove this optional value, press Y:

XXX found as the configured application ClientID
Want to change this? Press Y, otherwise we'll move on:
Want to remove this optional value, press Y:

XXX found as the configured application Secret
Want to change this? Press Y, otherwise we'll move on:
Want to remove this optional value, press Y:

@shiftkey shiftkey changed the title [WIP] setting test credentials - now eleventy billion % easier setting test credentials - now eleventy billion % easier Dec 12, 2015
@shiftkey shiftkey force-pushed the script-setting-creds branch from 21f2f39 to 27988a6 Compare December 14, 2015 00:35
@shiftkey
Copy link
Member Author

🍎

haacked added a commit that referenced this pull request Dec 14, 2015
setting test credentials - now eleventy billion % easier
@haacked haacked merged commit 0e664c2 into master Dec 14, 2015
@haacked haacked deleted the script-setting-creds branch December 14, 2015 17:57
@haacked
Copy link
Contributor

haacked commented Dec 14, 2015

✨ Really nicely done @shiftkey!

thumbs-up-batman

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