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

kotlin test fails when Java is not configured or installed. #2603

Closed
sainthkh opened this issue Jan 31, 2019 · 10 comments
Closed

kotlin test fails when Java is not configured or installed. #2603

sainthkh opened this issue Jan 31, 2019 · 10 comments
Labels
🐛 Bug Stale Inactive issues

Comments

@sainthkh
Copy link
Contributor

🐛 bug report

It's really rare for developers' machine to not have Java. But sometimes it happens. (And actually, mine was one of that rare one.)

Note: It's the issue for #2590. I'm writing it here because I messed that PR up and started again from scratch.

I'll publish new PR soon.

🎛 Configuration (.babelrc, package.json, cli command)

None

🤔 Expected Behavior

Tests pass without any problem.

😯 Current Behavior

Tests fail and show

 1) resolver
       "before all" hook:
     Error: EPERM: operation not permitted, symlink 'D:\parcel\packages\core\parcel-bundler\test\input\resolver\packages\source' -> 'D:\parcel\packages\core\parcel-bundler\test\input\resolver\node_modules\source'
      at symlinkSync (fs.js:905:3)
      at Context.<anonymous> (test\resolver.js:18:5)
      at process._tickCallback (internal/process/next_tick.js:68:7)

💁 Possible Solution

Install Java. Or add the java.exe path to environment variables.

🔦 Context

I wanted to contribute to Parcel. So, I forked and cloned the repo and ran test. But it failed. I think showing a message like rust is a better solution.

💻 Code Sample

None.

🌍 Your Environment

Software Version(s)
Parcel 1.11.0
Node 10.15.0
npm/Yarn 1.12.3
Operating System Windows 10 Pro 1803
sainthkh added a commit to sainthkh/parcel that referenced this issue Jan 31, 2019
DeMoorJasper pushed a commit that referenced this issue Feb 3, 2019
#2605)

* Ignore Kotlin tests and show messages when Java is not installed or configured. (#2603)

* Skip symlink tests and show warning message when tests are run without admin privilege. (#2602)

* Moved parcel-bundler/test/utils.js and integration-tests/test/utils.js into test-utils/src/utils.js. (#2604)

* Fixed eslint errors.

* Use the test to assert this.child.killed rather than checking time difference. (#2609) (#2612)
@outofambit
Copy link

outofambit commented Feb 11, 2019

Hi! I just encountered this error on a fresh clone of the repo, on the master branch (01174eb). Is this considered fixed or still in-progress? Is a documentation change might be needed, too?

Node: 11.9.0
Yarn: 1.13.0
OS: Mac OS 10.14.3

(edited to include version numbers)

@sainthkh
Copy link
Contributor Author

@DeMoorJasper It seems that recent master merge regresses some test cases.

@DeMoorJasper
Copy link
Member

DeMoorJasper commented Feb 11, 2019

@sainthkh I’ll have a look at the merge history in a couple hours

@DeMoorJasper
Copy link
Member

@sainthkh Seems like the tests on master are fairly stable?

@sainthkh
Copy link
Contributor Author

Then, I'll check it and open a new PR.

@sainthkh
Copy link
Contributor Author

@outofambit

I ran tests and there was no problem with kotlin. Can you give us some error messages?

@outofambit
Copy link

@sainthkh after installing java on my machine, there were no kotlin or java related errors. I tried uninstalling java and running the tests again but wasn't able to reproduce my error. I wonder if only appears if the machine has never had java installed? (That was my case.) Unfortunately I didn't keep the logs of those failures, but one symptom was I would get a Mac OS popup prompting me to install java when I ran the tests.

@sainthkh
Copy link
Contributor Author

Then, we need to wait until someone else has the same problem.

@samuelgozi
Copy link

I'm having the same issue, but im also working on a PR regarding posthtml, so ignore the errors coming from there.

Here are the errors I get:

@parcel/integration-tests:        should support transforming HTML with posthtml:
@parcel/integration-tests:      TypeError: plugin is not a function
@parcel/integration-tests:       at /Users/myusername/Documents/GitHub/parcel/node_modules/posthtml/lib/index.js:190:14
@parcel/integration-tests:       at tryCatch (/Users/myusername/Documents/GitHub/parcel/node_modules/posthtml/lib/index.js:273:12)
@parcel/integration-tests:       at PostHTML.<anonymous> (/Users/myusername/Documents/GitHub/parcel/node_modules/posthtml/lib/index.js:189:15)
@parcel/integration-tests:       at /Users/myusername/Documents/GitHub/parcel/node_modules/posthtml/lib/index.js:210:5
@parcel/integration-tests:       at new Promise (<anonymous>)
@parcel/integration-tests:       at PostHTML.process (/Users/myusername/Documents/GitHub/parcel/node_modules/posthtml/lib/index.js:209:10)
@parcel/integration-tests:       at Object.transform (/Users/myusername/Documents/GitHub/parcel/packages/core/parcel-bundler/src/transforms/posthtml.js:20:44)
@parcel/integration-tests:       at async HTMLAsset.pretransform (/Users/myusername/Documents/GitHub/parcel/packages/core/parcel-bundler/src/assets/HTMLAsset.js:202:5)
@parcel/integration-tests:       at async HTMLAsset.process (/Users/myusername/Documents/GitHub/parcel/packages/core/parcel-bundler/src/Asset.js:214:7)
@parcel/integration-tests:       at async Pipeline.processAsset (/Users/myusername/Documents/GitHub/parcel/packages/core/parcel-bundler/src/Pipeline.js:46:7)
@parcel/integration-tests:       at async Pipeline.process (/Users/myusername/Documents/GitHub/parcel/packages/core/parcel-bundler/src/Pipeline.js:24:23)
@parcel/integration-tests:       at async Object.run (/Users/myusername/Documents/GitHub/parcel/packages/core/parcel-bundler/src/worker.js:15:12)
@parcel/integration-tests:       at async Bundler.loadAsset (/Users/myusername/Documents/GitHub/parcel/packages/core/parcel-bundler/src/Bundler.js:577:19)
@parcel/integration-tests:       at async Bundler.processAsset (/Users/myusername/Documents/GitHub/parcel/packages/core/parcel-bundler/src/Bundler.js:557:5)
@parcel/integration-tests:       at async PromiseQueue._runJob (/Users/myusername/Documents/GitHub/parcel/packages/core/parcel-bundler/src/utils/PromiseQueue.js:48:7)
@parcel/integration-tests:   2) html
@parcel/integration-tests:        should add dependencies referenced by plugins:
@parcel/integration-tests:      TypeError: plugin is not a function
@parcel/integration-tests:       at /Users/myusername/Documents/GitHub/parcel/node_modules/posthtml/lib/index.js:190:14
@parcel/integration-tests:       at tryCatch (/Users/myusername/Documents/GitHub/parcel/node_modules/posthtml/lib/index.js:273:12)
@parcel/integration-tests:       at PostHTML.<anonymous> (/Users/myusername/Documents/GitHub/parcel/node_modules/posthtml/lib/index.js:189:15)
@parcel/integration-tests:       at /Users/myusername/Documents/GitHub/parcel/node_modules/posthtml/lib/index.js:210:5
@parcel/integration-tests:       at new Promise (<anonymous>)
@parcel/integration-tests:       at PostHTML.process (/Users/myusername/Documents/GitHub/parcel/node_modules/posthtml/lib/index.js:209:10)
@parcel/integration-tests:       at Object.transform (/Users/myusername/Documents/GitHub/parcel/packages/core/parcel-bundler/src/transforms/posthtml.js:20:44)
@parcel/integration-tests:       at async HTMLAsset.pretransform (/Users/myusername/Documents/GitHub/parcel/packages/core/parcel-bundler/src/assets/HTMLAsset.js:202:5)
@parcel/integration-tests:       at async HTMLAsset.process (/Users/myusername/Documents/GitHub/parcel/packages/core/parcel-bundler/src/Asset.js:214:7)
@parcel/integration-tests:       at async Pipeline.processAsset (/Users/myusername/Documents/GitHub/parcel/packages/core/parcel-bundler/src/Pipeline.js:46:7)
@parcel/integration-tests:       at async Pipeline.process (/Users/myusername/Documents/GitHub/parcel/packages/core/parcel-bundler/src/Pipeline.js:24:23)
@parcel/integration-tests:       at async Object.run (/Users/myusername/Documents/GitHub/parcel/packages/core/parcel-bundler/src/worker.js:15:12)
@parcel/integration-tests:       at async Bundler.loadAsset (/Users/myusername/Documents/GitHub/parcel/packages/core/parcel-bundler/src/Bundler.js:577:19)
@parcel/integration-tests:       at async Bundler.processAsset (/Users/myusername/Documents/GitHub/parcel/packages/core/parcel-bundler/src/Bundler.js:557:5)
@parcel/integration-tests:       at async PromiseQueue._runJob (/Users/myusername/Documents/GitHub/parcel/packages/core/parcel-bundler/src/utils/PromiseQueue.js:48:7)
@parcel/integration-tests:   3) javascript
@parcel/integration-tests:        should auto install babel plugins:
@parcel/integration-tests:      Error: Cannot find module '@babel/plugin-proposal-class-properties' from '/Users/myusername/Documents/GitHub/parcel/packages/core/integration-tests/test/integration/babel-plugin-autoinstall'
@parcel/integration-tests:       at Function.module.exports [as sync] (test/integration/babel-plugin-autoinstall/node_modules/resolve/lib/sync.js:71:15)
@parcel/integration-tests:       at resolveStandardizedName (test/integration/babel-plugin-autoinstall/node_modules/@babel/core/lib/config/files/plugins.js:101:31)
@parcel/integration-tests:       at resolvePlugin (test/integration/babel-plugin-autoinstall/node_modules/@babel/core/lib/config/files/plugins.js:54:10)
@parcel/integration-tests:       at loadPlugin (test/integration/babel-plugin-autoinstall/node_modules/@babel/core/lib/config/files/plugins.js:62:20)
@parcel/integration-tests:       at createDescriptor (test/integration/babel-plugin-autoinstall/node_modules/@babel/core/lib/config/config-descriptors.js:154:9)
@parcel/integration-tests:       at /Users/myusername/Documents/GitHub/parcel/packages/core/integration-tests/test/integration/babel-plugin-autoinstall/node_modules/@babel/core/lib/config/config-descriptors.js:109:50
@parcel/integration-tests:       at Array.map (<anonymous>:null:null)
@parcel/integration-tests:       at createDescriptors (test/integration/babel-plugin-autoinstall/node_modules/@babel/core/lib/config/config-descriptors.js:109:29)
@parcel/integration-tests:       at createPluginDescriptors (test/integration/babel-plugin-autoinstall/node_modules/@babel/core/lib/config/config-descriptors.js:105:10)
@parcel/integration-tests:       at /Users/myusername/Documents/GitHub/parcel/packages/core/integration-tests/test/integration/babel-plugin-autoinstall/node_modules/@babel/core/lib/config/config-descriptors.js:63:49
@parcel/integration-tests:       at cachedFunction (test/integration/babel-plugin-autoinstall/node_modules/@babel/core/lib/config/caching.js:33:19)
@parcel/integration-tests:       at plugins (test/integration/babel-plugin-autoinstall/node_modules/@babel/core/lib/config/config-descriptors.js:28:77)
@parcel/integration-tests:       at mergeChainOpts (test/integration/babel-plugin-autoinstall/node_modules/@babel/core/lib/config/config-chain.js:319:26)
@parcel/integration-tests:       at /Users/myusername/Documents/GitHub/parcel/packages/core/integration-tests/test/integration/babel-plugin-autoinstall/node_modules/@babel/core/lib/config/config-chain.js:283:7
@parcel/integration-tests:       at buildRootChain (test/integration/babel-plugin-autoinstall/node_modules/@babel/core/lib/config/config-chain.js:68:29)
@parcel/integration-tests:       at loadPrivatePartialConfig (test/integration/babel-plugin-autoinstall/node_modules/@babel/core/lib/config/partial.js:85:55)
@parcel/integration-tests:       at loadFullConfig (test/integration/babel-plugin-autoinstall/node_modules/@babel/core/lib/config/full.js:43:39)
@parcel/integration-tests:       at Object.transformSync (test/integration/babel-plugin-autoinstall/node_modules/@babel/core/lib/transform.js:41:38)
@parcel/integration-tests:       at babel7 (/Users/myusername/Documents/GitHub/parcel/packages/core/parcel-bundler/src/transforms/babel/babel7.js:31:17)
@parcel/integration-tests:       at babelTransform (/Users/myusername/Documents/GitHub/parcel/packages/core/parcel-bundler/src/transforms/babel/transform.js:13:5)
@parcel/integration-tests:       at JSAsset.pretransform (/Users/myusername/Documents/GitHub/parcel/packages/core/parcel-bundler/src/assets/JSAsset.js:83:5)
@parcel/integration-tests:       at JSAsset.process (/Users/myusername/Documents/GitHub/parcel/packages/core/parcel-bundler/src/Asset.js:214:7)
@parcel/integration-tests:       at Pipeline.processAsset (/Users/myusername/Documents/GitHub/parcel/packages/core/parcel-bundler/src/Pipeline.js:46:7)
@parcel/integration-tests:       at Pipeline.process (/Users/myusername/Documents/GitHub/parcel/packages/core/parcel-bundler/src/Pipeline.js:24:23)
@parcel/integration-tests:       at Object.run (/Users/myusername/Documents/GitHub/parcel/packages/core/parcel-bundler/src/worker.js:15:12)
@parcel/integration-tests:       at Bundler.loadAsset (/Users/myusername/Documents/GitHub/parcel/packages/core/parcel-bundler/src/Bundler.js:577:19)
@parcel/integration-tests:       at Bundler.processAsset (/Users/myusername/Documents/GitHub/parcel/packages/core/parcel-bundler/src/Bundler.js:557:5)
@parcel/integration-tests:       at PromiseQueue._runJob (/Users/myusername/Documents/GitHub/parcel/packages/core/parcel-bundler/src/utils/PromiseQueue.js:48:7)
@parcel/integration-tests:
@parcel/integration-tests:   4) javascript
@parcel/integration-tests:        should support optional dependencies in try...catch blocks:
@parcel/integration-tests:       Expected values to be loosely deep-equal:
@parcel/integration-tests: Error: Cannot find module 'optional-dep'
@parcel/integration-tests:     at newRequire (evalmachine.<anonymous>:37:19)
@parcel/integration-tests:     at localRequire (evalmachine.<anonymous>:53:14)
@parcel/integration-tests:     at Object.parcelRequire.index.js (evalmachine.<anonymous>:122:3)
@parcel/integration-tests:     at newRequire (evalmachine.<anonymous>:47:24)
@parcel/integration-tests:     at evalmachine.<anonymous>:81:7
@parcel/integration-tests:     at evalmachine.<anonymous>:120:3
@parcel/integration-tests:     at Script.runInContext (vm.js:134:20)
@parcel/integration-tests:     at Object.runInContext (vm.js:297:6)
@parcel/integration-tests:     at run (/Users/myusername/Documents/GitHub/parcel/packages/core/test-utils/src/utils.js...
@parcel/integration-tests: should loosely deep-equal
@parcel/integration-tests: Error: Cannot find module "optional-dep"
@parcel/integration-tests:     at Context.<anonymous> (/Users/myusername/Documents/GitHub/parcel/packages/core/integration-tests/test/javascript.js:1551:15)
@parcel/integration-tests:  {
@parcel/integration-tests:   code: 'MODULE_NOT_FOUND'
@parcel/integration-tests: }
@parcel/integration-tests:       + expected - actual
@parcel/integration-tests:   AssertionError [ERR_ASSERTION] [ERR_ASSERTION]: Expected values to be loosely deep-equal:
@parcel/integration-tests:
@parcel/integration-tests:   Error: Cannot find module 'optional-dep'
@parcel/integration-tests:       at newRequire (evalmachine.<anonymous>:37:19)
@parcel/integration-tests:       at localRequire (evalmachine.<anonymous>:53:14)
@parcel/integration-tests:       at Object.parcelRequire.index.js (evalmachine.<anonymous>:122:3)
@parcel/integration-tests:       at newRequire (evalmachine.<anonymous>:47:24)
@parcel/integration-tests:       at evalmachine.<anonymous>:81:7
@parcel/integration-tests:       at evalmachine.<anonymous>:120:3
@parcel/integration-tests:       at Script.runInContext (vm.js:134:20)
@parcel/integration-tests:       at Object.runInContext (vm.js:297:6)
@parcel/integration-tests:       at run (/Users/myusername/Documents/GitHub/parcel/packages/core/test-utils/src/utils.js...
@parcel/integration-tests:
@parcel/integration-tests:   should loosely deep-equal
@parcel/integration-tests:
@parcel/integration-tests:   Error: Cannot find module "optional-dep"
@parcel/integration-tests:       at Context.<anonymous> (test/javascript.js:1551:15)
@parcel/integration-tests:    {
@parcel/integration-tests:     code: 'MODULE_NOT_FOUND'
@parcel/integration-tests:   }
@parcel/integration-tests:       at Context.<anonymous> (test/javascript.js:1554:12)
@parcel/integration-tests:
@parcel/integration-tests:   5) kotlin
@parcel/integration-tests:        should produce a basic kotlin bundle:
@parcel/integration-tests:      No Java runtime present, requesting install.
@parcel/integration-tests:
@parcel/integration-tests: npm ERR! code ELIFECYCLE
@parcel/integration-tests: npm ERR! errno 5
@parcel/integration-tests: npm ERR! @parcel/[email protected] test: `cross-env NODE_ENV=test mocha`
@parcel/integration-tests: npm ERR! Exit status 5
@parcel/integration-tests: npm ERR!
@parcel/integration-tests: npm ERR! Failed at the @parcel/[email protected] test script.
@parcel/integration-tests: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
@parcel/integration-tests: npm ERR! A complete log of this run can be found in:
@parcel/integration-tests: npm ERR!     /Users/myusername/.npm/_logs/2019-07-27T19_54_45_394Z-debug.log
lerna ERR! npm run test exited 5 in '@parcel/integration-tests'
error Command failed with exit code 5.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs.

@github-actions github-actions bot added the Stale Inactive issues label Jan 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Stale Inactive issues
Projects
None yet
Development

No branches or pull requests

4 participants