Thanks to visit codestin.com
Credit goes to github.com

Skip to content

phpunit bridge broken with composer v2 #37601

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

Closed
GrahamCampbell opened this issue Jul 17, 2020 · 4 comments
Closed

phpunit bridge broken with composer v2 #37601

GrahamCampbell opened this issue Jul 17, 2020 · 4 comments

Comments

@GrahamCampbell
Copy link
Contributor

Symfony version(s) affected: 5.1.2 (for example)

Description
https://github.com/symfony/phpunit-bridge/blob/v5.1.2/bin/simple-phpunit.php#L190 assumes that dev versions with have a count of exactly one version. This is not the case in general (stable versions might have no dev branch and only one tag), and in particular, in composer v2, 9.3.* has two dev versions printed, which means that line 191 is not executed when it was meant to be.

How to reproduce
PHPUNIT_VERSION=9.3

@colinodell
Copy link
Contributor

You can manually run the Composer command that simple-phpunit uses to see what's happening.

Using Composer 1:

$ composer info --no-ansi -a -n phpunit/phpunit "9.3.*" | grep versions
versions : 9.3.x-dev

$ composer info --no-ansi -a -n phpunit/phpunit "9.2.*" | grep versions
versions : 9.2.x-dev, 9.2.6, 9.2.5, 9.2.4, 9.2.3, 9.2.2, 9.2.1, 9.2.0

Using Composer 2:

$ composer info --no-ansi -a -n phpunit/phpunit "9.3.*" | grep versions
versions : dev-master, 9.3.x-dev

$ composer info --no-ansi -a -n phpunit/phpunit "9.2.*" | grep versions
versions : 9.2.x-dev, 9.2.6, 9.2.5, 9.2.4, 9.2.3, 9.2.2, 9.2.1, 9.2.0

Note that Composer 2 shows two dev versions for 9.3.

@GrahamCampbell
Copy link
Contributor Author

I think we just need to filter out dev-* and *-dev names, and see if the count is zero, to determine if -s dev is needed.

@colinodell
Copy link
Contributor

Good idea! I've submitted #37607 with that fix.

@GrahamCampbell
Copy link
Contributor Author

Excellent. 👍

@fabpot fabpot closed this as completed Jul 23, 2020
fabpot added a commit that referenced this issue Jul 23, 2020
This PR was merged into the 3.4 branch.

Discussion
----------

Fix checks for phpunit releases on Composer 2

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #37601
| License       | MIT
| Doc PR        | n/a

`simple-phpunit` has a core assumption that any version of PHPUnit without a stable release will only have one dev version returned by Composer.  Per #37601, it's possible for Composer 2 to list **more than one dev version**.  This breaks that assumption and therefore prevents the installation of 9.3.* ([which is needed for testing on PHP 8](sebastianbergmann/phpunit#4374 (comment))).

The fix implemented here is to remove any versions containing `dev-` or `-dev` from the list of possible versions to see if any stable versions remain.

Commits
-------

