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

Implementing a unit test to make CI pipeline validate the recency of model at each push #8

Open
ufukty opened this issue Jul 4, 2024 · 0 comments
Labels
discussions features Feature requests

Comments

@ufukty
Copy link
Owner

ufukty commented Jul 4, 2024

Expected behavior

Gonfique will implement a unit test according to criteria:

  • The test will be placed in a separate file its name suffixed with _test.go.
  • The unit test will call the generated func ReadConfig(path string) and make sure it has no problem completing its execution without panics/errors can be instantiated from yaml.Decoder
  • The input file's path that will be used as argument to ReadConfig function will be the input file's path for model generation.

Example

package config

func TestReadConfig(t *testing.T) {
  cfg, err := ReadConfig("../../env.yml")
  if err != nil {
    t.Errorf(err)
  }
}

Advanced implementation

Couple assertions can be placed in the unit test's body. Pairs can be sourced from input file that is provided in model generation.

@ufukty ufukty added features Feature requests discussions labels Jul 4, 2024
@ufukty ufukty changed the title Implementing a basic unit test for config file to make CI pipeline validate the recency of models at each push Implementing a unit test to make CI pipeline validate the recency of model at each push Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussions features Feature requests
Projects
None yet
Development

No branches or pull requests

1 participant