-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Jasmine tests are failing locally #8360
Comments
@Flaburgan sorry, I don't know. I've never used this browser-based way of running Jasmine tests before; I've only run them via terminal. |
Hmm, I just ran the tests both in Chromium and Firefox locally, and got the green build @Flaburgan are there any errors in the browser console? |
@Flaburgan could you try disabling this test https://github.com/diaspora/diaspora/blob/develop/spec/javascripts/app/views/conversations_inbox_view_spec.js#L88 ? Will it make the rest of the testsuite pass for you? |
@ragesoss Do you mind sharing the command you use to run them in the terminal? |
@Flaburgan I also only run jasmine in the terminal and never had problems with it. And the command for that is: |
When I run them this way, they hang even on the develop branch after:
(output generated with the help of e3a4422) I'm quite sure the browser is stuck on the "Are you sure you want to quit the page" pop ups, problem that I tried to solve (without success) with a517e66 and 9b39889 |
For information, after pulling the latest changes in |
Note that I am not 100% certain. I only spotted this one event resulting in a navigation, but there might be others. I also don't quite understand why it fails. In theory, the Publisher should not trigger a navigation, and it should just XHR. And in theory, that XHR should be captured by jasmine-ajax. Other publisher tests use a spy'ed callback for the submit trigger, like diaspora/spec/javascripts/app/views/publisher_view_spec.js Lines 244 to 245 in d4f92a8
but that didn't work in this case - it appears like passing a callback to the form submit here results in the publisher simply not working. I didn't dig deeper here, but this might be a possible approach to make this test work reliably. Note that there are also some other callback-less form submits, and I don't know if they are reliable or not. It's probably worth noting that accessing I pushed a commit that disables the test in question directly into @Flaburgan's PR #8035, and I think it's fine shipping this. The disabled spec is only a UX-test, not directly a functional test. Generally speaking, I feel like some of the Jasmine tests should be ported to Cucumber, or another test framework designed for full-depth integration tests. Technically, Jasmine was designed to be a unit test framework, and the fact that there are DOM mutations happening at all in our tests is a bit spooky to me. But I'm just noting this here to have a papertrail of that thought - I don't think I can personally spend the time on rewriting those tests, and I'm not expecting anyone else to do that, either. :) |
Despite the nice work done in #8333 my Jasmine tests are still failing locally, both with Firefox and Chromium.
Sometimes it gets redirected to another URL so it quits the tests:
2022-07-02.20-39-50.mp4
Sometimes it gets stuck because it asks if we're sure we want to reload the page.
@ragesoss do you reproduce those problems? Any idea what's going on?
The text was updated successfully, but these errors were encountered: