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

Add a failing test for version conflicts #3779

Merged
merged 1 commit into from
Jul 3, 2017

Conversation

magicmark
Copy link
Contributor

@magicmark magicmark commented Jun 30, 2017

Summary
This is a failing test to highlight the issue the issue here #3780 https://github.com/mxmul/yarn_flat_regression

tl;dr:

a => b => left-pad@>=0.0.1
a => left-pad@1.0.0

yarn fails when doing --flat with the following:

info Unable to find a suitable version for "left-pad", please choose one by typing one of the numbers below:
  1) "left-pad@>=0.0.1" which resolved to "1.1.3"
  2) "left-pad@1.0.0" which resolved to "1.0.0"

(yarn version: 0.27.1)

(this seems to be a regression introduced in 0.27.0, this worked in 0.26.1)

Test plan
This is a test only change.


This test is currently failing because it's prompting for a resolution, with the following stacktrace

(node:23637) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 2)
 FAIL  __tests__/commands/install/integration.js (264.799s)
  ● unbound transitive dependencies should not conflict with top level dependency

    Error: Can't answer a question unless a user TTY
      
      at ConsoleReporter.select (src/reporters/console/console-reporter.js:322:29)
      at src/cli/commands/install.js:932:182
      at next (native)
      at step (node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
      at node_modules/babel-runtime/helpers/asyncToGenerator.js:35:14
      at Promise.F (node_modules/core-js/library/modules/_export.js:35:28)
      at node_modules/babel-runtime/helpers/asyncToGenerator.js:14:12
      at Install.flatten (src/cli/commands/install.js:933:2215)
      at src/cli/commands/install.js:922:3570
      at next (native)
      Console output:
       warning package.json: No license field
      warning No license field
      [1/4] Resolving packages...
      
      at __tests__/commands/_helpers.js:144:13
      at throw (native)
      at step (node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
      at node_modules/babel-runtime/helpers/asyncToGenerator.js:30:13

{
"version": "0.0.1",
"dependencies": {
"left-pad": ">=0.0.1"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you mean 1.0.1?

@magicmark
Copy link
Contributor Author

Don't think so

I think >=0.0.1 and 1.0.0 should not conflict?

This test shows that they do conflict.

(looks like >=0.0.1 resolves to a hard pin for whatever the latest version is?)

This behaviour was not present prior to 0.27.0

@bestander
Copy link
Member

I see, thanks.
This is related to this task in general then #3778.
Let's make it passing for now and link that it should be reversed when #3778 is resolved.

Do you want to have a go at implementing the post processing after resolution?

@magicmark
Copy link
Contributor Author

@bestander Skipped the test, added comment linking to issue.

I'll have a go at #3778 :)

@bestander
Copy link
Member

bestander commented Jul 2, 2017 via email

@bestander bestander merged commit d709c2f into yarnpkg:master Jul 3, 2017
@bestander
Copy link
Member

Merged this, ping me on a fix :)

@magicmark magicmark deleted the add_test_for_conflicts branch July 3, 2017 17:28
BYK pushed a commit that referenced this pull request Sep 22, 2017
…el dependency (#4488)

**Summary**

Fixes #3780, and makes the failing test from #3779 passing.

As a final step of package resolution, for each dependency we check whether any version satisfies all resolved version ranges. 

**Test plan**

Fixes an existing (failing) test: "unbound transitive dependencies should not conflict with top level dependency"
joaolucasl pushed a commit to joaolucasl/yarn that referenced this pull request Oct 27, 2017
…el dependency (yarnpkg#4488)

**Summary**

Fixes yarnpkg#3780, and makes the failing test from yarnpkg#3779 passing.

As a final step of package resolution, for each dependency we check whether any version satisfies all resolved version ranges. 

**Test plan**

Fixes an existing (failing) test: "unbound transitive dependencies should not conflict with top level dependency"
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.

2 participants