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

Upgrade tests in 1.30.0 are supposed to fail due to a bug - they are not failing. #6841

Open
argiepiano opened this issue Feb 3, 2025 · 1 comment

Comments

@argiepiano
Copy link

Description of the bug

When the backup functionality was added, a regression was introduced that created an infinite loop in the first step of the update screens in core/update.php. This was reported in #6839. There is a fix for that there.

The upgrade tests (FilledUpgradePathTestCase, BareUpgradePathTestCase) should have also failed because of that regression, but they did not. We discovered in #6839 that those upgrade tests are being run as user 1, instead of anonymous (which is the case in a "normal" D7 upgrade when the setting update_free_access is TRUE).

In that issue I tried to find a way to make these tests run as anonymous, unsuccessfully. Rather than delaying the fix, I'm opening a separate issue to fix the tests so that they fail when they are supposed to.

Steps To Reproduce

In Backdrop 1.30.0, run the tests FilledUpgradePathTestCase and BareUpgradePathTestCase. The do not fail despite of the regression discussed above.

Expected behavior

Those tests should fail.

Additional information

  • Backdrop CMS version: 1.30.0
@indigoxela
Copy link
Member

indigoxela commented Feb 4, 2025

What I struggled with is that it's impossible to use state or config for that, when running the upgrade test. Neither is available that early (before update_access_allowed() does its check). It's possible to not use the user-1 trick in UpgradePathTestCase::setUp(), hence running it as anonymous user. But that requires a hack to inject something into update_access_allowed() (and more tweaks in update.php), to simulate update_free_access. But even then the loop didn't occur in Simpletest.

As we can't use state or config for the upgrade tests, the only thing that seems to work is file_put_contents() - but we have to be careful, that we don't taint the actual site when running tests.

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

No branches or pull requests

2 participants