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

Fixes #1271 - Adds thumbnails to image upload and link them #1557

Merged
merged 5 commits into from
May 12, 2017

Conversation

karlcow
Copy link
Member

@karlcow karlcow commented May 12, 2017

  • Changes functional tests for image upload
  • Handles the markup on the client side when uploading images
  • Handles the image resizing on the python side
→ nosetests -v
API access to comments greater than 30 returns pagination in Link ... ok
API issue for a non existent number returns JSON 404. ... ok
API issue search with bad keywords returns JSON 404. ... ok
API access to labels without auth returns JSON 200. ... ok
API with wrong parameter returns JSON 404. ... ok
API setting labels without auth returns JSON 403 error code. ... ok
API access to user activity without auth returns JSON 401. ... ok
API with wrong category returns JSON 404. ... ok
API with wrong route returns JSON 404. ... ok
Checks that domain name is extracted. ... ok
Checks that metadata is processed and wrapped. ... ok
Checks that URL is normalized. ... ok
Test HTTP Links formating. ... ok
Test browser parsing via get_browser helper method. ... ok
Test browser name parsing via get_browser_name helper method. ... ok
Test name extraction from Dict via get_name helper method. ... ok
Test OS parsing via get_os helper method. ... ok
Test version string composition from Dict ... ok
Test that API params are correctly converted to Search API. ... ok
normalize_api_params shouldn't transform unknown params. ... ok
Test HTTP Links parsing for GitHub only. ... ok
test_rewrite_and_sanitize_link (tests.test_helpers.TestHelpers) ... ok
Test we're correctly rewriting the passed in link. ... ok
Test that we're removing access_token parameters. ... ok
Check Cache-Control for issues. ... ok
Check ETAG for issues. ... ok
Checks if we receive a 304 Not Modified. ... ok
Page title format for different URIs. ... ok
Test that Base64 screenshots return the expected status codes. ... ok
Test that /upload/ doesn't let you GET. ... ok
Test that uploaded files return the expected status code. ... ok
Test that /about exists. ... ok
Test that asks user to log in before displaying activity. ... ok
Test POST to /csp-report w/ correct content-type returns 204. ... ok
Test POST w/ wrong content-type to /csp-report returns 400. ... ok
Test that the home page exists. ... ok
Test issues and integer for: ... ok
Test that the /issues/<number> exists, and does not redirect. ... ok
Test that the /issues route gets 200 and does not redirect. ... ok
Webhook related tests. ... ok
Test that the /login route 302s to GitHub. ... ok
Sends 400 to POST on /issues/new with missing parameters. ... ok
Test that /issues/new exists. ... ok
Checks 500 is not accepted for /issues/new POST. ... --------------------------------------------------------------------------------
INFO in views [/Users/karl/code/webcompat.com/webcompat/views.py:198]:
127.0.0.1 http://example.com
--------------------------------------------------------------------------------
ok
Test that /privacy exists. ... ok
Rate Limit URI sends 410 Gone. ... ok
Test that the /tools/cssfixme route gets 200. ... ok
Test that the /tools/cssfixme route gets 200 with ?url query. ... ok
Test that the /tools/cssfixme route gets 200 with bad ?url query. ... ok

----------------------------------------------------------------------
Ran 49 tests in 7.023s

OK

And functional tests have two failures but which seems unrelated to my case.

✓ firefox on any platform - Image Uploads (non-auth) - postMessaged dataURI preview
✓ firefox on any platform - Image Uploads (non-auth) - postMessaged blob preview
✓ firefox on any platform - Image Uploads (non-auth) - remove image upload button
✓ firefox on any platform - Image Uploads (non-auth) - postMessaged dataURI preview
✓ firefox on any platform - Image Uploads (non-auth) - postMessaged blob preview
✓ firefox on any platform - Image Uploads (non-auth) - postMessaged dataURI image upload worked
✓ firefox on any platform - Image Uploads (non-auth) - postMessaged blob image upload worked
✓ firefox on any platform - Image Uploads (non-auth) - remove image upload button
× firefox on any platform - Image Uploads (non-auth) - uploaded image file preview
Error: [POST http://localhost:4444/wd/hub/session/5f70df34-ff7a-483b-9989-7e4800f72a7b/element/16/value / {"value":["/var/folders/bg/lmsn8jdx47748dbg0nrh2m8h0000gn/T/5f70df34-ff7a-483b-9989-7e4800f72a7b/upload402813535228457702file/green_square.png"]}] Expected [object Undefined] undefined to be a string
Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:48:19 -0700'
System info: host: 'irori.local', ip: '192.168.11.7', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.4', java.version: '1.8.0_111'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{moz:profile=/var/folders/bg/lmsn8jdx47748dbg0nrh2m8h0000gn/T/rust_mozprofile.0C4XPt3FNkUw, rotatable=false, timeouts={implicit=0, pageLoad=300000, script=30000}, pageLoadStrategy=normal, platform=ANY, specificationLevel=0, moz:accessibilityChecks=false, acceptInsecureCerts=false, browserVersion=53.0, platformVersion=16.5.0, moz:processID=97832, browserName=firefox, platformName=darwin}]
Session ID: c798b7a9-9c7d-0041-bd5b-4c905d5e8c3f
  at Test.uploaded image file preview [as test]  <tests/functional/image-uploads-non-auth.js:69:12>
× firefox on any platform - Image Uploads (non-auth) - uploaded image file upload worked
Error: [POST http://localhost:4444/wd/hub/session/5f70df34-ff7a-483b-9989-7e4800f72a7b/element/22/value / {"value":["/var/folders/bg/lmsn8jdx47748dbg0nrh2m8h0000gn/T/5f70df34-ff7a-483b-9989-7e4800f72a7b/upload8546394691103083768file/green_square.png"]}] Expected [object Undefined] undefined to be a string
Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:48:19 -0700'
System info: host: 'irori.local', ip: '192.168.11.7', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.4', java.version: '1.8.0_111'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{moz:profile=/var/folders/bg/lmsn8jdx47748dbg0nrh2m8h0000gn/T/rust_mozprofile.0C4XPt3FNkUw, rotatable=false, timeouts={implicit=0, pageLoad=300000, script=30000}, pageLoadStrategy=normal, platform=ANY, specificationLevel=0, moz:accessibilityChecks=false, acceptInsecureCerts=false, browserVersion=53.0, platformVersion=16.5.0, moz:processID=97832, browserName=firefox, platformName=darwin}]
Session ID: c798b7a9-9c7d-0041-bd5b-4c905d5e8c3f
  at Test.uploaded image file upload worked [as test]  <tests/functional/image-uploads-non-auth.js:129:12>

tests/intern
Tunnel: Starting

Total: [✓✓×✓✓×✓] 7/7
Passed: 5  Failed: 2  Skipped: 0

Fx ANY:     [✓✓×✓✓×✓] 7/7, 2 fail

The two errors are explicitly saying:

Expected [object Undefined] undefined to be a string

Oh and the functional tests are still super unstable locally.

r? @miketaylr

@karlcow
Copy link
Member Author

karlcow commented May 12, 2017

Just for the record. Same issue with

python run.py -t

and geckodriver 0.16.1

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.

Looks good!

I ran tests locally and only ran into one failure, in comments-auth.js:

"Add a screenshot to a comment" line 151 has ![Screenshot of the site issue] -- that needs to be updated to [![Screenshot Description](http://localhost:5000/uploads/.

Let me clone your fork and I'll push the fix before merging.

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

Successfully merging this pull request may close these issues.

2 participants