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 test infra for KRM functions SDK #633

Merged
merged 1 commit into from
Oct 14, 2022

Conversation

yuwenma
Copy link
Contributor

@yuwenma yuwenma commented Oct 11, 2022

Description

This PR add methods in go/fn/testhelper to let function authors to test their code easily.
Users should write the input data in a new directory, write the function config in a file named _fnconfig.yaml, and write the expected output in a file named _expected.yaml. Then use the testhelper functions to read the input, run tests and compare with the expected data.

This idea is developed from the Wow demo, borrowed some methods and naming conventions from GoogleContainerTools/kpt-functions-catalog#926 and I rewrote the methods using the latest go SDK methods.

Example

I uploaded an example in this PR, which I plan to provide to function authors as kpt scaffolding package.

@justinsb
Copy link
Contributor

Looks great!

@yuwenma yuwenma merged commit a09e21d into GoogleContainerTools:master Oct 14, 2022
@yuwenma yuwenma deleted the test-infra branch October 14, 2022 03:57
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