-
Notifications
You must be signed in to change notification settings - Fork 20
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
feat(cmd): log test errors #272
Conversation
08540dd
to
5230b1f
Compare
There are a few things needed to make this consistent across the CLI tool:
|
Updated the test output on errors for each place to make it more meaningful e.g.
Updated to use spaces.
Updated the playgrounds error handling. |
This is affecting the style of most of the CLI, so I pushed a commit to standardize it. You can try it with this config: local sub = std.extVar('sub');
{
tests: [
{
name: 'ex',
transforms: [ // comment block for error.
sub.tf.test.message({ value: 'brex.com' }),
// sub.tf.net.domain.subdomain(), // uncomment for runtime error.
// sub.tf.net.domain.subdomain({ object: {source_key: 'test'}}), // uncomment for vet error.
],
condition: sub.cnd.str.eq({ value: '' }), // comment for error.
},
],
transforms: [ // comment block for vet error.
// sub.tf.net.domain.subdomain(), // uncomment for runtime error.
// sub.tf.net.domain.subdomain({ object: {source_key: 'test'}}), // uncomment for vet error.
sub.tf.send.stdout(), // no-op.
],
} |
Pushed changes look fine to me. |
Description
This changes the CLIs "test" subcommand (
substation test
) to log runtime transform errors to standard error. ThisMotivation and Context
When performing test file driven configuration development it's not clear if a specific tests
[config error]
is from misconfigured Jsonnet declarations, invalid Substation options or runtime errors. You can remove the first two options by diagnosing withsubstation vet
but then you still don't know what the runtime transform error is if that's the case.How Has This Been Tested?
Verified that multiple tests across files can be run, and are more clear when there was an opaque
[config error]
.Types of changes
Checklist: