Add regression tests for CLI error output#1566
Conversation
pietern
left a comment
There was a problem hiding this comment.
Could you also modify cobraTestRunner in internal/helpers.go to use the same?
main.go
Outdated
| code := root.Execute(ctx, cmd.New(ctx)) | ||
|
|
||
| os.Exit(code) |
There was a problem hiding this comment.
| code := root.Execute(ctx, cmd.New(ctx)) | |
| os.Exit(code) | |
| code := root.Execute(ctx, cmd.New(ctx)) | |
| os.Exit(code) |
cmd/root/root_test.go
Outdated
| package root_test // using 'root' will create circular import | ||
| import ( |
There was a problem hiding this comment.
The circular import thing is implied. We use the same pattern in other places.
| package root_test // using 'root' will create circular import | |
| import ( | |
| package root_test | |
| import ( |
lennartkats-db
left a comment
There was a problem hiding this comment.
PTAL at Pieter's comments, and please make the PR title a bit more descriptive for changelog purposes, otherwise LGTM
|
@pietern I didn't know |
pietern
left a comment
There was a problem hiding this comment.
LGTM, thanks
I'm triggering an integration test run to confirm they pass with the modified helper.
|
@pietern is this good to merge? |
|
Yes, good to go! |
Bundles: * Override complex variables with target overrides instead of merging ([#1567](#1567)). * Rewrite local path for libraries in foreach tasks ([#1569](#1569)). * Change SetVariables mutator to mutate dynamic configuration instead ([#1573](#1573)). * Return early in bundle destroy if no deployment exists ([#1581](#1581)). * Let notebook detection code use underlying metadata if available ([#1574](#1574)). * Remove schema override for variable default value ([#1536](#1536)). * Print diagnostics in 'bundle deploy' ([#1579](#1579)). Internal: * Update actions/upload-artifact to v4 ([#1559](#1559)). * Use Go 1.22 to build and test ([#1562](#1562)). * Move bespoke status call to main workspace files filer ([#1570](#1570)). * Add new template ([#1578](#1578)). * Add regression tests for CLI error output ([#1566](#1566)). Dependency updates: * Bump golang.org/x/mod from 0.18.0 to 0.19.0 ([#1576](#1576)). * Bump golang.org/x/term from 0.21.0 to 0.22.0 ([#1577](#1577)).
Bundles: * Override complex variables with target overrides instead of merging ([#1567](#1567)). * Rewrite local path for libraries in foreach tasks ([#1569](#1569)). * Change SetVariables mutator to mutate dynamic configuration instead ([#1573](#1573)). * Return early in bundle destroy if no deployment exists ([#1581](#1581)). * Let notebook detection code use underlying metadata if available ([#1574](#1574)). * Remove schema override for variable default value ([#1536](#1536)). * Print diagnostics in 'bundle deploy' ([#1579](#1579)). Internal: * Update actions/upload-artifact to v4 ([#1559](#1559)). * Use Go 1.22 to build and test ([#1562](#1562)). * Move bespoke status call to main workspace files filer ([#1570](#1570)). * Add new template ([#1578](#1578)). * Add regression tests for CLI error output ([#1566](#1566)). Dependency updates: * Bump golang.org/x/mod from 0.18.0 to 0.19.0 ([#1576](#1576)). * Bump golang.org/x/term from 0.21.0 to 0.22.0 ([#1577](#1577)).
Changes
Add regression tests for #1563
We test 2 code paths:
We should also consider adding black-box tests that will run the CLI binary as a black box and inspect its output to stderr/stdout.
Tests
Unit tests