Follow-up to #3547124: Remove system module from kernel tests that don't need it → and 📌 Remove user module from kernel tests that don't need it Needs review .
There are various other modules used in kernel tests that are not required. Some of these are because they are already required by the parent class, but others are genuinely not required.
Run this bash script, might take a couple hours to complete. Then review git diff 11.x to see what can be removed and still have passing tests.
#!/bin/bash
for MODULE in core/modules/*; do
MODULE_NAME=$(basename "$MODULE")
while IFS= read -r FILE; do
if grep -q "^ '$MODULE_NAME',\$" "$FILE"; then
sed -i "/^ '$MODULE_NAME',\$/d" "$FILE"
if ! ./vendor/bin/phpunit --stop-on-error --stop-on-fail -c core/phpunit.xml.dist "$FILE" >/dev/null 2>&1; then
git checkout -- "$FILE"
fi
fi
done < <(find core/ -type f -name '*Test.php' | grep -E '/Kernel(/|Tests/)')
done
It was suggested we could split this in to tests that can have modules removed because they are already installed in a parent class, and tests that don't need the modules installed at all, but since this is a simple bash script there is not enough context to figure that out.
N/A
N/A
N/A
N/A
N/A
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
No activities found.