Fix missing absolute path resolving in ParamsLoader by garvinhicking · Pull Request #6828 · Codeception/Codeception · GitHub
Skip to content

Fix missing absolute path resolving in ParamsLoader - #6828

Merged
TavoNiievez merged 1 commit into
Codeception:mainfrom
garvinhicking:patch-1
Feb 20, 2025
Merged

TavoNiievez merged 1 commit into
Codeception:mainfrom
garvinhicking:patch-1

Conversation

@garvinhicking

@garvinhicking garvinhicking commented Feb 17, 2025 •

Copy link
Copy Markdown
Contributor

This is a regression bugfix for release 5.2.0.

With #6767 the ParamsLoader was streamlined, but when previously $paramsFile was passed to the loader methods, now only $paramStorage is passed, which misses getting converted to an absolute path via codecept_absolute_path().

This patch restores utilizing $paramsFile and also uses that to emit warnings when a file cannot be loaded.

This bug caused missing file resolving, because software like TYPO3 for example executes tests from the repo directory typo3/sysext/core/Tests/codeception.yml and uses:

params:
  - parameters.yml
  - env.yml

and expects that the file is found next to the codeception.yml file in the same directory, and thus a breaking change.

Closes #6829

This is a regression bugfix for release 5.2.0.

With Codeception#6767 the ParamsLoader was streamlined, but when previously `$paramsFile` was passed to the loader methods, now only `$paramStorage` is passed, which misses getting converted to an absolute path via `codecept_absolute_path()`.

This patch restores utilizing `$paramsFile` and also uses that to emit warnings when a file cannot be loaded.

This bug caused missing file resolving, because software like TYPO3 for example executes tests from the repo directory `typo3/sysext/core/Tests/codeception.yml` and uses:

```
params:
  - parameters.yml
  - env.yml
```

and expects that the file is found next to the `codeception.yml` file in the same directory, and thus a breaking change.
grossmannmartin added a commit to shopsys/shopsys that referenced this pull request Feb 17, 2025
grossmannmartin added a commit to shopsys/shopsys that referenced this pull request Feb 17, 2025
@TavoNiievez
TavoNiievez merged commit 7df4ce2 into Codeception:main Feb 20, 2025
@TavoNiievez

Copy link
Copy Markdown
Member

@garvinhicking

Copy link
Copy Markdown
Contributor Author

Thanks for the trust in advance. :) I'll see what I can do for some tests, I haven't yet checked this out, but should be possible. Give me a day or two.

@garvinhicking

garvinhicking commented Feb 20, 2025 •

Copy link
Copy Markdown
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ParamsLoader references path of extra configuration files not resolved by their absolute path

2 participants