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

Tests: Fix escaping for error message in create block test #40473

Merged
merged 1 commit into from
Apr 20, 2022

Conversation

gziolo
Copy link
Member

@gziolo gziolo commented Apr 20, 2022

What and Why?

Addresses the issue raised by @mcsf in #39049 (comment):

In sh and bash, backticks are the old way to represent command substitution. Which means that the line above actually evals as:

error "Expected $expected files in the $(src) directory ..."

which will invoke src as a command that it will try to find in $PATH, which will either fail or do something that we don't want.

How?

The fix should be to escape:

error "Expected $expected files in the \`src\` directory, but found $actual."

The same applies for this other occurrence in the file:

error "Expected $expected files in the `build` directory, but found $actual."

Testing Instructions

CI should still pass. You can test it locally by changing bin/test-create-block.sh in a way that prints the modified error.

@gziolo gziolo self-assigned this Apr 20, 2022
@gziolo gziolo added [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. [Tool] Create Block /packages/create-block [Type] Code Quality Issues or PRs that relate to code quality labels Apr 20, 2022
@gziolo gziolo requested a review from mcsf April 20, 2022 12:37
Copy link
Contributor

@mcsf mcsf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@gziolo gziolo merged commit ef8c5b6 into trunk Apr 20, 2022
@gziolo gziolo deleted the fix/test-create-block-error branch April 20, 2022 13:59
@github-actions github-actions bot added this to the Gutenberg 13.1 milestone Apr 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Tool] Create Block /packages/create-block [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. [Type] Code Quality Issues or PRs that relate to code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants