Skip to content

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

Merged
kenjis merged 1 commit intocodeigniter4:developfrom
kenjis:fix-reusable-coveralls.yml
Sep 22, 2023
Merged

chore: fix Upload coverage results to Coveralls / coveralls#7956
kenjis merged 1 commit intocodeigniter4:developfrom
kenjis:fix-reusable-coveralls.yml

Conversation

@kenjis
Copy link
Copy Markdown
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 kenjis force-pushed the fix-reusable-coveralls.yml branch from 95129ff to 7f1c6b8 Compare September 20, 2023 21:23
@kenjis
Copy link
Copy Markdown
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 force-pushed the fix-reusable-coveralls.yml branch from 7f1c6b8 to 4ee20ad Compare September 20, 2023 21:58
@kenjis kenjis marked this pull request as ready for review September 20, 2023 21:58
@kenjis
Copy link
Copy Markdown
Member Author

kenjis commented Sep 22, 2023

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

@paulbalandan
Copy link
Copy Markdown
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
Copy Markdown
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
@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