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

Fix #2437 - Upgrades python ua-parser version to 0.8 #2444

Merged
merged 2 commits into from
May 10, 2018

Conversation

karlcow
Copy link
Member

@karlcow karlcow commented May 9, 2018

r? @miketaylr
see comments in #2437 for details.

@karlcow karlcow requested a review from miketaylr May 9, 2018 07:15
@TravisBuddy
Copy link

TravisBuddy commented May 9, 2018

Travis tests have failed

Hey @karlcow,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

1st Build

npm run test:js -- --reporters="runner" --firefoxBinary=`which firefox`
> webcompat@ test:js /home/travis/build/webcompat/webcompat.com
> node ./tests/functional/_intern.js "--reporters=runner" "--firefoxBinary=/home/travis/firefox-58.0/firefox/firefox"

Listening on localhost:9000 (ws 9001)
Tunnel started

‣ Created remote session firefox on linux 4.4.0-101-generic (b8a7faf9-9b69-43af-9ec9-0e7ae8a36ec2)
✓ firefox on linux 4.4.0-101-generic - Comments (auth) - Comments form visible when logged in (1.051s)
✓ firefox on linux 4.4.0-101-generic - Comments (auth) - Posting a comment (2.127s)
✓ firefox on linux 4.4.0-101-generic - Comments (auth) - Posting an empty comment fails (2.654s)
✓ firefox on linux 4.4.0-101-generic - Comments (auth) - Pressing 'g' inside of comment textarea *doesn't* go to github issue (2.722s)
✓ firefox on linux 4.4.0-101-generic - Comments (auth) - Pressing 'l' inside of comment textarea *doesn't* open the label editor box (0.694s)
✓ firefox on linux 4.4.0-101-generic - Comments (non-auth) - Comment form not visible for logged out users (10.505s)
✓ firefox on linux 4.4.0-101-generic - History navigation - Back button works from issues page (1.627s)
✓ firefox on linux 4.4.0-101-generic - Image Uploads (non-auth) - postMessaged dataURI preview (1.423s)
✓ firefox on linux 4.4.0-101-generic - Image Uploads (non-auth) - postMessaged blob preview (1.394s)
✓ firefox on linux 4.4.0-101-generic - Image Uploads (non-auth) - uploaded image file preview (1.449s)
✓ firefox on linux 4.4.0-101-generic - Image Uploads (non-auth) - postMessaged dataURI image doesn't upload before form submission (1.351s)
✓ firefox on linux 4.4.0-101-generic - Image Uploads (non-auth) - postMessaged blob image doesn't upload before form submission (1.363s)
✓ firefox on linux 4.4.0-101-generic - Image Uploads (non-auth) - uploaded image file doesn't upload before form submission (1.491s)
✓ firefox on linux 4.4.0-101-generic - Image Uploads (non-auth) - remove image upload button is shown (1.412s)
✓ firefox on linux 4.4.0-101-generic - Image Uploads (non-auth) - clicking remove image upload button removes preview (1.407s)
✓ firefox on linux 4.4.0-101-generic - Image Uploads (non-auth) - clicking remove image upload button removes image URL (1.394s)
✓ firefox on linux 4.4.0-101-generic - Image Uploads (non-auth) - double image select works (3.38s)
✓ firefox on linux 4.4.0-101-generic - Index - front page loads (0.418s)
✓ firefox on linux 4.4.0-101-generic - Index - form toggles open then closed (3.107s)
✓ firefox on linux 4.4.0-101-generic - Index - browse issues (needstriage) (0.618s)
✓ firefox on linux 4.4.0-101-generic - Issue-list - FilterView renders (0.575s)
✓ firefox on linux 4.4.0-101-generic - Issue-list - IssueListView renders (1.939s)
✓ firefox on linux 4.4.0-101-generic - Issue-list - PaginationControlsView tests (1.371s)
✓ firefox on linux 4.4.0-101-generic - Issue-list - Pagination dropdown tests (1.681s)
✓ firefox on linux 4.4.0-101-generic - Issue-list - Pressing g goes to github issues (1.71s)
✓ firefox on linux 4.4.0-101-generic - Issue-list - Pressing g inside of search input *doesn't* go to github issues (1.027s)
✓ firefox on linux 4.4.0-101-generic - Issue-list - Loading issues page has default params in URL (0.686s)
✓ firefox on linux 4.4.0-101-generic - Issue-list - Loading partial params results in merge with defaults (0.647s)
✓ firefox on linux 4.4.0-101-generic - Issue-list - Dropdowns reflect state from URL (0.706s)
✓ firefox on linux 4.4.0-101-generic - Issue-list - Going back in history updates issue list and URL state (1.479s)
✓ firefox on linux 4.4.0-101-generic - Issue-list - Loading URL with stage param loads issues (0.556s)
✓ firefox on linux 4.4.0-101-generic - Issue-list - Clicking on a stage filter adds the correct param to the URL (0.985s)
✓ firefox on linux 4.4.0-101-generic - Issue-list - Toggling a stage filter doesn't leave the param in the URL (1.42s)
✓ firefox on linux 4.4.0-101-generic - Issue-list - Toggling between stage filters results in last param in URL (1.251s)
✓ firefox on linux 4.4.0-101-generic - Issues (auth) - Pressing 'l' opens the label editor box (1.153s)
✓ firefox on linux 4.4.0-101-generic - Issues - Issue page loads (0.669s)
✓ firefox on linux 4.4.0-101-generic - Issues - Issue comments load (0.609s)
✓ firefox on linux 4.4.0-101-generic - Issues - Pressing g goes to the github issue page (1.236s)
✓ firefox on linux 4.4.0-101-generic - Issues - NSFW images are blurred (0.523s)
✓ firefox on linux 4.4.0-101-generic - Issues - Clicking NSFW images toggles between blurry and not-blurry (1.301s)
✓ firefox on linux 4.4.0-101-generic - Labels (auth) - Label editor opens then closes (clicks) (1.423s)
✓ firefox on linux 4.4.0-101-generic - Labels (auth) - Label editor opens then closes (key events) (6.275s)
✓ firefox on linux 4.4.0-101-generic - Labels (auth) - Clicking outside label editor closes it (1.139s)
✓ firefox on linux 4.4.0-101-generic - Labels (auth) - Clicking close button actually closes it (0.82s)
✓ firefox on linux 4.4.0-101-generic - Milestones (auth) - Milestone editor opens then closes (clicks) (1.377s)
✓ firefox on linux 4.4.0-101-generic - Milestones (auth) - Milestone editor opens then closes (key events) (0.926s)
✓ firefox on linux 4.4.0-101-generic - Milestones (auth) - Clicking outside milestone editor closes it (1.104s)
✓ firefox on linux 4.4.0-101-generic - Milestones (auth) - Clicking close button actually closes it (0.803s)
✓ firefox on linux 4.4.0-101-generic - Milestones (non-auth) - Page loads without milestone set (0.566s)
✓ firefox on linux 4.4.0-101-generic - Milestones (non-auth) - Missing status error displays (0.524s)
✓ firefox on linux 4.4.0-101-generic - New Issue Page - new issue page loads (0.395s)
✓ firefox on linux 4.4.0-101-generic - Reporting (auth) - Report button shows name (0.434s)
✓ firefox on linux 4.4.0-101-generic - Reporting (non-auth) - Submit buttons are disabled (0.492s)
✓ firefox on linux 4.4.0-101-generic - Reporting (non-auth) - Wyciwyg bug workaround (0.469s)
✓ firefox on linux 4.4.0-101-generic - Reporting (non-auth) - Report button shows via GitHub (0.441s)
✓ firefox on linux 4.4.0-101-generic - Reporting (non-auth) - URL validation (1.386s)
✓ firefox on linux 4.4.0-101-generic - Reporting (non-auth) - Description validation (1.251s)
✓ firefox on linux 4.4.0-101-generic - Reporting (non-auth) - (optional) browser + os validation (0.916s)
✓ firefox on linux 4.4.0-101-generic - Reporting (non-auth) - Image extension validation (0.542s)
✓ firefox on linux 4.4.0-101-generic - Reporting (non-auth) - Submits are enabled (1.183s)
✓ firefox on linux 4.4.0-101-generic - Reporting (non-auth) - problem_type param selects problem type (0.35s)
✓ firefox on linux 4.4.0-101-generic - Reporting (non-auth) - details param doesn't add info to description (0.379s)
Expected fixture file: /home/travis/build/webcompat/webcompat.com/tests/fixtures/api/issues/category/needsdiagnosis.d0b9d00b5e714a3353387b62a4587eee.json
✓ firefox on linux 4.4.0-101-generic - Search (auth) - Search/filter interaction (2.216s)
✓ firefox on linux 4.4.0-101-generic - Search (auth) - Results are loaded from the query params (0.507s)
✓ firefox on linux 4.4.0-101-generic - Search (auth) - Search works by icon click (1.202s)
× firefox on linux 4.4.0-101-generic - Search (auth) - Search works by Return key (6.515s)
    StaleElementReference: [GET http://localhost:4444/wd/hub/session/b8a7faf9-9b69-43af-9ec9-0e7ae8a36ec2/element/5f76fae2-d7e6-4888-8b9e-65ab92ba6339/displayed] The element reference of <a href="/issues/114"> is stale; either the element is no longer attached to the DOM, it is not in the current frame context, or the document has been refreshed
    For documentation on this error, please visit: http://seleniumhq.org/exceptions/stale_element_reference.html
    Build info: version: '3.11.0', revision: 'e59cfb3', time: '2018-03-11T20:33:15.31Z'
    System info: host: 'travis-job-912c0870-7a26-47d1-8106-10d83d17129b', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-101-generic', java.version: '1.8.0_151'
    Driver info: driver.version: unknown
      at Test.Search works by Return key [as test]  <tests/functional/search-auth.js:129:10>
      at <src/lib/Test.ts:260:47>

✓ firefox on linux 4.4.0-101-generic - Search (auth) - Search from the homepage (2.757s)
✓ firefox on linux 4.4.0-101-generic - Search (auth) - Search with a dash works (0.902s)
✓ firefox on linux 4.4.0-101-generic - Search (auth) - After search without results, suggested label appear and have a clickable URL. (3.353s)
✓ firefox on linux 4.4.0-101-generic - Search (auth) - Search input is loaded from q param (with dashes) (0.414s)
✓ firefox on linux 4.4.0-101-generic - Search (non-auth) - Pressing g inside of search input *doesnt* go to github issues (1.065s)
✓ firefox on linux 4.4.0-101-generic - Search (non-auth) - Clicking on label search adds query parameter to the URL (0.953s)
✓ firefox on linux 4.4.0-101-generic - Search (non-auth) - Clicking on label search updates the search input (3.636s)
✓ firefox on linux 4.4.0-101-generic - Search (non-auth) - Search input is visible (0.73s)
✓ firefox on linux 4.4.0-101-generic - Search (non-auth) - Empty search input removes q param (3.742s)
✓ firefox on linux 4.4.0-101-generic - User Activity (auth) - We're at the right place (0.661s)
✓ firefox on linux 4.4.0-101-generic - User Activity (auth) - IssueListView renders (1.932s)
✓ firefox on linux 4.4.0-101-generic - User Activity (auth) - Trying to view someone else's activity fails (logged in) (0.338s)
✓ firefox on linux 4.4.0-101-generic - User Activity (non-auth) - Trying to view someone else's activity fails (logged out) (0.345s)
No unit test coverage for firefox on linux 4.4.0-101-generic
firefox on linux 4.4.0-101-generic: 78 passed, 1 failed

‣ Created remote session chrome 66.0.3359.170 on Linux (56e9d6edf4c74b235b3d0579df3e8f65)
✓ chrome 66.0.3359.170 on Linux - Comments (auth) - Comments form visible when logged in (0.376s)
✓ chrome 66.0.3359.170 on Linux - Comments (auth) - Posting a comment (1.611s)
✓ chrome 66.0.3359.170 on Linux - Comments (auth) - Posting an empty comment fails (2.291s)
✓ chrome 66.0.3359.170 on Linux - Comments (auth) - Pressing 'g' inside of comment textarea *doesn't* go to github issue (2.48s)
✓ chrome 66.0.3359.170 on Linux - Comments (auth) - Pressing 'l' inside of comment textarea *doesn't* open the label editor box (0.443s)
✓ chrome 66.0.3359.170 on Linux - History navigation - Back button works from issues page (1.124s)
✓ chrome 66.0.3359.170 on Linux - Image Uploads (non-auth) - postMessaged dataURI preview (1.219s)
✓ chrome 66.0.3359.170 on Linux - Image Uploads (non-auth) - postMessaged blob preview (1.209s)
✓ chrome 66.0.3359.170 on Linux - Image Uploads (non-auth) - uploaded image file preview (1.315s)
✓ chrome 66.0.3359.170 on Linux - Image Uploads (non-auth) - postMessaged dataURI image doesn't upload before form submission (1.199s)
✓ chrome 66.0.3359.170 on Linux - Image Uploads (non-auth) - postMessaged blob image doesn't upload before form submission (1.204s)
✓ chrome 66.0.3359.170 on Linux - Image Uploads (non-auth) - uploaded image file doesn't upload before form submission (1.239s)
✓ chrome 66.0.3359.170 on Linux - Image Uploads (non-auth) - remove image upload button is shown (1.295s)
✓ chrome 66.0.3359.170 on Linux - Image Uploads (non-auth) - clicking remove image upload button removes preview (1.22s)
✓ chrome 66.0.3359.170 on Linux - Image Uploads (non-auth) - clicking remove image upload button removes image URL (1.209s)
✓ chrome 66.0.3359.170 on Linux - Image Uploads (non-auth) - double image select works (3.251s)
✓ chrome 66.0.3359.170 on Linux - Index - front page loads (0.3s)
✓ chrome 66.0.3359.170 on Linux - Index - form toggles open then closed (2.568s)
✓ chrome 66.0.3359.170 on Linux - Index - browse issues (needstriage) (0.524s)
✓ chrome 66.0.3359.170 on Linux - Issue-list - FilterView renders (0.346s)
✓ chrome 66.0.3359.170 on Linux - Issue-list - IssueListView renders (1.625s)
✓ chrome 66.0.3359.170 on Linux - Issue-list - PaginationControlsView tests (1.064s)
✓ chrome 66.0.3359.170 on Linux - Issue-list - Pagination dropdown tests (1.188s)
✓ chrome 66.0.3359.170 on Linux - Issue-list - Pressing g goes to github issues (2.505s)
✓ chrome 66.0.3359.170 on Linux - Issue-list - Pressing g inside of search input *doesn't* go to github issues (0.583s)
✓ chrome 66.0.3359.170 on Linux - Issue-list - Loading issues page has default params in URL (0.386s)
✓ chrome 66.0.3359.170 on Linux - Issue-list - Loading partial params results in merge with defaults (0.356s)
✓ chrome 66.0.3359.170 on Linux - Issue-list - Dropdowns reflect state from URL (0.472s)
✓ chrome 66.0.3359.170 on Linux - Issue-list - Going back in history updates issue list and URL state (1.006s)
✓ chrome 66.0.3359.170 on Linux - Issue-list - Loading URL with stage param loads issues (0.387s)
✓ chrome 66.0.3359.170 on Linux - Issue-list - Clicking on a stage filter adds the correct param to the URL (0.498s)
✓ chrome 66.0.3359.170 on Linux - Issue-list - Toggling a stage filter doesn't leave the param in the URL (0.899s)
✓ chrome 66.0.3359.170 on Linux - Issue-list - Toggling between stage filters results in last param in URL (0.867s)
✓ chrome 66.0.3359.170 on Linux - Issues (auth) - Pressing 'l' opens the label editor box (0.386s)
✓ chrome 66.0.3359.170 on Linux - Issues - Issue page loads (0.379s)
✓ chrome 66.0.3359.170 on Linux - Issues - Issue comments load (0.394s)
✓ chrome 66.0.3359.170 on Linux - Issues - Pressing g goes to the github issue page (2.281s)
✓ chrome 66.0.3359.170 on Linux - Issues - NSFW images are blurred (0.346s)
✓ chrome 66.0.3359.170 on Linux - Issues - Clicking NSFW images toggles between blurry and not-blurry (0.707s)
✓ chrome 66.0.3359.170 on Linux - Labels (auth) - Label editor opens then closes (clicks) (0.576s)
✓ chrome 66.0.3359.170 on Linux - Labels (auth) - Label editor opens then closes (key events) (0.467s)
✓ chrome 66.0.3359.170 on Linux - Labels (auth) - Clicking outside label editor closes it (0.535s)
✓ chrome 66.0.3359.170 on Linux - Labels (auth) - Clicking close button actually closes it (0.42s)
✓ chrome 66.0.3359.170 on Linux - Milestones (auth) - Milestone editor opens then closes (clicks) (0.519s)
✓ chrome 66.0.3359.170 on Linux - Milestones (auth) - Milestone editor opens then closes (key events) (0.496s)
✓ chrome 66.0.3359.170 on Linux - Milestones (auth) - Clicking outside milestone editor closes it (0.478s)
✓ chrome 66.0.3359.170 on Linux - Milestones (auth) - Clicking close button actually closes it (0.357s)
✓ chrome 66.0.3359.170 on Linux - Milestones (non-auth) - Page loads without milestone set (0.234s)
✓ chrome 66.0.3359.170 on Linux - Milestones (non-auth) - Missing status error displays (0.24s)
✓ chrome 66.0.3359.170 on Linux - New Issue Page - new issue page loads (0.25s)
✓ chrome 66.0.3359.170 on Linux - Reporting (auth) - Report button shows name (0.217s)
✓ chrome 66.0.3359.170 on Linux - Reporting (non-auth) - Submit buttons are disabled (0.195s)
✓ chrome 66.0.3359.170 on Linux - Reporting (non-auth) - Wyciwyg bug workaround (0.169s)
✓ chrome 66.0.3359.170 on Linux - Reporting (non-auth) - Report button shows via GitHub (0.176s)
✓ chrome 66.0.3359.170 on Linux - Reporting (non-auth) - URL validation (1.048s)
✓ chrome 66.0.3359.170 on Linux - Reporting (non-auth) - Description validation (1.012s)
✓ chrome 66.0.3359.170 on Linux - Reporting (non-auth) - (optional) browser + os validation (0.669s)
✓ chrome 66.0.3359.170 on Linux - Reporting (non-auth) - Image extension validation (0.363s)
✓ chrome 66.0.3359.170 on Linux - Reporting (non-auth) - Submits are enabled (0.964s)
✓ chrome 66.0.3359.170 on Linux - Reporting (non-auth) - problem_type param selects problem type (0.179s)
✓ chrome 66.0.3359.170 on Linux - Reporting (non-auth) - details param doesn't add info to description (0.149s)
Expected fixture file: /home/travis/build/webcompat/webcompat.com/tests/fixtures/api/issues/category/needsdiagnosis.d0b9d00b5e714a3353387b62a4587eee.json
✓ chrome 66.0.3359.170 on Linux - Search (auth) - Search/filter interaction (1.054s)
✓ chrome 66.0.3359.170 on Linux - Search (auth) - Results are loaded from the query params (0.304s)
✓ chrome 66.0.3359.170 on Linux - Search (auth) - Search works by icon click (0.68s)
✓ chrome 66.0.3359.170 on Linux - Search (auth) - Search works by Return key (0.65s)
✓ chrome 66.0.3359.170 on Linux - Search (auth) - Search from the homepage (2.033s)
✓ chrome 66.0.3359.170 on Linux - Search (auth) - Search with a dash works (0.609s)
✓ chrome 66.0.3359.170 on Linux - Search (auth) - After search without results, suggested label appear and have a clickable URL. (2.993s)
✓ chrome 66.0.3359.170 on Linux - Search (auth) - Search input is loaded from q param (with dashes) (0.216s)
✓ chrome 66.0.3359.170 on Linux - Search (non-auth) - Pressing g inside of search input *doesnt* go to github issues (0.502s)
✓ chrome 66.0.3359.170 on Linux - Search (non-auth) - Clicking on label search adds query parameter to the URL (0.617s)
✓ chrome 66.0.3359.170 on Linux - Search (non-auth) - Clicking on label search updates the search input (2.67s)
✓ chrome 66.0.3359.170 on Linux - Search (non-auth) - Search input is visible (0.433s)
✓ chrome 66.0.3359.170 on Linux - Search (non-auth) - Empty search input removes q param (3.485s)
✓ chrome 66.0.3359.170 on Linux - User Activity (auth) - We're at the right place (0.298s)
✓ chrome 66.0.3359.170 on Linux - User Activity (auth) - IssueListView renders (1.559s)
✓ chrome 66.0.3359.170 on Linux - User Activity (auth) - Trying to view someone else's activity fails (logged in) (0.208s)
TOTAL: tested 2 platforms, 157 passed, 1 failed
{ Error: One or more tests failed
    at /home/travis/build/webcompat/webcompat.com/node_modules/intern/lib/executors/Executor.js:400:45
    at /home/travis/build/webcompat/webcompat.com/node_modules/@dojo/core/async/Task.js:252:28
    at handler (/home/travis/build/webcompat/webcompat.com/node_modules/@dojo/core/async/ExtensiblePromise.js:146:37)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7) reported: true }
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! webcompat@ test:js: `node ./tests/functional/_intern.js "--reporters=runner" "--firefoxBinary=/home/travis/firefox-58.0/firefox/firefox"`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the webcompat@ test:js script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/travis/.npm/_logs/2018-05-10T21_51_58_182Z-debug.log

@miketaylr
Copy link
Member

miketaylr commented May 9, 2018

@karlcow can you investigate the chrome test failure?

chrome 66.0.3359.139 on Linux - Index - reporter addon link is shown (10.126s)
    NoSuchElement: [POST http://localhost:4444/wd/hub/session/0a447bd2c77823dff3252e0d2e7de76e/element / {"using":"css selector","value":".js-addon-link"}] no such element: Unable to locate element: {"method":"css selector","selector":".js-addon-link"}
      (Session info: headless chrome=66.0.3359.139)
      (Driver info: chromedriver=2.38.552522 (437e6fbedfa8762dec75e2c5b3ddb86763dc9dcb),platform=Linux 4.4.0-101-generic x86_64)
      at Test.reporter addon link is shown [as test]  <tests/functional/index-non-auth.js:31:10>
      at <src/lib/Test.ts:260:47>

That's an instance where we do use UA sniffing to know which addon link to give.

Copy link
Member

@miketaylr miketaylr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code change looks good!

Just unsure about the test failure, possibly a regression.

@karlcow
Copy link
Member Author

karlcow commented May 9, 2018

ok let's see manually at least. This is working.

capture d ecran 2018-05-10 a 05 59 44

And I'm not sure why it would fail, because this is done on the JS side there's no request to the UA parsing in python.

Unable to locate element: {"method":"css selector","selector":".js-addon-link"}

The test took 10+ s. I would bet on unresponsive page.

× chrome 66.0.3359.139 on Linux - Index - reporter addon link is shown (10.126s)

The ua_parser is used to prepopulate the form with values. The only related issue I could imagine is that the page took too long to generate.

@miketaylr
Copy link
Member

@karlcow do you see a "retrigger build" button from https://travis-ci.org/webcompat/webcompat.com/builds/376706871?utm_source=github_status&utm_medium=notification when you log in?

Normally it's there for me... but I think since I don't have write access to your fork, only can do it. Might be good to see if it's just being slow like you suggest.

@karlcow
Copy link
Member Author

karlcow commented May 9, 2018

In the process but I tried locally and it fails too at the same place with a long delay too.

capture d ecran 2018-05-10 a 06 21 45

What is strange is the test before is the front page load and it is blazing fast. :)
but for the ua_parser it does basically the same thing, populating the form.

