openstf / stf

Control and manage Android devices from your browser.
https://openstf.io
Other
13.17k stars 2.71k forks source link

Update STF to support latest node.js versions #1134

Open skumar1122 opened 4 years ago

skumar1122 commented 4 years ago

Is your feature request related to a problem? Please describe. As we know for now STF supports older version of Node.js(v8.14), recently node.js has updated few versions. Just to keep things working as expected with other softwares we want to update Node.js to latest.

Describe the solution you'd like STF should support latest(v11.x or v12.x) node.js versions.

issue-label-bot[bot] commented 4 years ago

Issue-Label Bot is automatically applying the label feature_request to this issue, with a confidence of 0.96. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

jupe commented 4 years ago

I could help in this work. Maybe first step is to go through dependencies which one does not support latest node LTS and update them..

koral-- commented 4 years ago

Feel free to open a PR.

Cookies52 commented 4 years ago

@jupe Are you still planning on working on this? Happy to take a look instead if not!

jupe commented 4 years ago

I played a bit and so far biggest breaking changes I found related to webpack.config.js and zmq. Here is one try: https://circleci.com/workflow-run/350f4adf-26d0-4044-b4d3-9cd209b05ea8 In this case zmq@2.15.3 it's clear that its not compatible with node@12 -> perhaps should be replaced with zeromq -module which is more updated module nowadays.

If somebody are familiar with webpack.config.js could update it against latest webpack..

Overall looks that many of project dependencies are quite obsoleted and it's quite big risk to update them because there is little amount of unit tests unfortunately..

Here is changes what I did: https://github.com/jupe/stf/compare/master...node12_with_ci. (node@8 and node@12)

Cookies52 commented 4 years ago

I was playing a bit with this today as well - spotted this issue after having some install issues hence why I shouted up on it.

I've got a working gulp and webpack files, I'll push them up in a bit.

I agree on the dependency points... There's several being flagged up by npm audit, which probably need to be looked at fixing.... Not sure if this should be done along with the rest of this or as a separate PR/issue.

jupe commented 4 years ago

great. I think its better to update obsoleted in another PR unless node@12 require updating.. small steps forward is always more safe approach 🙂

jupe commented 4 years ago

@Mdann52 could you push your changes to github so I could try it also?

Cookies52 commented 4 years ago

Apologies got called in so will do later this evening.

jupe commented 4 years ago

I just realised that project contains already travis config - so it's easy to add node@12 test job there. There seems to be a lot of eslint warnings - maybe I could have some time to cleanup those as well.. :)

Cookies52 commented 4 years ago

If you don't let me know - having just done the same in the day job well worth to refactoring right not!

jupe commented 4 years ago

761af142 fixes 60 eslint warnings --> <100 left :) . Maybe todo comments should be ignored and when all is fixed CI could force that no more eslint warnings lands to master to avoid future monkey work... :)

Cookies52 commented 4 years ago

@jupe I've pushed my changes - mdann52/stf

I've also updated some packages, there's some protobuf issues but I think that's my local setup as opposed to anything else!

jupe commented 4 years ago

@Mdann52 I merged your changes to my branch...

I get existing CI pipe to pass but stf doesn't work still -> false positive result.. perhaps some gulp configuration issue or existing test just does not verify enough. I added simple start-server-and-test -step here which tries to start server and step pass if server responds -> it fails. Obviously project needs more e2e tests to ensure that everything works after refactoring/dependencies updates..

jupe commented 4 years ago

@Mdann52 could you check gulp config once more time since I think there is still some issues because I get errors because modules can't be resolved like this:

Module not found: Error: Can't resolve 'ui-bootstrap' in '/home/travis/build/jupe/stf/res/app/components/stf/common-ui/modals/common'

CI build: https://travis-ci.org/jupe/stf/jobs/657610045?utm_medium=notification&utm_source=github_status

Probably something very small..

Cookies52 commented 4 years ago

@jupe Hopefully fixed webpack at least now (unfortunately given I work in healthcare-related field it's been rather busy....)

amrsa1 commented 4 years ago

Thats great upgrade, looking forward to it

jupe commented 4 years ago

I managed to build and pass backend tests already with node12. Now trying to activate rest of tests to CI that was not part of CI pipeline before. All testing helps are welcome: https://github.com/jupe/stf/pull/7 . Probably there is still things to fix before it's really working with node12. Perhaps we should activate node14 as well since it's becoming LTS pretty soon.

update: at least there is still UI compiling issues since it crashes:

Unhandled Promise Rejection: TypeError: r.module is not a function. (In 'r.module("angular-growl",[])', 'r.module' is undefined)
(anonymous function) — authmock.entry.js:1:1951
promiseReactionJob
0.85ef3626d368dff5d162.chunk.js:7:23437
amrsa1 commented 4 years ago

Excellent work, and i agree about activating the node 14, anyway i can help in testing just ping me when you done with it

nanoscopic commented 4 years ago

As a note on this; I have upgraded part of STF to node 12. Specifically the provider. See https://github.com/nanoscopic/stf-android-provider

I have not yet properly setup the repo to show what changes I made from the base android code though. If you copy the same files out into a fresh repo, and then paste the files I made overtop you will effectively be able to see the changes I made.

I'm not sure that the entire system can be safely / easily / reasonably upgraded to node 12 in one go.

amrsa1 commented 3 years ago

any news regarding upgrading to node 12

nanoscopic commented 3 years ago

I don't think there is anyone working on upgrading all of OpenSTF to Node 12 at this moment. It needs to happen overall at some point but other issues take priority in my mind and likely also in the minds of other contributors.

It would be interesting to hear what specific reasons there are that it is important to upgrade to Node 12 sooner rather than later.

The work I did in this regard was because of wanting to use upgraded Linux distros and also MacOS that don't provide updated support for Node 8. ( I've seen mention by some that STF works on Node 9?? ) MacOS is specifically problematic for latest versions of MacOS using Node 8.

amrsa1 commented 3 years ago

I don't think there is anyone working on upgrading all of OpenSTF to Node 12 at this moment. It needs to happen overall at some point but other issues take priority in my mind and likely also in the minds of other contributors.

It would be interesting to hear what specific reasons there are that it is important to upgrade to Node 12 sooner rather than later.

The work I did in this regard was because of wanting to use upgraded Linux distros and also MacOS that don't provide updated support for Node 8. ( I've seen mention by some that STF works on Node 9?? ) MacOS is specifically problematic for latest versions of MacOS using Node 8.

This is enough reason, moreover appium is working differently with node 12 and many other dependencies for mobile automation are not supporting node 8 anymore

Also node 8 is deprecated and there is no further support for it officially

amrsa1 commented 3 years ago

node 8 is not supported for latest ubuntu system, so we cant run stf on latest ubuntu distro anymore

image

koral-- commented 3 years ago

Please continue discussion on https://github.com/DeviceFarmer/stf/issues/37 as this repository will be archived.