-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: remove TestMismatchedVersions e2e test (#2564)
## Description Removes `TestMismatchedVersions` and adds `TestPrintBreakingChanges` unit test ## Related Issue Relates to #2562 ## Checklist before merging - [x] Test, docs, adr added or updated as needed - [x] [Contributor Guide Steps](https://github.com/defenseunicorns/zarf/blob/main/.github/CONTRIBUTING.md#developer-workflow) followed
- Loading branch information
Lucas Rodriguez
authored
May 31, 2024
1 parent
ff83e19
commit 69a8507
Showing
13 changed files
with
106 additions
and
106 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.
File renamed without changes.