@karlcow
Copy link
Member Author

karlcow commented May 9, 2018

Same consistent failure. So weird.

@karlcow
Copy link
Member Author

karlcow commented May 9, 2018

ah it is used here

# browser_name is used in topbar.html to show the right add-on link
browser_name = get_browser_name(ua_header)

@karlcow
Copy link
Member Author

karlcow commented May 9, 2018

Locally and manually, it displays: chrome using chrome Canary.
but the tests seem to be using chrome 66.0.3359.139

Let's test a couple of things.

@karlcow
Copy link
Member Author

karlcow commented May 9, 2018

Ah wait one of the changes, that 0.8 brought is unicode_literals.
And we play with strings.

We have a couple of

    if user_agent_string and isinstance(user_agent_string, basestring):

http://python-future.org/compatible_idioms.html#basestring

but that should fail for other tests then.

What else:
The name returned by the test is headlesschrome, not chrome.
The template is expecting chrome.

{%- elif browser == 'opera' -%}
<li class="nav-item">
<a class="nav-linknnjs-addon-link" href="https://addons.opera.com/en/extensions/details/webcompatcom-reporter/?display=en"
title="Navigate to opera addons">
<svg class="icon nav-icon" viewBox="0 0 30 30" role="presentation">
<title>Opera Extension</title>
<use xlink:href="#svg-download2"> Opera Extension</use>
</svg>
<span class="link-text">Download Opera Add-on</span>
</a>
</li>

