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

[e2e] Fix golden file test indexing nonexistent tensor #7527

Merged
merged 1 commit into from
Mar 28, 2023

Conversation

mattsoulanille
Copy link
Member

@mattsoulanille mattsoulanille commented Mar 28, 2023

Use .toEqual(jasmine.anything()) instead of .not.toEqual(null) to catch both null and undefined.

Use model.outputs.map(output => output.name) instead of model.outputNodes to get the output node name without the numerical index.

To see the logs from the Cloud Build CI, please join either our discussion or announcement mailing list.


This change is Reviewable

Use `.toEqual(jasmine.anything())` instead of `.not.toEqual(null)` to catch both
`null` and `undefined`.

Use `model.outputs.map(output => output.name)` instead of `model.outputNodes` to
get the output node name without the numerical index.
Copy link
Collaborator

@chunnienc chunnienc left a comment

Choose a reason for hiding this comment

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

Did you verify that jasmine.anything() can fail the unexpected node name?

@mattsoulanille
Copy link
Member Author

Did you verify that jasmine.anything() can fail the unexpected node name?

I verified that expect(x).toEqual(jasmine.anything()) will fail if x is null or undefined and will pass when x is defined. I'm checking for missing node names when I map the targetNodeNames to the golden node details. Is that what you are asking, or did I misunderstand?

@chunnienc
Copy link
Collaborator

Just want to check if the tests without node name fix fail after we check the nullity with expect(x).toEqual(jasmine.anything()). Thanks for the fix!

Copy link
Collaborator

@pyu10055 pyu10055 left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: :shipit: complete! 2 of 1 approvals obtained

@mattsoulanille mattsoulanille merged commit 95a2873 into tensorflow:master Mar 28, 2023
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.

3 participants