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

Broken builds in 5.0 #47

Closed
GuySartorelli opened this issue May 17, 2023 · 3 comments
Closed

Broken builds in 5.0 #47

GuySartorelli opened this issue May 17, 2023 · 3 comments

Comments

@GuySartorelli
Copy link
Member

GuySartorelli commented May 17, 2023

dnadesign/silverstripe-elemental

https://github.com/silverstripe/silverstripe-elemental/actions/runs/4997726484/jobs/8952788887

And a "page" "Blocks Page" with a "Alice's Block" content element with "original content" content # DNADesign\Elemental\Tests\Behat\Context\FixtureContext::theHasAContentElementWithContent()
Page is invalid (SilverStripe\ORM\ValidationException)

Basically, the configuration that applies ValidationFailedExtension to Page in the previous scenario either isn't being removed or a flush isn't being conducted after it is removed. This is a change from CMS 4 where that test passes fine.

Tag the module after this is fixed.

PR

@GuySartorelli
Copy link
Member Author

git bisect says this was caused by silverstripe/silverstripe-elemental#1032
Most likely because of the base class change for fixture context.

@GuySartorelli
Copy link
Member Author

In SilverStripe\BehatExtension\Context\FixtureContext::iAddAnExtensionToTheClass(), the extension is added to the context running in the browser by adding a file to _config, which gets cleared out after the scenario ends - but the extension is also added to the context running the tests via ::add_extension(), which was not being cleared.

This was fine in the past, because features that would have been affected were in one of two camps:

  1. Weren't adding an extension in a scenario - only in a background
  2. Fixtures were being created in the browser context or in a way that didn't trigger errors from extensions

This change swapped the context for the creation of SiteTree records in elemental features. This caused the new validation failed extension from silverstripe/silverstripe-elemental#930 to cause an error when a new SiteTree record was created.

We just need to clear the extensions from the test context after each scenario.

@emteknetnz
Copy link
Member

Merged and released as 5.0.1

@emteknetnz emteknetnz self-assigned this May 18, 2023
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