2bb3f08 Fix checks for phpunit releases on Composer 2 (resolves #37601)
nicolas-grekas added a commit that referenced this issue Jul 23, 2020
* 3.4:
  [Cache] fix catching auth errors
  Fix CS
  [FrameworkBundle] set default session.handler alias if handler_id is not provided
  Fix CS
  Readability update
  Fix checks for phpunit releases on Composer 2 (resolves #37601)
  [SCA] Minor fixes on tests
nicolas-grekas added a commit that referenced this issue Jul 23, 2020
* 4.4:
  fix merge
  Require PHPUnit 9.3 on PHP 8
  [Cache] fix catching auth errors
  Fix CS
  [FrameworkBundle] set default session.handler alias if handler_id is not provided
  Fix CS
  Readability update
  Fix checks for phpunit releases on Composer 2 (resolves #37601)
  [Serializer] Support multiple levels of discriminator mapping
  Use hexadecimal numerals instead of hexadecimals in strings to represent error codes.
  [SCA] Minor fixes on tests
  [WebProfilerBundle] modified url generation to use absolute urls
  [Mailer] Fix reply-to functionality in the SendgridApiTransport
  [Mime] Fix compat with HTTP requests
  ticket_36879 - Fix mandrill raw http request setting from email/name
nicolas-grekas added a commit that referenced this issue Jul 23, 2020
* 5.0:
  fix merge
  Require PHPUnit 9.3 on PHP 8
  [Cache] fix catching auth errors
  Fix CS
  [FrameworkBundle] set default session.handler alias if handler_id is not provided
  Fix CS
  Readability update
  Fix checks for phpunit releases on Composer 2 (resolves #37601)
  [Serializer] Support multiple levels of discriminator mapping
  Use hexadecimal numerals instead of hexadecimals in strings to represent error codes.
  [SCA] Minor fixes on tests
  [WebProfilerBundle] modified url generation to use absolute urls
  [Mailer] Fix reply-to functionality in the SendgridApiTransport
  [Mime] Fix compat with HTTP requests
  ticket_36879 - Fix mandrill raw http request setting from email/name
nicolas-grekas added a commit that referenced this issue Jul 23, 2020
* 5.1:
  fix merge
  Require PHPUnit 9.3 on PHP 8
  [Cache] fix catching auth errors
  Fix CS
  [FrameworkBundle] set default session.handler alias if handler_id is not provided
  Fix CS
  Readability update
  Removed @internal from Composite
  Fix checks for phpunit releases on Composer 2 (resolves #37601)
  [Messenger] fix ignore account & endpoint options amazon sqs connection
  [Serializer] Support multiple levels of discriminator mapping
  Use hexadecimal numerals instead of hexadecimals in strings to represent error codes.
  [SCA] Minor fixes on tests
  [WebProfilerBundle] modified url generation to use absolute urls
  [Mailer] Fix reply-to functionality in the SendgridApiTransport
  [Mime] Fix compat with HTTP requests
  ticket_36879 - Fix mandrill raw http request setting from email/name
hultberg pushed a commit to hultberg/symfony that referenced this issue Sep 17, 2021
* 4.4:
  fix merge
  Require PHPUnit 9.3 on PHP 8
  [Cache] fix catching auth errors
  Fix CS
  [FrameworkBundle] set default session.handler alias if handler_id is not provided
  Fix CS
  Readability update
  Fix checks for phpunit releases on Composer 2 (resolves symfony#37601)
  [Serializer] Support multiple levels of discriminator mapping
  Use hexadecimal numerals instead of hexadecimals in strings to represent error codes.
  [SCA] Minor fixes on tests
  [WebProfilerBundle] modified url generation to use absolute urls
  [Mailer] Fix reply-to functionality in the SendgridApiTransport
  [Mime] Fix compat with HTTP requests
  ticket_36879 - Fix mandrill raw http request setting from email/name
hultberg pushed a commit to hultberg/symfony that referenced this issue Sep 17, 2021
* 5.0:
  fix merge
  Require PHPUnit 9.3 on PHP 8
  [Cache] fix catching auth errors
  Fix CS
  [FrameworkBundle] set default session.handler alias if handler_id is not provided
  Fix CS
  Readability update
  Fix checks for phpunit releases on Composer 2 (resolves symfony#37601)
  [Serializer] Support multiple levels of discriminator mapping
  Use hexadecimal numerals instead of hexadecimals in strings to represent error codes.
  [SCA] Minor fixes on tests
  [WebProfilerBundle] modified url generation to use absolute urls
  [Mailer] Fix reply-to functionality in the SendgridApiTransport
  [Mime] Fix compat with HTTP requests
  ticket_36879 - Fix mandrill raw http request setting from email/name
hultberg pushed a commit to hultberg/symfony that referenced this issue Sep 17, 2021
* 5.1:
  fix merge
  Require PHPUnit 9.3 on PHP 8
  [Cache] fix catching auth errors
  Fix CS
  [FrameworkBundle] set default session.handler alias if handler_id is not provided
  Fix CS
  Readability update
  Removed @internal from Composite
  Fix checks for phpunit releases on Composer 2 (resolves symfony#37601)
  [Messenger] fix ignore account & endpoint options amazon sqs connection
  [Serializer] Support multiple levels of discriminator mapping
  Use hexadecimal numerals instead of hexadecimals in strings to represent error codes.
  [SCA] Minor fixes on tests
  [WebProfilerBundle] modified url generation to use absolute urls
  [Mailer] Fix reply-to functionality in the SendgridApiTransport
  [Mime] Fix compat with HTTP requests
  ticket_36879 - Fix mandrill raw http request setting from email/name
PhilETaylor pushed a commit to PhilETaylor/symfony that referenced this issue Sep 6, 2023
* 4.4:
  fix merge
  Require PHPUnit 9.3 on PHP 8
  [Cache] fix catching auth errors
  Fix CS
  [FrameworkBundle] set default session.handler alias if handler_id is not provided
  Fix CS
  Readability update
  Fix checks for phpunit releases on Composer 2 (resolves symfony#37601)
  [Serializer] Support multiple levels of discriminator mapping
  Use hexadecimal numerals instead of hexadecimals in strings to represent error codes.
  [SCA] Minor fixes on tests
  [WebProfilerBundle] modified url generation to use absolute urls
  [Mailer] Fix reply-to functionality in the SendgridApiTransport
  [Mime] Fix compat with HTTP requests
  ticket_36879 - Fix mandrill raw http request setting from email/name
PhilETaylor pushed a commit to PhilETaylor/symfony that referenced this issue Sep 6, 2023
* 5.0:
  fix merge
  Require PHPUnit 9.3 on PHP 8
  [Cache] fix catching auth errors
  Fix CS
  [FrameworkBundle] set default session.handler alias if handler_id is not provided
  Fix CS
  Readability update
  Fix checks for phpunit releases on Composer 2 (resolves symfony#37601)
  [Serializer] Support multiple levels of discriminator mapping
  Use hexadecimal numerals instead of hexadecimals in strings to represent error codes.
  [SCA] Minor fixes on tests
  [WebProfilerBundle] modified url generation to use absolute urls
  [Mailer] Fix reply-to functionality in the SendgridApiTransport
  [Mime] Fix compat with HTTP requests
  ticket_36879 - Fix mandrill raw http request setting from email/name
PhilETaylor pushed a commit to PhilETaylor/symfony that referenced this issue Sep 6, 2023
* 5.1:
  fix merge
  Require PHPUnit 9.3 on PHP 8
  [Cache] fix catching auth errors
  Fix CS
  [FrameworkBundle] set default session.handler alias if handler_id is not provided
  Fix CS
  Readability update
  Removed @internal from Composite
  Fix checks for phpunit releases on Composer 2 (resolves symfony#37601)
  [Messenger] fix ignore account & endpoint options amazon sqs connection
  [Serializer] Support multiple levels of discriminator mapping
  Use hexadecimal numerals instead of hexadecimals in strings to represent error codes.
  [SCA] Minor fixes on tests
  [WebProfilerBundle] modified url generation to use absolute urls
  [Mailer] Fix reply-to functionality in the SendgridApiTransport
  [Mime] Fix compat with HTTP requests
  ticket_36879 - Fix mandrill raw http request setting from email/name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants