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

[Bug] Package from git commit(karma) runs differently #1515

Closed
1 task done
acls opened this issue Jun 24, 2020 · 3 comments
Closed
1 task done

[Bug] Package from git commit(karma) runs differently #1515

acls opened this issue Jun 24, 2020 · 3 comments
Labels
broken-repro The reproduction in this issue is broken bug Something isn't working

Comments

@acls
Copy link

acls commented Jun 24, 2020

  • I'd be willing to implement a fix

Describe the bug

While waiting for the bug fix for my previous issue(#1508) to be merged and published in karma,
I tried adding the git commit that has the bug fix.

yarn add karma@https://github.com/karma-runner/karma.git#commit=90cce1057abaf8f6fbb9b4ec93d1100ca101ab1d --dev --exact

Now when running karma it fails with Error: karma tried to access browserify, but it isn't declared in its dependencies.
When I've had similar errors in the past, adding them to my package.json would fix them.
Adding browserify, just causes others errors.
I've diffed the two karma .zip files in the yarn cache and they appear the same(other than the bug fix, obviously).

To Reproduce

I reused the repo from before to demonstrate the issue.
I also added a sherlock repro.

Reproduction
await yarn('init', '-y');
await yarn('add', 'karma@https://github.com/karma-runner/karma.git#commit=90cce1057abaf8f6fbb9b4ec93d1100ca101ab1d');
const output = await yarn('karma', 'start');
expect(output).not.toContain("Error: karma tried to access browserify, but it isn't declared in its dependencies");

Environment if relevant (please complete the following information):

  • OS: Linux
  • Node version: v10.21.0
  • Yarn version: 2.0.0-rc.36

Issue running sherlock locally

This is more of a heads up, or maybe I was doing it wrong, but
I had to remove the following from .yarnrc.yml in order to run sherlock locally:

changesetIgnorePatterns:
  - "**/*.test.{js,ts}"
@acls acls added the bug Something isn't working label Jun 24, 2020
@yarnbot yarnbot added the broken-repro The reproduction in this issue is broken label Jun 24, 2020
@yarnbot

This comment has been minimized.

@acls acls changed the title [Bug] Package from git commit(karma) run differently from [Bug] Package from git commit(karma) runs differently Jun 24, 2020
@yarnbot
Copy link
Collaborator

yarnbot commented Jun 24, 2020

The reproduction case in your issue seems broken (ie it neither pass nor fail due to throwing an unmanaged exception):

Error: Command failed: /usr/bin/node /github/workspace/scripts/actions/../run-yarn.js add karma@https://github.com/karma-runner/karma.git#commit=90cce1057abaf8f6fbb9b4ec93d1100ca101ab1d

➤ YN0000: ┌ Resolution step
::group::Resolution step
➤ YN0000: │ /tmp/xfs-9b28b7e7 STDOUT Installing the project using npm
➤ YN0000: │ /tmp/xfs-9b28b7e7 STDOUT 
➤ YN0001: │ Error: karma@https://github.com/karma-runner/karma.git#commit=90cce1057abaf8f6fbb9b4ec93d1100ca101ab1d: Repository clone failed: Child "git" exited with exit code 128

fatal: reference is not a tree: 90cce1057abaf8f6fbb9b4ec93d1100ca101ab1d

    at ChildProcess.<anonymous> (/github/workspace/packages/yarnpkg-core/sources/execUtils.ts:157:30)
    at ChildProcess.emit (events.js:315:20)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
::endgroup::
➤ YN0000: └ Completed in 1.76s
➤ YN0000: Failed with errors in 1.77s

    at ChildProcess.exithandler (child_process.js:303:12)
    at ChildProcess.emit (events.js:315:20)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)

Remember: any non-Jest exceptions will cause the test to be reported as broken. If you expect something to pass without throwing, you must wrap it into something like await expect(...).resolves.toBeTruthy(). If you instead expect something to throw, you need to wrap it into await expect(...).rejects.toThrow().

@merceyz
Copy link
Member

merceyz commented Jul 11, 2020

It's because karma isn't built when cloned from github since they don't have a prepack script that runs their build. When yarn clones karma from github it runs npm install && npm pack, but it's never built since they lack a npm lifecycle script that runs their build https://docs.npmjs.com/misc/scripts#description

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
broken-repro The reproduction in this issue is broken bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants