-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Changing jasmine tests to teaspoon-mocha #2997
Conversation
Generated by 🚫 Danger |
spec/javascripts/plots2_spec.js
Outdated
|
||
}); | ||
|
||
$('#like-button-1').trigger('click'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jywarren, some help required here. I was trying to make this action work but its not calling the ajax function but in jasmine it was calling the ajax function. So, all the expect statement are failing.
spec/javascripts/plots2_spec.js
Outdated
|
||
$('#like-button-1').trigger('click'); | ||
|
||
// should trigger the following and our ajaxSpy should return a fake response of "4": | ||
// jQuery.getJSON("/likes/node/1/create", {}, function() { ... | ||
var response; | ||
jQuery.getJSON("/likes/node/1/create").done(function(data){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this function is calling the ajax function correctly which is being stubbed above.
|
||
expect($($('.notes-grid tr')[1]).find('td:first a').html()).toEqual('First post'); | ||
expect($($('.notes-grid tr')[1]).find('td:first a').html()).to.eql('First post'); | ||
|
||
$('table:first th:first a').trigger('click'); | ||
|
||
setTimeout(0, function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jywarren, can I know why we used setTimeout here. Can't we test this without it?
I believe it was to bump the test to the bottom of the asynchronous queue,
to be sure it executes after other asynchronous threads. You can try but it
may not be as deterministic... but give it a try!
…On Mon, Jul 9, 2018 at 8:24 AM Sourav Sahoo ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In spec/javascripts/inline_grids_spec.js
<#2997 (comment)>:
>
- expect($($('.notes-grid tr')[1]).find('td:first a').html()).toEqual('First post');
+ expect($($('.notes-grid tr')[1]).find('td:first a').html()).to.eql('First post');
$('table:first th:first a').trigger('click');
setTimeout(0, function() {
Hi @jywarren <https://github.com/jywarren>, can I know why we used
setTimeout here. Can't we test this without it?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2997 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABfJwaOiY9q8NBG3epM1ehPqmUxHyv4ks5uE0tRgaJpZM4VFiwn>
.
|
oh ok thanks!! |
6391c8d
to
2747ff9
Compare
Hi @jywarren, I don't know why but the travis tests are not running here. What might be the reason? |
It was running on the third-last commit. |
its working now |
Hi @jywarren this is complete. Please review it |
This is great. I'd like to ask if another @publiclab/soc member could try installing this and running tests, as the Second, let's think about documentation of this in the TESTING docs? Third, do you want to try introducing a JavaScript error and/or test failure and show what happens, in this PR? We can then resolve it and see that it resolves too. I'm thinking of how it'll be represented -- would Dangerbot be able to see it? Even if not, will it be clearly visible in the Travis log, and we could make an integration later to display it in a comment? Thank you!!! |
yeah this goes smoothly as far as I have tested it. It would be nice if someone from @publiclab/soc could try installing this. yeah I would write documentation about it. Any help would be greatly appreciated. About the representation of the error in Dangerbot. Not Dangerbot doesn't shows any error but travis tests don't pass and it shows red. |
I guess I have to work for showing the errors in Dangerbot. I have to study about dangerbot to get it working. Thanks!! |
There may be other ways to show errors too, besides Dangerbot! Maybe Travis
can generate messages?
…On Wed, Jul 11, 2018 at 3:33 PM Sourav Sahoo ***@***.***> wrote:
I guess I have to work for showing the errors in Dangerbot. I have to
study about dangerbot to get it working. Thanks!!
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#2997 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABfJ4uGS6FUP3D8YARYXEwb-0YkX4zOks5uFlLWgaJpZM4VFiwn>
.
|
Yeah just see how it works I have created an intentional error. |
Hmm dangerbot doesn't shows any error but travis shows an error. That's what I was talking about. What do you think? |
.travis.yml
Outdated
@@ -27,6 +27,7 @@ install: | |||
|
|||
script: | |||
- docker-compose exec web bash -c "CI=TRUE GENERATE_REPORT=true rake test:all" | |||
- cat ./spec/TEST-Teaspoon-Result.xml >> output2.xml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should maybe this be unnecessary since anything starting with TEST and ending with .xml
will get compiled into output.xml?
Dangerfile
Outdated
@@ -27,8 +27,12 @@ end | |||
|
|||
message "Pull Request is marked as Work in Progress" if github.pr_title.include? "[WIP]" | |||
|
|||
junit.parse "output2.xml" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah ok. But then you could skip this part and have the original tests put in /spec/TEST-Teaspoon-Result.xml
right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I will directly parse /spec/TEST-Teaspoon-Result.xml
Hi, I think you may need to do Either we should work on getting Danger to properly read and report the Junit tests, OR we should come up with another mechanism (maybe another bot?) to get Junit test reports (or anything from Travis) to be reported back. If you end up using Jasmine, there are Junit reporters here: https://github.com/larrymyers/jasmine-reporters There's some on Teaspoon and reports in CI here: https://github.com/jejacks0n/teaspoon#ci-support |
I guess I think debugging Danger's reading of Junit failures is probably the best route. I think you could try to debug by outputting the compiled junit tests and trying to read them in the logs manually, as painstaking as that sounds. |
Ok I will try one of these especially the teaspoon ci reporter. Let's see how it works. But currently I am travelling back to my college. So, I will be fully available tomorrow. |
OK!
…On Tue, Jul 17, 2018 at 10:06 PM Sourav Sahoo ***@***.***> wrote:
Ok I will try one of these especially the teaspoon ci reporter. Let's see
how it works. But currently I am travelling back to my college. So, I will
be fully available tomorrow.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2997 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABfJ--qh7xihT_Nwsrr0HfrMQzFHe4eks5uHpgcgaJpZM4VFiwn>
.
|
Hi @jywarren, I have reverted all the changes related to reporting of the failures. Review this once. I will be submitting the reporting fix in another PR. Thanks!! |
Great - so if a test fails, this will show a failure, but just as an X, without reporting, right? Or will JavaScript errors not trigger a Travis failure? Thanks! |
No travis will show a X, without reporting |
Perfect! Merged! 🎉 |
* Changed jasmine tests to teaspoon-mocha * Few corrections * Corrected inline_grids_spec.js * Some changes in first test of plots2_spec.js * Made the first expect work * made the click function above the jquery function in plots_spec * Corrected the wikis_spec.js * Corrected all tests in plots2_spec.js * Corrected the Gemfile * Running the rake test:all in Rakefile * Corrected the rubocop offenses * Corrected some identation problem in .travis.yml * Passing the reports to dangerbot * removed jasmine tasks from Rakefile and other modifications * Modified the Dangerfile * Modified the travis.yml * Changed the Dangerfile * Shortened test for js failure * Some mistake while updation * Some changes in .travis.yml * Added junit-danger to Gemfile * Modified the Dangerfile * modification in Dangerfile * Modified Dangerfile * Modified the Dangerfile * Written only junit.failures * Reverted the changes required for Dangerbot reporting
Fixes #2967
Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!
rake test
fixes #0000
-style reference to original issue #@publiclab/reviewers
for help, in a comment belowIf tests do fail, click on the red
X
to learn why by reading the logs.Please be sure you've reviewed our contribution guidelines at https://publiclab.org/contributing-to-public-lab-software
We have a loose schedule of reviewing and pulling in changes every Tuesday and Friday, and publishing changes on Fridays.
Thanks!