stf icon indicating copy to clipboard operation
stf copied to clipboard

Update STF to support latest node.js versions

Open skumar1122 opened this issue 5 years ago • 25 comments

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.

skumar1122 avatar Nov 13 '19 10:11 skumar1122

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.

issue-label-bot[bot] avatar Nov 13 '19 10:11 issue-label-bot[bot]

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..

jupe avatar Dec 08 '19 07:12 jupe

Feel free to open a PR.

koral-- avatar Dec 18 '19 00:12 koral--

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

Cookies52 avatar Feb 21 '20 18:02 Cookies52

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 [email protected] 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)

jupe avatar Feb 21 '20 21:02 jupe

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.

Cookies52 avatar Feb 21 '20 21:02 Cookies52

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 avatar Feb 22 '20 05:02 jupe

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

jupe avatar Feb 22 '20 12:02 jupe

Apologies got called in so will do later this evening.

Cookies52 avatar Feb 22 '20 12:02 Cookies52

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.. :)

jupe avatar Feb 22 '20 12:02 jupe

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

Cookies52 avatar Feb 22 '20 12:02 Cookies52

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... :)

jupe avatar Feb 22 '20 13:02 jupe

@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!

Cookies52 avatar Feb 22 '20 18:02 Cookies52

@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 avatar Feb 22 '20 20:02 jupe

@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..

jupe avatar Mar 03 '20 06:03 jupe

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

Cookies52 avatar Mar 23 '20 11:03 Cookies52

Thats great upgrade, looking forward to it

amrsa1 avatar May 02 '20 21:05 amrsa1

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

jupe avatar May 03 '20 06:05 jupe

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

amrsa1 avatar May 03 '20 08:05 amrsa1

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.

nanoscopic avatar May 19 '20 05:05 nanoscopic

any news regarding upgrading to node 12

amrsa1 avatar Jun 07 '20 20:06 amrsa1

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.

nanoscopic avatar Jun 09 '20 23:06 nanoscopic

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 avatar Jun 10 '20 06:06 amrsa1

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

image

amrsa1 avatar Jul 16 '20 08:07 amrsa1

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

koral-- avatar Jul 16 '20 13:07 koral--