Skip to content

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 kptdev/krm-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 kptdev: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