mirror of
https://github.com/hashicorp/packer.git
synced 2026-09-21 23:41:41 -04:00
hcl2template: don't error if test wants diags
The required_plugins parse tests define a `want_diags' flag, but don't actually use it in subtests, so if one was to add a test that is expected to produce errors on this step, this would always fail.
This commit is contained in:
@@ -138,7 +138,9 @@ func TestPackerConfig_required_plugin_parse(t *testing.T) {
|
||||
if len(diags) > 0 {
|
||||
t.Fatal(diags)
|
||||
}
|
||||
if diags := cfg.decodeRequiredPluginsBlock(file); len(diags) > 0 {
|
||||
|
||||
diags = cfg.decodeRequiredPluginsBlock(file)
|
||||
if !tt.wantDiags && len(diags) > 0 {
|
||||
t.Fatal(diags)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user