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 "testdata" with sed scripts #75125

Merged
merged 4 commits into from
Jan 20, 2022

Conversation

otan
Copy link
Contributor

@otan otan commented Jan 19, 2022

Not a proper audit, but 80% of the way there.
Refs: #71928

See individual commits for details

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@otan otan force-pushed the super_bazel branch 9 times, most recently from c5458b6 to 1e6addb Compare January 19, 2022 12:13
@rickystewart
Copy link
Collaborator

Looks like you've got just a few more failing tests.

@otan otan force-pushed the super_bazel branch 2 times, most recently from abbf6d2 to 0e34104 Compare January 19, 2022 22:01
Prep for a super `sed` replace.

Release note: None
Steps:
```
ag 'filepath.Join\("testdata",' -G '_test\.go$' -l | xargs sed -i '' -e 's/filepath.Join("testdata", /testutils.TestDataPath(t, /g'
ag 'filepath.Join\("testdata"\)' -G '_test\.go$' -l | xargs sed -i '' -e 's/filepath.Join("testdata")/testutils.TestDataPath(t)/g'
git diff --name-only  | xargs -I {} crlfmt -w {}
make bazel-generate
```

Release note: None
…Path(t)`

Generated with:
```
ag '"testdata"' -G '_test\.go$' -l | xargs sed -i '' -e 's/datadriven.Walk(t, "testdata"/datadriven.Walk(t, testutils.TestDataPath(t)/g'
-- crlfmt and bazel generate
```

Release note: None
Also try and break down `/` as much as possible.

```
-- fix the slashes
ag '"testdata/' -G '_test\.go$' pkg -l | xargs sed -i '' -e 's/"testdata\/\([^"]*\)"/testutils.TestDataPath(t, "\1")/g'
git diff --name-only | xargs sed -i '' -e 's_filepath.Join(testutils.TestDataPath(), "\([^/]*\)/\([^"]*\)"_testutils.TestDataPath(t, "\1", "\2")_g'
git diff --name-only | xargs sed -i '' -e 's_filepath.Join(testutils.TestDataPath()\(.*,\) "\([^/]*\)/\([^"]*\)"_testutils.TestDataPath(t\1 "\2", "\3")_g'

-- crlfmt and make generate
```

Also some manual fixes unfortunately...

Release note: None
@otan
Copy link
Contributor Author

otan commented Jan 19, 2022

all good now

@otan otan marked this pull request as ready for review January 19, 2022 22:58
@otan otan requested a review from a team January 19, 2022 22:58
@otan otan requested review from a team as code owners January 19, 2022 22:58
@otan otan requested a review from a team January 19, 2022 22:58
@otan otan requested review from a team as code owners January 19, 2022 22:58
@otan otan requested a review from a team as a code owner January 19, 2022 22:58
@otan otan requested review from adityamaru and srosenberg and removed request for a team January 19, 2022 22:58
Copy link
Collaborator

@rickystewart rickystewart left a comment

Choose a reason for hiding this comment

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

Assuming that the tests all pass, stamp. :)

Thanks for looking at this Oliver.

@otan
Copy link
Contributor Author

otan commented Jan 20, 2022

remaining failure looks like an unrelated timeout

bors r=rickystewart

@otan
Copy link
Contributor Author

otan commented Jan 20, 2022

bors r=rickystewart

@craig
Copy link
Contributor

craig bot commented Jan 20, 2022

Already running a review

@craig
Copy link
Contributor

craig bot commented Jan 20, 2022

Build succeeded:

@craig craig bot merged commit 506412f into cockroachdb:master Jan 20, 2022
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.

None yet

3 participants