The test is always expected to work whichever browser we used. And there's no test to test that the addon link is not there for an unknown browser. I think that's the issue.

@karlcow
Copy link
Member Author

karlcow commented May 9, 2018

Ah! uap-core added headlesschrome parsing one year ago on Mar 15, 2017
ua-parser/uap-core@8319ee9

https://github.com/ua-parser/uap-python/releases

  • 0.7.2 (current version) is from Oct 31, 2016
  • 0.7.3 from Feb 2, 2017
  • 0.8 from Apr 10, 208

So we have the combination of a weak functional test and a better UA detection.

ok now I need to fix the functional test :)

@miketaylr
Copy link
Member

miketaylr commented May 9, 2018

So we have the combination of a weak functional test and a better UA detection.

:)

We could just search for "chrome" in the string, rather than expect an exact match... (in the template, that is).

@karlcow
Copy link
Member Author

karlcow commented May 9, 2018

@miketaylr
We could search in the template, indeed. That's the quick fix. :)
But that also means the test will fail if we were adding yet another strange test browser name.

I think these addons link test could be on the unit testing side, as they are not dependent of the JS interaction at all but about the content.
Testing on the unit testing side would allow us to mock easily the user agent string for testing all types of addon links AND the non-known-browser case.

karlcow added a commit to karlcow/webcompat.com that referenced this pull request May 9, 2018
This does two things:
- Adds unittest tests to check that the right partial template for addons is sent depending on the user agent string.
- Adds a test for an unknown browser
- Fixes the template for addon where some white spaces where left over here and there.
- Removes the previous weaker functional tests which was very dependent on the testing browser.

