Skip to content

wdio is used in tests only, does not install in some platforms (z/OS) - make it optional#509

Closed
IgorTodorovskiIBM wants to merge 2 commits intouuidjs:masterfrom
ibmruntimes:zos
Closed

wdio is used in tests only, does not install in some platforms (z/OS) - make it optional#509
IgorTodorovskiIBM wants to merge 2 commits intouuidjs:masterfrom
ibmruntimes:zos

Conversation

@IgorTodorovskiIBM
Copy link
Copy Markdown

The wdio node module is not supported on os390, preventing uuid from being installed. Since wdio is used for specific testing purposes only, I made it an optionalDependency. That way, if wdio fails to install, uuid will still be installed successfully.

@ctavan
Copy link
Copy Markdown
Member

ctavan commented Aug 13, 2020

@IgorTodorovskiIBM are you trying to develop uuid on os390? wdio is only listed in the devDependencies, so when using uuid as a regular dependency, npm should never try to install wdio. How are you trying to install uuid on os390?

@ctavan
Copy link
Copy Markdown
Member

ctavan commented Aug 13, 2020

And out of curiosity: Are we really talking about https://en.wikipedia.org/wiki/OS/390? 😲

@IgorTodorovskiIBM
Copy link
Copy Markdown
Author

Yeah, it's z/OS actually. UUID part of CITGM (https://github.com/nodejs/citgm) and we're trying to get the uuid test passing. It clones the repo, does an npm install and then a npm test.

hmm, I see that there's no optionalDevDependencies support.

@ctavan
Copy link
Copy Markdown
Member

ctavan commented Aug 13, 2020

OK. Could you elaborate a bit more on why you need to install it that way and why you need to get the tests passing? I think a bit more context would help us to find a suitable solution.

@IgorTodorovskiIBM
Copy link
Copy Markdown
Author

Sure, we're porting Node.js to z/OS and CITGM is one group of tests that the Node community runs. We're trying to get that to 100%. UUID is listed in the set of tests (https://github.com/nodejs/citgm/blob/master/lib/lookup.json).

CITGM only fetches the uuid source from github and then runs npm install and then runs npm test on the module. Since wdio is not used, we wanted to skip it or make it an optional dependency

@ctavan
Copy link
Copy Markdown
Member

ctavan commented Aug 13, 2020

Got it, thanks! BTW I was not aware of uuid being part of CITGM, learned something today 😉

Unfortunately, putting the wdio dependencies into optionalDependencies is not really an option because that would install them as regular production dependencies.

I guess we'll have to find a different way but I think I'll have to do some research.

@ctavan
Copy link
Copy Markdown
Member

ctavan commented Aug 13, 2020

An ugly workaround that comes to my mind would be to put all wdio dependencies as optionalDependencies into a wrapper package and then reference that wrapper packages in devDependencies of uuid instead. That way their failing installation on z/OS might simply be ignored. Unfortunately that would also increase the maintenance burden for this module quite a bit.

Does anyone have better ideas?

@ctavan
Copy link
Copy Markdown
Member

ctavan commented Aug 13, 2020

@MylesBorins do you maybe have a good idea of how to handle this issue? I can well imagine that uuid might actually be used on s390 so I'd rather not just skip tests for that platform. But we indeed don't need to run any browser tests there, so some way to skip installation @wdio dependencies for that platform would be neat.

@MylesBorins
Copy link
Copy Markdown

@ctavan The wrapper module approach is a reasonable idea... it's basically what chokidar does to make fsevents optional for file watching.

If it would take a bit to work this out we very well can skip this for 390x until it's ready

@ctavan
Copy link
Copy Markdown
Member

ctavan commented Aug 13, 2020

@ctavan The wrapper module approach is a reasonable idea... it's basically what chokidar does to make fsevents optional for file watching.

If it would take a bit to work this out we very well can skip this for 390x until it's ready

Thanks for the quick reply!

@IgorTodorovskiIBM should comment how urgent getting the tests green is for them.

I think I can get the wrapper approach done within a couple of days.

@IgorTodorovskiIBM
Copy link
Copy Markdown
Author

@ctavan The wrapper module approach is a reasonable idea... it's basically what chokidar does to make fsevents optional for file watching.
If it would take a bit to work this out we very well can skip this for 390x until it's ready

Thanks for the quick reply!

@IgorTodorovskiIBM should comment how urgent getting the tests green is for them.

I think I can get the wrapper approach done within a couple of days.

That would be great! It's not urgent

ctavan added a commit that referenced this pull request Aug 14, 2020
WebdriverIO which we use for browser testing cannot be installed on some
platforms like z/OS.

In order to allow "Canary in the Goldmine"
(https://github.com/nodejs/citgm) to be run on such platforms as well we
need to install WebdriverIO as an optional devDependency. Unfortunately
npm doesn't support this out-of-the-box, so we have to wrap the affected
dependencies in a small local wrapper package.

Fixes #509.
ctavan added a commit that referenced this pull request Aug 14, 2020
WebdriverIO which we use for browser testing cannot be installed on some
platforms like z/OS.

In order to allow "Canary in the Goldmine"
(https://github.com/nodejs/citgm) to be run on such platforms as well we
need to install WebdriverIO as an optional devDependency. Unfortunately
npm doesn't support this out-of-the-box, so we have to wrap the affected
dependencies in a small local wrapper package.

Fixes #509.
ctavan added a commit that referenced this pull request Aug 14, 2020
WebdriverIO which we use for browser testing cannot be installed on some
platforms like z/OS.

In order to allow "Canary in the Goldmine"
(https://github.com/nodejs/citgm) to be run on such platforms as well we
need to install WebdriverIO as an optional devDependency. Unfortunately
npm doesn't support this out-of-the-box, so we have to wrap the affected
dependencies in a small local wrapper package.

Fixes #509.
ctavan added a commit that referenced this pull request Aug 14, 2020
WebdriverIO which we use for browser testing cannot be installed on some
platforms like z/OS.

In order to allow "Canary in the Goldmine"
(https://github.com/nodejs/citgm) to be run on such platforms as well we
need to install WebdriverIO as an optional devDependency. Unfortunately
npm doesn't support this out-of-the-box, so we have to wrap the affected
dependencies in a small local wrapper package.

Fixes #509.
ctavan added a commit that referenced this pull request Aug 14, 2020
WebdriverIO which we use for browser testing cannot be installed on some
platforms like z/OS.

In order to allow "Canary in the Goldmine"
(https://github.com/nodejs/citgm) to be run on such platforms as well we
need to install WebdriverIO as an optional devDependency. Unfortunately
npm doesn't support this out-of-the-box, so we have to wrap the affected
dependencies in a small local wrapper package.

Fixes #509.
@ctavan
Copy link
Copy Markdown
Member

ctavan commented Aug 14, 2020

@IgorTodorovskiIBM see #510 for a potential solution.

@IgorTodorovskiIBM
Copy link
Copy Markdown
Author

Thanks, I'll close this PR

ctavan added a commit that referenced this pull request Aug 17, 2020
WebdriverIO which we use for browser testing cannot be installed on some
platforms like z/OS.

In order to allow "Canary in the Goldmine"
(https://github.com/nodejs/citgm) to be run on such platforms as well we
need to install WebdriverIO as an optional devDependency. npm doesn't
support this out-of-the-box but fortunately there is
https://github.com/bcoe/optional-dev-dependency which does precisely
what we need.

Fixes #509
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants