-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature/context-signal
- Loading branch information
Showing
14 changed files
with
106 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: 2021-Present The Zarf Authors | ||
|
||
// Package deprecated handles package deprecations and migrations | ||
package deprecated | ||
|
||
import ( | ||
"bytes" | ||
"testing" | ||
|
||
"github.com/Masterminds/semver/v3" | ||
"github.com/defenseunicorns/zarf/src/pkg/message" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestPrintBreakingChanges(t *testing.T) { | ||
t.Parallel() | ||
|
||
tests := []struct { | ||
name string | ||
deployedVersion string | ||
cliVersion string | ||
breakingChanges []BreakingChange | ||
}{ | ||
{ | ||
name: "No breaking changes", | ||
deployedVersion: "0.26.0", | ||
cliVersion: "0.26.0", | ||
breakingChanges: []BreakingChange{}, | ||
}, | ||
{ | ||
name: "agent breaking change", | ||
deployedVersion: "0.25.0", | ||
cliVersion: "0.26.0", | ||
breakingChanges: []BreakingChange{ | ||
{ | ||
version: semver.MustParse("0.26.0"), | ||
title: "Zarf container images are now mutated based on tag instead of repository name.", | ||
mitigation: "Reinitialize the cluster using v0.26.0 or later and redeploy existing packages to update the image references (you can view existing packages with 'zarf package list' and view cluster images with 'zarf tools registry catalog').", | ||
}, | ||
}, | ||
}, | ||
} | ||
|
||
for _, tt := range tests { | ||
tt := tt | ||
t.Run(tt.name, func(t *testing.T) { | ||
t.Parallel() | ||
var output bytes.Buffer | ||
message.InitializePTerm(&output) | ||
PrintBreakingChanges(&output, tt.deployedVersion, tt.cliVersion) | ||
for _, bc := range tt.breakingChanges { | ||
require.Contains(t, output.String(), bc.String()) | ||
} | ||
t.Log(output.String()) | ||
}) | ||
} | ||
} |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.