Closed shihanng closed 4 years ago
Hi @cweill , is there anything that I can do to improve this PR 🙏 ?
@shihanng Please add tests that checks that setting the environment has the intended behavior:
@cweill, thanks for the review.
The first thing that came to my mind when trying to add test cases is to add them in /gotests_test.go
. However, I found that it might difficult to do so as the reading from environment variables part is done before GenerateTests
in /gotests/main.go
.
I would like to suggest that we test the new valOrGetenv
function in a new /gotests/main_test.go
. This should cover the following two cases:
- Setting GOTESTS_TEMPLATE and the flag will prioritize the flag.
- Setting GOTESTS_TEMPLATE_DIR and the flag will prioritize the flag.
Then naturally
- Setting GOTESTS_TEMPLATE will use the template.
is already covered by existing test cases:
- Setting GOTESTS_TEMPLATE_DIR will use the dir.
- Setting GOTESTS_TEMPLATE and GOTESTS_TEMPLATE_DIR will use the template over the dir.
are covered by
What do you think about this proposal?
Note: According to the help message and test case I think 3. should be reversed "will use the dir over the template."
@shihanng: This proposal sounds good to me. If you make those changes, I will approve the PR. Thank you.
@cweill , I've added the tests in 18bccc4. Thanks!
Closes #116