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

[Automated Testing] Do not load remote patterns in tests #33126

Closed
ntsekouras opened this issue Jul 1, 2021 · 2 comments · Fixed by #33160
Closed

[Automated Testing] Do not load remote patterns in tests #33126

ntsekouras opened this issue Jul 1, 2021 · 2 comments · Fixed by #33160
Assignees
Labels
[Status] In Progress Tracking issues with work in progress [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests.

Comments

@ntsekouras
Copy link
Contributor

Description

Recently a regression in GB was introduced that made a deprecated block from core remote patterns (loaded from the pattern directory) create errors that were logged and therefore made tests fail as they take into account the console output.

While the regression was fixed here: #33117, the problem still remains and we can't have GB CI rely on this external source.

Resolution

Make sure that remote patterns are not loaded during tests. If some tests require patterns should handle registration etc.. isolated there. An example could be the tests for Query Loop block which needs patterns for testing here: https://github.com/WordPress/gutenberg/blob/trunk/packages/e2e-tests/plugins/query-block.php#L14.

@ntsekouras ntsekouras added the [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. label Jul 1, 2021
@Mamaduka
Copy link
Member

Mamaduka commented Jul 1, 2021

I think we'll need to land #33052 first. Then we could use the mu-plugin and should_load_remote_block_patterns filter to disable remote patterns.

@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Jul 2, 2021
@Mamaduka
Copy link
Member

Mamaduka commented Jul 2, 2021

I realized that we could use just the core filter since the GB function bails early when the core method exists.

When ahead and create PR - #33160. I don't have info if any core tests depend on remote patterns, but I will push updates if necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] In Progress Tracking issues with work in progress [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants