Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1115,9 +1115,10 @@
name: laravel-log-mysql-${{ matrix.shard }}
path: vendor/orchestra/testbench-core/laravel/storage/logs/laravel.log

# Runs on pull requests too, so a feature test cannot pass the PR and fail
# only after merge (#1095). MySQL keeps the coverage-collecting shards.
feature-postgresql:
needs: preflight
if: ${{ github.event_name != 'pull_request' }}
runs-on: ubuntu-latest
timeout-minutes: 20

Expand Down Expand Up @@ -1149,6 +1150,7 @@
persist-credentials: false

- name: Cache Composer packages
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
uses: actions/cache@caa296126883cff596d87d8935842f9db880ef25 # v5
with:
path: vendor
Expand Down Expand Up @@ -1685,7 +1687,7 @@
test "${{ needs.pr-feature-mysql.result }}" = "success"
test "${{ needs.feature-mysql.result }}" = "skipped"
test "${{ needs.feature-mariadb.result }}" = "skipped"
test "${{ needs.feature-postgresql.result }}" = "skipped"
test "${{ needs.feature-postgresql.result }}" = "success"

Check warning on line 1690 in .github/workflows/php.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of using the literal 'success' 7 times.

See more on https://sonarcloud.io/project/issues?id=durable-workflow_workflow&issues=AaHNBtYd-DSAMddoZ_nv&open=AaHNBtYd-DSAMddoZ_nv&pullRequest=1098
test "${{ needs.coverage-unit.result }}" = "skipped"
test "${{ needs.coverage.result }}" = "skipped"
test "${{ needs.laravel-embedded-upgrade-source.result }}" = "skipped"
Expand Down
9 changes: 8 additions & 1 deletion scripts/ci/test-build-routing.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,6 @@ def test_target_branch_jobs_skip_pull_requests(self) -> None:
for job in (
"feature-mysql",
"feature-mariadb",
"feature-postgresql",
"coverage-unit",
"coverage",
):
Expand Down Expand Up @@ -444,6 +443,14 @@ def test_pull_requests_run_the_same_unit_suite_as_coverage_unit(self) -> None:
self.assertIn('test "${{ needs.pr-unit.result }}" = "success"', gate)
self.assertIn('test "${{ needs.pr-unit.result }}" = "skipped"', gate)

def test_pull_requests_run_the_postgresql_feature_suite(self) -> None:
source = self.job_source("feature-postgresql")
self.assertNotIn(" if: ${{ github.event_name != 'pull_request' }}\n", source)
self.assertIn("feature-postgresql", workflow_job_needs(self.build, "build"))
gate = self.job_source("build")
self.assertIn('test "${{ needs.feature-postgresql.result }}" = "success"', gate)
self.assertNotIn('test "${{ needs.feature-postgresql.result }}" = "skipped"', gate)

def test_combined_coverage_waits_for_both_producers_and_requires_every_report(self) -> None:
self.assertEqual(
{"preflight", "feature-mysql", "coverage-unit"},
Expand Down
8 changes: 5 additions & 3 deletions scripts/ci/verify-feature-shards.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,15 @@
$expectedMatrix = implode(', ', range(0, FEATURE_SHARDS - 1));
$requirements = [
'repository preflight dependency' => 'needs: preflight',
'target-branch routing' => "github.event_name != 'pull_request'",
'complete shard matrix' => "shard: [{$expectedMatrix}]",
'splitter shard count' => '--shards=' . FEATURE_SHARDS,
'weight profile' => "--weight-profile={$profile}",
];

// MySQL collects coverage on main only. PostgreSQL also runs on pull
// requests, so a feature test cannot pass a PR and fail only after
// merge (#1095).
if ($profile === 'mysql') {
$requirements['target-branch routing'] = "github.event_name != 'pull_request'";

Check failure on line 105 in scripts/ci/verify-feature-shards.php

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of duplicating this literal "github.event_name != 'pull_request'" 4 times.

See more on https://sonarcloud.io/project/issues?id=durable-workflow_workflow&issues=AaHNBtNq-DSAMddoZ_nu&open=AaHNBtNq-DSAMddoZ_nu&pullRequest=1098
$requirements['PCOV coverage driver'] = 'coverage: pcov';
$requirements['per-shard Clover report'] = '--coverage-clover "build/test-results/mysql-shard-${{ matrix.shard }}-coverage.xml"';
}
Expand All @@ -121,7 +123,7 @@
'pr-tracing' => [PULL_REQUEST_CONDITION],
'pr-feature-mysql' => [PULL_REQUEST_CONDITION],
'feature-mysql' => ["github.event_name != 'pull_request'"],
'feature-postgresql' => ["github.event_name != 'pull_request'"],
'feature-postgresql' => [],
'feature-mariadb' => ["github.event_name != 'pull_request'"],
'coverage' => ["github.event_name != 'pull_request'"],
];
Expand Down
Loading