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

unify testdata to only one dir #1297

Merged
merged 2 commits into from
Jul 25, 2017
Merged

Conversation

thinkerou
Copy link
Contributor

@thinkerou thinkerou commented Jun 11, 2017

Unify test data to one dir: testdata.

@menghanl
Copy link
Contributor

Thanks for this PR. We definitely want this.
A problem here is that, you need to run those tests or binaries in certain directory, otherwise they cannot find the testdata.

Our proposal is:

  1. Add a go package testdata here
  2. Add an exported function to testdata package (testdata.Directory()?), which returns the absolute path of the testdata directory. This function should look similar to the abs function we already have.
  3. In all the places test files are needed, specify them using the newly added function.
    For example: var caFile = testdata.Directory() + "ca.pem"

What do you think?
If you agree, do you mind changing this PR to implement it?

@dfawley
Copy link
Member

dfawley commented Jun 26, 2017

Add an exported function to testdata package (testdata.Directory()?)

Nit/bikeshedding: how about Path()?

For example: var caFile = testdata.Directory() + "ca.pem"

Note: prefer filepath.Join() to manual concatenation for cross-platform compatibility.

@thinkerou
Copy link
Contributor Author

thinkerou commented Jun 28, 2017

OK, I prefer testdata.Path("testdata/ca.pem") to testdata.Directory, but I not sure that we should use testdata.Path("ca.pem") or testdata.Path("testdata/ca.pem").

So, the PR have changed the follow points:

  • Deleted two functions abs and goPackagePath in benchmark/worker/util.go file.
  • Add new file testdata.go.
  • Deleted some ca.pem,server1.pem and server1.key.
  • Used new function testdata.Path().

@thinkerou thinkerou reopened this Jun 30, 2017
Copy link
Contributor

@menghanl menghanl left a comment

Choose a reason for hiding this comment

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

Thanks for the PR.
LGTM.

@menghanl menghanl merged commit ca9e0c3 into grpc:master Jul 25, 2017
@menghanl menghanl added the 1.6 label Aug 24, 2017
@dfawley dfawley modified the milestone: 1.6 Release Aug 28, 2017
@lock lock bot locked as resolved and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants