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

provide a way to make GitHub requests authenticated to prevent error: gecko driver not downloading / failing with promise error #216

Closed
cnishina opened this issue Mar 4, 2017 · 9 comments
Assignees

Comments

@cnishina
Copy link
Member

cnishina commented Mar 4, 2017

No description provided.

@cnishina cnishina self-assigned this Mar 4, 2017
MJDSys added a commit to MJDSys/webdriver-manager that referenced this issue Mar 6, 2017
When the Github API limit is reached, the error message now directly informs
the user.  Also, when any other failure occurs the status code is reported.

This should hopefully give more info for issue angular#216.
@MJDSys
Copy link
Contributor

MJDSys commented Mar 6, 2017

I see this issue all the time on Travis CI. You can see an example build log here: https://travis-ci.org/CCJ16/registration/jobs/207167621#L2040 .

I think the issue might be that Github's API's rate limit is being hit. I submitted a PR (#217) to detect that case, to hopefully get more information about what is going on.

MJDSys added a commit to MJDSys/webdriver-manager that referenced this issue Mar 6, 2017
When the Github API limit is reached, the error message now directly informs
the user.  Also, when any other failure occurs the status code is reported.

This should hopefully give more info for issue angular#216.
MJDSys added a commit to MJDSys/webdriver-manager that referenced this issue Mar 7, 2017
When the Github API limit is reached, the error message now directly informs
the user.  Also, when any other failure occurs the status code is reported.

This should hopefully give more info for issue angular#216.
cnishina pushed a commit that referenced this issue Mar 7, 2017
When the Github API limit is reached, the error message now directly informs
the user.  Also, when any other failure occurs the status code is reported.

This should hopefully give more info for issue #216.
@cnishina
Copy link
Member Author

cnishina commented Mar 9, 2017

I think the rate limit error message is helpful. I haven't seen this happen recently so I plan to close it.

@cnishina cnishina closed this as completed Mar 9, 2017
@rdbaron
Copy link

rdbaron commented Apr 12, 2017

@cnishina We have recently started seeing this error a few times per day. Here is the output we get:

UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Failed to make Github request, rate limit reached.

^^ This is when trying to download https://github.com/mozilla/geckodriver/releases/download/v0.15.0/geckodriver-v0.15.0-win64.zip

We are on webdriver-manager 12.0.3

@cnishina
Copy link
Member Author

This is an unauthenticated rate limit set by GitHub (See https://developer.github.com/v3/search/#rate-limit).

What we are doing is downloading the GitHub release json for gecko driver and saving the file to the selenium/ folder. The release json is great because it allows us to find the latest and greatest binary every time without maintaining a list of binary versions. Also, because we have a saved file, we only refresh the file if the file is older than an hour.

However, I could see this becoming a problem in CI if you are downloading everything on each build. If you are in CI and downloading a new set of node_modules, think about using the --out_dir option. You could set an absolute path outside of your project where the binaries will be maintained. What will happen is that multiple projects could then be launched and refer to the same GitHub release json file and not download a new one. This should keep you under the GitHub unauthenticated rate limit.

So, when doing an update, this will look like:

webdriver-manager update --out_dir /some/path/to/selenium

And starting the server would look like:

webdriver-manager start --out_dir /some/path/to/selenium

@rdbaron
Copy link

rdbaron commented Apr 12, 2017

Thanks for the reply. Everything you've said makes sense, however we use a cloud based CI tool (CircleCI) so sharing between executions is not really an option. In our particular case, we can just set --gecko false because nothing we do is using that driver.

I only mention it because I could see this being an issue for others.

@cnishina
Copy link
Member Author

Good point. I can see that being a big problem since circle CI has probably makes requests from the same set of IP addresses. We'll have to look into giving the user a way to set authenticated GitHub requests.

@cnishina cnishina reopened this Apr 12, 2017
@cnishina cnishina changed the title gecko driver not downloading / failing with promise error provide a way to make GitHub requests authenticated to prevent error: gecko driver not downloading / failing with promise error Apr 12, 2017
mleu added a commit to IMSmobile/app that referenced this issue Apr 25, 2017
See angular/webdriver-manager#216

Currently only geckodriver is downloaded from GitHub:
https://github.com/angular/webdriver-manager/blob/master/config.json

As we don't use geckodriver it can be safely disabled.
@joymon
Copy link

joymon commented May 9, 2017

I am facing the same GitHub API limits when I am using protractor from AppVeyor hosted CI. Any updates or workarounds to solve the GitHub download.

Update-able to get it working by disabling gecko.
http://help.appveyor.com/discussions/problems/6628-protractor-webdriver-manager-update-fails-due-to-github-api-limits

Crazyht pushed a commit to Crazyht/ngx-tree-select that referenced this issue Jul 13, 2017
Crazyht pushed a commit to Crazyht/ngx-contenteditable that referenced this issue Jul 13, 2017
asfgit pushed a commit to apache/zeppelin that referenced this issue Jul 14, 2017
…erage)

### What is this PR for?

Improved testing environment for zeppelin-web

- added `test:watch` command for continuous testing
- displaying coverage report in console
- e2e testing in zeppelin-web (can be written easily compare to the zeppelin-server integration tests. For example: [home.spec.js](https://github.com/1ambda/zeppelin/blob/f90deb4bf3db57e36232c9c94ae3b07dfd7c2331/zeppelin-web/e2e/home.spec.js))

This PR adds [a zeppelin-web specific travis profile](https://github.com/1ambda/zeppelin/blob/ad08a3bc0da420f7a7b4771d1aee8bfdd962efa7/.travis.yml#L55) and it usually takes 8-9 mins to execute unit + e2e tests (zeppelin-web)

- https://travis-ci.org/1ambda/zeppelin/jobs/252453901

#### Details

- the headless chrome browser works with chromedriver 2.29+ (https://chromium.googlesource.com/chromium/src/+/c75dbfd25cc376b92a494d340259056a01e1432e)
- in the case of ubuntu precise (our travis container), should use `/usr/bin/chromium-browser`
- `xvfb` is required, please refer https://docs.travis-ci.com/user/gui-and-headless-browsers/#Using-xvfb-to-Run-Tests-That-Require-a-GUI and https://iamakulov.com/notes/install-google-chrome-on-travis/#what-does-the-code-mean
- for protractor conf, please check travis-ci/travis-ci#7650 (comment)
- can't install stable version of chrome, precise (12.04) support was dropped by chrome
- chromium-browser (37.0) is shipped by default in precise and chromedriver version 2.11 is compatible with it. (https://support.saucelabs.com/hc/en-us/articles/225095307-Chromedriver-version-for-each-Chrome-browser-version, travis-ci/travis-ci#5899)

### What type of PR is it?
[Improvement]

### Todos
* [x] - `test:watch`
* [x] - displaying coverage reports in console
* [x] - e2e testing in zeppelin-web

### What is the Jira issue?

[ZEPPELIN-2342](https://issues.apache.org/jira/browse/ZEPPELIN-2342)

### How should this be tested?

CI should be green. If you want to test locally,

- stop zeppelin which is running on localhost:8080
- `mvn package -DskipTests -DskipRat -Pweb-ci -B`
- `mvn verify -DskipRat -pl 'zeppelin-web' -Pweb-ci -Pweb-e2e -B`

#### Screenshots (coverage)

![image](https://user-images.githubusercontent.com/4968473/28031333-dc700c3a-65e1-11e7-96ca-582a9ffa97dd.png)

#### Screenshots (e2e)

![image](https://user-images.githubusercontent.com/4968473/28032319-0e8b5adc-65e5-11e7-81ba-4e33c5f15bc0.png)

### Questions:
* Does the licenses files need update? - NO
* Is there breaking changes for older versions? - NO
* Does this needs documentation? - YES, updated

Author: 1ambda <[email protected]>

Closes #2477 from 1ambda/ZEPPELIN-2342/differentiate-unit-and-integration-testing and squashes the following commits:

ad08a3b [1ambda] fix: Restore all other pfoeils
b6ff6d9 [1ambda] fix: Use 2.30
832cffb [1ambda] fix: Use 2.27 for chrome driver
4d82f03 [1ambda] fix: use 2.30 chromedriver
93cc90b [1ambda] fix: run unit test only when web-e2e enabled
0911afb [1ambda] fix: Update chromedriver version
893f67e [1ambda] fix: Set ignoreSync false for angular app
9b91ae2 [1ambda] fix: restore all other profiles
dd300c2 [1ambda] fix: split if
a5deed0 [1ambda] fix: Run xvf ni foreground
8d1ab5b [1ambda] fix: Remove sleep 3s
9a81fa1 [1ambda] fix: Add space between & and ;
e924e76 [1ambda] fix: pass test, use 2 dists
58cfb23 [1ambda] fix: test 2 dist
0dc0304 [1ambda] fix: Use trusty for the second profile2
bf62085 [1ambda] fix: Remove version
61a7f9e [1ambda] fix: DO NOT USE CHROME_BIN
8926cd8 [1ambda] fix: use 2.11
9c20a44 [1ambda] fix: print chrome version
f961a90 [1ambda] use before_install
9ed1e12 [1ambda] set info for test
efc831c [1ambda] fix: remove headless
db016a3 [1ambda] fix: use headless chrome in local
481528f [1ambda] fix: use precise
5a096da [1ambda] fix: use chromium-browser
fcfa9c0 [1ambda] fix: required
282c83e [1ambda] fix: use beta
5a0d111 [1ambda] fix: use trusty
93fb571 [1ambda] fix: ls usr bin
aff874f [1ambda] fix: use no-sandbox for sudo false contrainer
7d454a5 [1ambda] fix: Run xvfb in background
23e5670 [1ambda] fix: use beta chrome
3e9f494 [1ambda] fix: Use /usr/bin/chrome
55faa0e [1ambda] fix: Use google-chrome-stale
7da9845 [1ambda] WIP: Remove all other profiles
a45f131 [1ambda] WIP: pass all tests
628ff34 [1ambda] fix: Set chromedriver version
763f3e2 [1ambda] fix: Set env
9450668 [1ambda] fix: redirect dbus into null
bcac8a4 [1ambda] fix: Remove sandbox
facf4c1 [1ambda] fix: Remove -X
20a8cfd [1ambda] fix: use no-sandbox
0662f92 [1ambda] fix: Set -X for web
fc9d31f [1ambda] fix: Use CHROME_BIN2
4acb8e2 [1ambda] fix: Use CHROME_BIN
4699491 [1ambda] fix: Set info for e2e
905e6ad [1ambda] fix: Install chrome from source
7f5abfd [1ambda] fix: before_start
1f345ae [1ambda] fix: use headless
dd115c3 [1ambda] fix: use direct connect
7d53d51 [1ambda] fix Remove chrome option
eb9f0e8 [1ambda] fix: Set direct connect false
7c69f7a [1ambda] fix: Set chromeOnly for protractor
d5e62e7 [1ambda] fix: Set chrome driver version https://github.com/angular/angular-cli/issues/2176\#issuecomment-253496181
f94a665 [1ambda] fix: Modify timeout for protractor
35b6fb1 [1ambda] WIP: Remove -X option to second  job
5189807 [1ambda] chore: Add TEST_MODULES in travis.yml
e354b1b [1ambda] chore: DO NOT rebuild web when e2e enabled
b6d730f [1ambda] fix: echo commandsin travis.yml
6907c50 [1ambda] chore: Ingmore except web in test build
9f13d61 [1ambda] chore: Use usual test build command
4ef0a2c [1ambda] chore: Remove useless mvn setting
26ef708 [1ambda] fix: use prebuilt phantom
f90deb4 [1ambda] chore: Move web e2e into zeppelin-web
40ac076 [1ambda] chore: New profile for e2e test only
7703615 [1ambda] WIP: Add -X to the second travis profile
0c2c1ec [1ambda] chore: Add web-e2e profile to mvn
ca2b170 [1ambda] WIP: add -e mvn option to the second profile
0c09727 [1ambda] fix: Remove -X option from selenium profile
0907d72 [1ambda] chore: Ingnore protractor conf in RAT
2ed3973 [1ambda] fix: set gecko false for webdriver manager. See angular/webdriver-manager#216
eb447ef [1ambda] WIP: add -X log to selenium profioe
742bb96 [1ambda] chore: Exclude e2e specs from RAT
b5a17a4 [1ambda] chore: Bind browser e2e test into CI process
76f4f58 [1ambda] docs: Update test section in zeppelin-web/README.md
15473de [1ambda] test: Add a basic e2e test for home
39dc77e [1ambda] chore: Add test:watch command
e70281b [1ambda] feat: Use spec repoter and coverage
benbraou added a commit to benbraou/angular-flex-picture that referenced this issue Jul 22, 2017
benbraou added a commit to benbraou/angular-flex-picture that referenced this issue Jul 22, 2017
Crazyht pushed a commit to Crazyht/ngx-tree-select that referenced this issue Jul 31, 2017
@DmitryRomaniuk
Copy link

@cnishina I think problem with letter v, when I write webdriver-manager update --versions.gecko=v0.18.0, then all works correctly

keithrz added a commit to keithrz/pro-test-1 that referenced this issue Dec 19, 2017
bkimminich added a commit to juice-shop/juice-shop that referenced this issue Mar 20, 2018
irfanhabib pushed a commit to cloudfoundry/stratos that referenced this issue Mar 20, 2018
JulioJu pushed a commit to JulioJu/generator-jhipster that referenced this issue Mar 31, 2018
JulioJu pushed a commit to JulioJu/generator-jhipster that referenced this issue Mar 31, 2018
@cnishina
Copy link
Member Author

Done! Please look at version 13. It has support for GitHub authentication.

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

No branches or pull requests

5 participants