It was triggered by the upgrade of ua-parser in python which took into account the headlesschrome user agent string, then not detected by our template. It was making the functional test fail.
See webcompat#2444 for the background.
@karlcow
Copy link
Member Author

karlcow commented May 9, 2018

ok let's see what Travis think about
13306b9

karlcow added a commit to karlcow/webcompat.com that referenced this pull request May 10, 2018
This does two things:
- Adds unittest tests to check that the right partial template for addons is sent depending on the user agent string.
- Adds a test for an unknown browser
- Fixes the template for addon where some white spaces where left over here and there.
- Removes the previous weaker functional tests which was very dependent on the testing browser.

It was triggered by the upgrade of ua-parser in python which took into account the headlesschrome user agent string, then not detected by our template. It was making the functional test fail.
See webcompat#2444 for the background.
@karlcow
Copy link
Member Author

karlcow commented May 10, 2018

oopsie some syntax issues. commit, force update, repeat and rinse.

@karlcow
Copy link
Member Author

karlcow commented May 10, 2018

@miketaylr Yoohoo all checks have passed. Pfew…

Copy link
Member

@miketaylr miketaylr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@@ -26,16 +26,6 @@ registerSuite("Index", {
.end();
},

"reporter addon link is shown"() {

This comment was marked as abuse.

CHROME_UA = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3425.0 Safari/537.36' # noqa
FIREFOX_UA = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:61.0) Gecko/20100101 Firefox/61.0' # noqa
FIREFOX_AND_UA = 'Mozilla/5.0 (Android; Mobile; rv:61.0) Gecko/61.0 Firefox/61.0' # noqa
SAFARI_UA = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.2 Safari/605.1.15' # noqa

This comment was marked as abuse.

This comment was marked as abuse.

@miketaylr
Copy link
Member

Feel free to merge if you want to remove that safari string (or just merge and leave it in, not a huge issue inside test code).

This does two things:
- Adds unittest tests to check that the right partial template for addons is sent depending on the user agent string.
- Adds a test for an unknown browser
- Fixes the template for addon where some white spaces where left over here and there.
- Removes the previous weaker functional tests which was very dependent on the testing browser.

It was triggered by the upgrade of ua-parser in python which took into account the headlesschrome user agent string, then not detected by our template. It was making the functional test fail.
See webcompat#2444 for the background.
@karlcow
Copy link
Member Author

karlcow commented May 10, 2018

wooot…
capture d ecran 2018-05-11 a 06 53 54

@karlcow
Copy link
Member Author

karlcow commented May 10, 2018

Let's kick it again again… 😭

@karlcow
Copy link
Member Author

karlcow commented May 10, 2018

pfew. all green. 💚

@karlcow karlcow merged commit 4c8ff98 into webcompat:master May 10, 2018
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.

3 participants