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

Jasmine - upgrade to 3.4.0, use chrome headless backend #5437

Merged
merged 6 commits into from
Apr 8, 2019
Merged

Jasmine - upgrade to 3.4.0, use chrome headless backend #5437

merged 6 commits into from
Apr 8, 2019

Conversation

himdel
Copy link
Contributor

@himdel himdel commented Apr 8, 2019

Right now, it looks like 9 out of the last 17 travis runs on master failed on spec:javascript:

* Listening on tcp://0.0.0.0:41063
Use Ctrl-C to stop

Waiting for jasmine server on 41063...
jasmine server started

No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself.
Check the details on how to adjust your build configuration on: https://docs.travis-ci.com/user/common-build-problems/#Build-times-out-because-no-output-was-received

The build has been terminated

Attempting to fix that.

The actual failure comes from phantomjs sometimes not managing to load the page, failing with:

ReferenceError: Can't find variable: SAFE_CLOSING

  undefined:18 in exports

(details in #5432)

Which is rather non-specific.

But, changing the backend from phantomjs to chrome headless fixes that (details in #5433).

The first jasmine gem version with support for chrome headless is 3.4.0 (also, the current latest),
so upgrading to that.

We had to fix the version to 2.5 when 2.6 came out, in #1148, but I don't see any info on why it failed, and .. it doesn't seem to fail now.


Jasmine 3.4.0 is a bit different in that it tries to run tests in random order by default. Leading to many failures (between 8 and 30ish) in our tests.

So, hacking the rake environment jasmine task to also output Please open http://localhost:8888/?random=false so that people get it right locally.

I also had to remove one random test, but it was one that was testing that the value it set was set, so, meh :).

Also had to add 2 test-only assets to the precompile list, as jasmine 3* fails trying to load non-precompiled assets.

This also means we're no longer testing our code in an old-browser-like environment.

@himdel
Copy link
Contributor Author

himdel commented Apr 8, 2019

@miq-bot add_label wip

@miq-bot miq-bot changed the title Jasmine - upgrade to 2.9 [WIP] Jasmine - upgrade to 2.9 Apr 8, 2019
@miq-bot miq-bot added the wip label Apr 8, 2019
himdel added 5 commits April 8, 2019 09:01
fails with:

```
catalogItemFormController #resetClicked resets value of name field to initial value
Uncaught TypeError: Cannot read property 'catalog_id' of undefined thrown
```

no more details, and I have no idea where it gets thrown from.

Fortunately the test just sets a var and tests it's there, so, removing.
jasmine now needs all the assets to be precompiled,
had to add jasmine-jquery and angular-mocks to precompile.

And our tests fail in random mode, disabling.
instead of phantomjs

this means `rake environment jasmine:ci` will now use google-chrome-beta to run tests
jasmine ignores the `random: false` option in `jasmine.yml` when running via `rake environment jasmine`.

So, adding a message that will appear before the default blob:

```diff

+Please open http://localhost:8888/?random=false

 Disabling webmock!
 your server is running here: http://localhost:8888/
 your tests are here:         /home/himdel/manageiq-ui-classic/spec/javascripts
 your source files are here:  /home/himdel/manageiq-ui-classic/app/assets

```
@himdel himdel changed the title [WIP] Jasmine - upgrade to 2.9 [WIP] Jasmine - upgrade to 3.4.0 Apr 8, 2019
@himdel himdel changed the title [WIP] Jasmine - upgrade to 3.4.0 [WIP] Jasmine - upgrade to 3.4.0, use chrome headless backend Apr 8, 2019
@miq-bot
Copy link
Member

miq-bot commented Apr 8, 2019

Some comments on commits https://github.com/himdel/manageiq-ui-classic/compare/7338e9b0ea7f748b15f075d4110bb83647e21bfb~...3896880a51f35097c56b579358bd30fccca27f55

Rakefile

  • ⚠️ - 38 - Detected puts. Remove all debugging statements.
  • ⚠️ - 39 - Detected puts. Remove all debugging statements.
  • ⚠️ - 40 - Detected puts. Remove all debugging statements.

@miq-bot
Copy link
Member

miq-bot commented Apr 8, 2019

Checked commits https://github.com/himdel/manageiq-ui-classic/compare/7338e9b0ea7f748b15f075d4110bb83647e21bfb~...3896880a51f35097c56b579358bd30fccca27f55 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
3 files checked, 3 offenses detected

Rakefile

spec/javascripts/support/jasmine_helper.rb

@himdel
Copy link
Contributor Author

himdel commented Apr 8, 2019

@miq-bot remove_label wip

@mzazrivec mzazrivec changed the title [WIP] Jasmine - upgrade to 3.4.0, use chrome headless backend Jasmine - upgrade to 3.4.0, use chrome headless backend Apr 8, 2019
@miq-bot miq-bot removed the wip label Apr 8, 2019
@mzazrivec mzazrivec self-assigned this Apr 8, 2019
@mzazrivec mzazrivec added the test label Apr 8, 2019
@mzazrivec mzazrivec added this to the Sprint 109 Ending Apr 15, 2019 milestone Apr 8, 2019
@mzazrivec mzazrivec merged commit 8a51c92 into ManageIQ:master Apr 8, 2019
@himdel himdel deleted the jasmine-new branch April 8, 2019 12:42
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.

3 participants