bestiejs / json3

A JSON polyfill. No longer maintained.
https://bestiejs.github.io/json3
Other
1.02k stars 150 forks source link

Sauce Labs Automated Testing #49

Closed bnjmnt4n closed 9 years ago

bnjmnt4n commented 10 years ago

Travis CI has already been integrated into JSON3, so I think we can start to implement automated browser testing with Sauce Labs. Lo-Dash has been doing this for some time already, with great results. The only problem with implementing this is that Spec, the test suite we use, is not natively supported, meaning we have to use wd (Selenium/WebDriver library) to access the test results ourselves.

bnjmnt4n commented 10 years ago

I'll work on this on the saucelabs branch with my saucelabs info for now

jdalton commented 10 years ago

Why hide the sauce username? I assume you'll have badges or link to the results page, which exposes the sauce username anyways, it's a public project after all.

bnjmnt4n commented 10 years ago

Yeah, I was using my username first. Eventually I'll change that.

jdalton commented 10 years ago

Cool.

ghost commented 9 years ago

Let's think about migrating away from Spec if it makes Sauce integration easier.

jdalton commented 9 years ago

Sauce supports custom unit test libs :D :goat:

bnjmnt4n commented 9 years ago

Yeah, it does, was a bit busy. There’s no need to switch from Spec. Will try to finish soon.

ghost commented 9 years ago

Cool. No rush at all; just curious if switching to something like QUnit would make things easier. Thanks, @jdalton and @d10! :smiley_cat:

bnjmnt4n commented 9 years ago

I made a support request on Sauce Labs, since the tests worked fine, yet they were failing on Sauce Labs. One of the awesome people at Sauce Labs, @saucyallison, responded:

I took a look at your test, and then did some testing of my own. I don't see anything wrong with your test, but I think I've found the reason your test results aren't displaying properly. I took the contents of your window.global_test_results and put them on a sandbox html page so I could use it with the JS unit test API. My tests were returning "Finished" instead of the proper results like your tests were. I noticed that the window.global_test_results was a fairly large object, so I tried removing test info from it. Eventually, with enough info removed, the unit test results display as expected, with Pass/Fail status. I think the underlying problem here is that the window.global_test_results are stored in the "custom data" field in our database (and on the Metadata tab in the test details page), which has a maximum size. Once this limit is reached, the custom data field gets set to null instead. The size limit is supposed to be 64 KB, but it looks like the size of your input is closer to 42KB, so I believe there's something wrong with our logic. We're looking into increasing the size of this field in the near future! In the meantime, my advice would be to cut your tests down into smaller chunks. Here is an example of the largest global_test_results object I was able to get working: https://saucelabs.com/tests/ffef55684c3748c683db30e8d9bf3e56 For this one, I added one additional unit test, and the results stopped displaying correctly: https://saucelabs.com/tests/b9c9c9461db7409b8bb789dfa4bc45ab Hope this helps! Sorry for the confusion here, I know this kind of problem isn't very self-explanatory. Let me know if you have further questions, thank you!

For now, I'll just not add passing tests to the global_test_results variable, until @saucelabs fixes this.

bnjmnt4n commented 9 years ago

@kitcambridge This now works. Feel free to rebase/merge this. (Test fails are not related, they are due to the Rhino download.)

ghost commented 9 years ago

This is awesome. :star2: Thanks so much, @d10! I'll merge tonight.

ghost commented 9 years ago

"Three weeks" is an interesting definition of "tonight." :crying_cat_face: Sorry for letting this slide; I've been really busy. Merging now.

jdalton commented 9 years ago

Booo GoLang Boo! : D

ghost commented 9 years ago

@jdalton Go was four weeks ago...it's Twisted Python now. :stuck_out_tongue_winking_eye:

ghost commented 9 years ago

Merged as 2043202f4f1f73f6a085c4852dbafb2c43e847d0. Thanks again for the great work, @d10. Let's see if #78 fixes the Date-related failures...

bnjmnt4n commented 9 years ago

Great banter, m8! ;)