Skip to content
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

chore: fix Upload coverage results to Coveralls / coveralls #7956

Merged
merged 1 commit into from
Sep 22, 2023

Conversation

kenjis
Copy link
Member

@kenjis kenjis commented Sep 20, 2023

Description
Fixes #7941

Fixes the following error:

PHP Fatal error: Uncaught Error: Class "Config\Autoload" not found in /home/runner/work/CodeIgniter4/CodeIgniter4/system/Test/Mock/MockAutoload.php:16

Checklist:

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

@kenjis kenjis marked this pull request as draft September 20, 2023 21:18
@kenjis kenjis added the github_actions Pull requests that update Github_actions code label Sep 20, 2023
@kenjis
Copy link
Member Author

kenjis commented Sep 20, 2023

Coverage report generated!

Run jq '.autoload."psr-4" += {"Config\\": "app/Config/"}' composer.json > temp.json && mv temp.json composer.json
  jq '.autoload."psr-4" += {"Config\\": "app/Config/"}' composer.json > temp.json && mv temp.json composer.json
  composer dump-autoload
  vendor/bin/phpcov merge --clover build/logs/clover.xml build/cov
  shell: /usr/bin/bash -e {0}
  env:
    COMPOSER_PROCESS_TIMEOUT: 0
    COMPOSER_NO_INTERACTION: 1
    COMPOSER_NO_AUDIT: 1
    COMPOSER_CACHE_FILES_DIR: /home/runner/.cache/composer/files
Generating optimized autoload files
Generated optimized autoload files containing 5608 classes
phpcov 8.2.1 by Sebastian Bergmann.

Generating code coverage report in Clover XML format ... done

https://github.com/codeigniter4/CodeIgniter4/actions/runs/6254242090/job/16981942317

@kenjis kenjis marked this pull request as ready for review September 20, 2023 21:58
@kenjis
Copy link
Member Author

kenjis commented Sep 22, 2023

This PR fixes the current GitHub Action check failure.
Please approve.

@paulbalandan
Copy link
Member

I think I forgot the reason why. Why do we not add Config\\ psr4 mapping to composer.json in the first place?

@kenjis
Copy link
Member Author

kenjis commented Sep 22, 2023

We removed it in #5824

Probably because it is defined in CI4's autoloader from the beginning.

And if we add it, spark namespaces shows it twice.

$ php spark namespaces | grep '| Config'
| Config                            | APPPATH/Config                                               | Yes    |
| Config                            | APPPATH/Config                                               | Yes    |

@kenjis kenjis merged commit c4bd34e into codeigniter4:develop Sep 22, 2023
1 check passed
@kenjis kenjis deleted the fix-reusable-coveralls.yml branch September 22, 2023 05:56
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dev: Coveralls Uncaught Error: Class "Config\Autoload" not found
2 participants