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

Add basic e2e tests for state push/pull #320

Merged
merged 1 commit into from Jun 27, 2022
Merged

Add basic e2e tests for state push/pull #320

merged 1 commit into from Jun 27, 2022

Conversation

kmoe
Copy link
Member

@kmoe kmoe commented Jun 24, 2022

Extremely basic e2e tests for state push/pull. These would have caught the bug fixed in #316.

I wonder if StatePull should also return a state struct instead of a string.

@kmoe kmoe requested a review from radeksimko June 24, 2022 16:36
Copy link
Member

@radeksimko radeksimko 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 test.

I wonder if StatePull should also return a state struct instead of a string.

Maybe? Depends on how we represent state elsewhere. Also there's a potential concern with scale if the state is big - maybe io.Writer interface which leaves the writing to the consumer is better?

Similarly StatePush could also take io.Reader and pass the content as STDIN.

I think we'll need to rethink these interfaces, along with Format* methods for v1.

@kmoe
Copy link
Member Author

kmoe commented Jun 27, 2022

Maybe? Depends on how we represent state elsewhere.

Show() returns a *tfjson.State, which I think is reasonable. We should at least be consistent, I think.

Also there's a potential concern with scale if the state is big - maybe io.Writer interface which leaves the writing to the consumer is better?

Yes, good point... Opened #321.

I think we'll need to rethink these interfaces, along with Format* methods for v1.

Do you mean possibly removing FormatString()? We currently have both this and Format() which uses io.Reader/Writer.

@kmoe kmoe merged commit 1437e99 into main Jun 27, 2022
@kmoe kmoe deleted the state-push-pull-e2e branch June 27, 2022 12:53
@radeksimko
Copy link
Member

Do you mean possibly removing FormatString()? We currently have both this and Format() which uses io.Reader/Writer.

Maybe - I don't have all the context and use cases in my mind right now have the confidence, but the io.Reader/Writer generally seems more scalable and universal.

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.

None yet

2 participants