Skip to content

Commit eeb9ac2

Browse files
authored
fix(workflows): exclude abstract test base classes from Mage-OS suite (#373)
PHPUnit 12 treats discovered Abstract*Test.php files as runner warnings, which the integration job interprets as exit code 1 even when all concrete tests pass. Generate <exclude> entries for any Abstract*Test.php inside the included shards. Also fix unescaped backticks in the trailing echo so bash no longer logs "integrationIgnore: command not found".
1 parent 6cacbc6 commit eeb9ac2

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

.github/workflows/full-integration-tests.yaml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,22 @@ jobs:
235235
esac
236236
done
237237
echo " <exclude>testsuite/Magento/IntegrationTest.php</exclude>"
238+
# PHPUnit 12 treats abstract test classes discovered via <directory> as runner
239+
# warnings (exit 1). Exclude any Abstract*Test.php files inside the included
240+
# shards so only concrete tests load.
241+
IFS=','
242+
for dir in $DIRS; do
243+
dir="${dir#"${dir%%[![:space:]]*}"}"
244+
dir="${dir%"${dir##*[![:space:]]}"}"
245+
case "$dir" in
246+
*.php) continue ;;
247+
esac
248+
if [ -d "$dir" ]; then
249+
find "$dir" -type f -name 'Abstract*Test.php' -print | while read -r abs_test; do
250+
echo " <exclude>$abs_test</exclude>"
251+
done
252+
fi
253+
done
238254
echo "</testsuite>"
239255
)
240256
echo "Debug: $NEW_TESTSUITE_ENTRY"
@@ -243,7 +259,7 @@ jobs:
243259
244260
## TODO: I want to have a possibility to NOT ignore those test if I wish to - by adding additional input to github actions, for example
245261
sed -i '/<testsuites>/i\<groups>\<exclude>\<group>integrationIgnore<\/group><\/exclude><\/groups>' "$FILE"
246-
echo "\nIgnore group `integrationIgnore` has been added to $FILE \n"
262+
echo "\nIgnore group 'integrationIgnore' has been added to $FILE \n"
247263
248264
cat $FILE;
249265

0 commit comments

Comments
 (0)