Skip to content

refactor: prepend Autoloader's own autoload functions#10092

Open
paulbalandan wants to merge 2 commits intocodeigniter4:developfrom
paulbalandan:prepend-autoloader
Open

refactor: prepend Autoloader's own autoload functions#10092
paulbalandan wants to merge 2 commits intocodeigniter4:developfrom
paulbalandan:prepend-autoloader

Conversation

@paulbalandan
Copy link
Copy Markdown
Member

Description
Random tests fail haphazardly with cannot autoload CodeIgniter\CodeIgniter.

From this failing test details for DataCaster, it looks to me that composer's autoloader are in effect here.

Details

> vendor/bin/phpunit tests/system/DataCaster --colors=never --no-coverage --order-by=random --random-order-seed=1775670338

PHPUnit 11.5.55 by Sebastian Bergmann and contributors.

Runtime: PHP 8.5.4
Configuration: /home/runner/work/CodeIgniter4/CodeIgniter4/phpunit.xml.dist
Random Seed: 1775670338

E 1 / 1 (100%)

Time: 00:00.011, Memory: 12.00 MB

There was 1 error:

  1. CodeIgniter\DataCaster\DataCasterTest::testCastInvalidMethodException
    ErrorException: include(/home/runner/work/CodeIgniter4/CodeIgniter4/vendor/composer/../../system/CodeIgniter.php): Failed to open stream: No such file or directory

/home/runner/work/CodeIgniter4/CodeIgniter4/system/Test/Mock/MockCodeIgniter.php:18
/home/runner/work/CodeIgniter4/CodeIgniter4/system/Test/CIUnitTestCase.php:519
/home/runner/work/CodeIgniter4/CodeIgniter4/system/Test/CIUnitTestCase.php:245

ERRORS!
Tests: 1, Assertions: 0, Errors: 1.

Execution order file: /home/runner/work/CodeIgniter4/CodeIgniter4/build/random-tests/random_test_order_176_DataCaster.txt
Failed test: CodeIgniter\DataCaster\DataCasterTest::testCastInvalidMethodException
Previous test: (none - failed test ran first)

Exit code: 1
Elapsed time: 176

I temporarily upped the run limit of random tests to 50 to see if there are still flaky tests.

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value (without duplication)
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@github-actions github-actions bot added the github_actions Pull requests that update Github_actions code label Apr 8, 2026
@michalsn
Copy link
Copy Markdown
Member

michalsn commented Apr 8, 2026

I was trying to dig into this "No such file or directory" problem, but without any luck.

@paulbalandan paulbalandan force-pushed the prepend-autoloader branch 5 times, most recently from 5ce5e65 to 802a45b Compare April 9, 2026 09:30
@paulbalandan paulbalandan added the refactor Pull requests that refactor code label Apr 9, 2026
@paulbalandan paulbalandan force-pushed the prepend-autoloader branch 3 times, most recently from f9a27d6 to bc74b38 Compare April 9, 2026 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github_actions Pull requests that update Github_actions code refactor Pull requests that refactor code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants