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

Replace spaces in test names with underscores #743

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

adombeck
Copy link
Contributor

@adombeck adombeck commented Jan 21, 2025

To make it easier to copy/paste them into a go test -run command.

FTR, this command can be used to reproduce the changes:

for i in {1..20}; do
  find . -name "*.go"  -not -path "./vendor/*" -not -path "./obj-x86_64-linux-gnu/*" -not -path "./scratch/*" -exec sed -i -E 's/"([^"]+)"([[:space:]]*:[[:space:]]*\{)/"\1"\2/g; s/([^"_])\s+([^"]*":[[:space:]]*\{)/\1_\2/g' {} \;
done

UDENG-5822

@adombeck adombeck marked this pull request as ready for review January 21, 2025 13:58
@adombeck adombeck requested a review from a team as a code owner January 21, 2025 13:58
Copy link
Member

@didrocks didrocks left a comment

Choose a reason for hiding this comment

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

I quickly scanned through them and didn’t spot anything. Between that and checking that no golden files have been "traumatized" in that PR, let’s +1! :)

@3v1n0
Copy link
Collaborator

3v1n0 commented Jan 21, 2025

Looks nice!

One thing... If you have a regex or automated script for this (I hope so), could you wait that we land #593 first to avoid the conflicts and re-run it? :)

@adombeck adombeck force-pushed the UDENG-5822-rename-tests branch from 4f7fa23 to 2e16eed Compare January 21, 2025 20:15
To make it easier to copy/paste them into a `go test -run` command.
@adombeck adombeck force-pushed the UDENG-5822-rename-tests branch from 2e16eed to 17c8f97 Compare January 21, 2025 20:27
@adombeck
Copy link
Contributor Author

adombeck commented Jan 21, 2025

One thing... If you have a regex or automated script for this (I hope so), could you wait that we land #593 first to avoid the conflicts and re-run it? :)

I rebased the branch from that PR on this one by executing

git rebase main

cat <<EOF > /tmp/replace-spaces.sh
for i in {1..20}; do
  find . -name "*.go"  -not -path "./vendor/*" -not -path "./obj-x86_64-linux-gnu/*" -not -path "./scratch/*" -exec sed -i -E 's/"([^"]+)"([[:space:]]*:[[:space:]]*\{)/"\1"\2/g; s/([^"_])\s+([^"]*":[[:space:]]*\{)/\1_\2/g' {} \;
done
EOF

git rebase -X theirs UDENG-5822-rename-tests --exec 'sh /tmp/replace-spaces.sh'

And then amending the commits during the rebase. If you're fine with that, I can push to your branch and we can merge this one.

@adombeck adombeck requested a review from 3v1n0 January 22, 2025 11:03
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.

3 participants