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

Refactor test/helper.sh and test/utils.go #179

Merged
merged 1 commit into from
Oct 30, 2023

Conversation

sawsa307
Copy link
Contributor

  • Move test/utils.go to test/utils/utils.go.
  • Break test/helper.sh into separate functions in test/helpers, and source them from test/helper.sh.

@sawsa307 sawsa307 force-pushed the refactor-test-framework branch from 80c0f6b to 1a73a74 Compare October 27, 2023 22:58
@sawsa307
Copy link
Contributor Author

/assign @bowei

@sawsa307 sawsa307 force-pushed the refactor-test-framework branch 3 times, most recently from 6e9a4a0 to 4cf2eab Compare October 28, 2023 00:27
Copy link
Member

@bowei bowei left a comment

Choose a reason for hiding this comment

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

Don't the new files need to be sourced from the helpers.sh?

@sawsa307
Copy link
Contributor Author

Don't the new files need to be sourced from the helpers.sh?

Yes they are sourced, but I think they are masked by the deletion.
If you expand the change in test/helper.sh, at the bottom you can find:

for f in $(find test/helpers -name *.sh); do
    source ${f}
done

@sawsa307 sawsa307 force-pushed the refactor-test-framework branch 2 times, most recently from 14713b1 to 6cda69e Compare October 30, 2023 17:23
@sawsa307 sawsa307 requested a review from bowei October 30, 2023 17:44
@bowei
Copy link
Member

bowei commented Oct 30, 2023

for something like a library files -- you should source them explicitly instead of using find.

* Move test/utils.go to test/utils/utils.go, and update corresponding
  references.
* Break test/helper.sh into separate functions in test/helpers, and
  source them from test/helper.sh.
* Files containing helper functions are explicitly sourced in
  test/helper.sh.
@sawsa307 sawsa307 force-pushed the refactor-test-framework branch from 6cda69e to 3a85457 Compare October 30, 2023 18:39
@bowei bowei merged commit 89c25eb into GoogleCloudPlatform:main Oct 30, 2023
2 checks passed
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.

2 participants