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

Fix possible nil-pointer error; add golden test for set-name-prefix #926

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

Conversation

justinsb
Copy link
Contributor

@justinsb justinsb commented Oct 4, 2022

Using the golden test support in the functions SDK.

@justinsb justinsb changed the title add setnameprefix fn WIP: Add golden test for function output Oct 4, 2022
@justinsb
Copy link
Contributor Author

justinsb commented Oct 4, 2022

@yuwenma do we have a golden test somewhere? I've copied this from my playground, but I feel like we've both been iterating on the idea...

@yuwenma
Copy link
Contributor

yuwenma commented Oct 11, 2022

@yuwenma do we have a golden test somewhere? I've copied this from my playground, but I feel like we've both been iterating on the idea...

I uploaded the golden test in the SDK, with an example using the new test infra. That PR borrows lots of the code from this PR and rewrote the part with the latest go sdk changes:

Feel free to merge this PR. I can rebase my fnRunner migration PR for set-gcpresources-ids and update the test infra there.

@justinsb justinsb force-pushed the add_setnameprefix_fn branch 2 times, most recently from 4d993d9 to b940a79 Compare November 4, 2022 18:58
Using the golden test support in the functions SDK.
@justinsb justinsb force-pushed the add_setnameprefix_fn branch from b940a79 to 2e9b530 Compare November 4, 2022 18:59
@justinsb justinsb changed the title WIP: Add golden test for function output Fix possible nil-pointer error; add golden test for set-name-prefix Nov 4, 2022
if err := visitor(ref); err != nil {
return err
}
ref, err := refInfo.buildFullyQualifiedRef(object, subObject)
Copy link
Contributor

Choose a reason for hiding this comment

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

I like the name "FullyQualified"!

if err != nil {
return err
}
if err := visitor(ref); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

super nit: seems to be more readable as "visit"?

Copy link
Contributor

Choose a reason for hiding this comment

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

ignore this comment. Didn't notice this is a common naming convention in go.

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