Skip to content

Execute phpunit with locked version only on the minimum supported PHP version of a project #35

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

Conversation

boesing
Copy link
Member

@boesing boesing commented Aug 6, 2021

Q A
Documentation no
BC Break yes
New Feature yes

Description

As discussed in the latest TSC meeting on 2021-08-02, this changes the way on how PHP unit tests are being executed.

locked dependencies are used for PHPUnit with the minimum supported PHP version of a package.
This also changes the way QA checks are being executed. All QA checks are now executed on the minimum supported PHP version of a project as well.

Copy link
Member

@weierophinney weierophinney left a comment

Choose a reason for hiding this comment

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

Looks reasonable; main concern is that you're actually getting the minimum version, and not a random one.

@boesing
Copy link
Member Author

boesing commented Aug 10, 2021

I did some checks and it absolutely works:

→ cat composer.json 
{
    "require": {
        "php": "~8.0.0 || ^7.4"
    }
}

→ node index.js | grep "Using minimum"
Using minimum PHP version: 7.4
→ cat composer.json 
{
    "require": {
        "php": "^5.6 || 7.3 || ^8.0"
    }
}

→ node index.js | grep "Using minimum"
Using minimum PHP version: 5.6
→ cat composer.json 
{
    "require": {
        "php": "^5.3 || ^7.0 || ^8.0"
    }
}

→ node index.js | grep "Using minimum"
Using minimum PHP version: 5.6

It is as of now: yes, a project may state to support PHP <5.6 but CI will only run ^5.6 as we do not have other versions installed tho.

@boesing boesing force-pushed the feature/phpunit-changes-as-discussed-by-tsc branch from 3b36502 to d0e48a4 Compare August 10, 2021 18:49
@boesing boesing requested a review from weierophinney August 10, 2021 18:49
Copy link
Member

@weierophinney weierophinney left a comment

Choose a reason for hiding this comment

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

🚢

@weierophinney weierophinney added this to the 1.8.0 milestone Aug 11, 2021
@weierophinney
Copy link
Member

Removed the BC break label; it's a change to the generated matrix, but it's an improvement, as it provides better clarity for which version the lockfile should target, as well as reduces the number of jobs necessary to accomplish the same goal (determine if a new failure is due to adopting new features not supported in a minimum version of a requirement, or due to a BC breaking change in a later version of the requirement).

@weierophinney weierophinney merged commit 3c614f4 into laminas:1.8.x Aug 11, 2021
@boesing boesing deleted the feature/phpunit-changes-as-discussed-by-tsc branch August 11, 2021 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants