-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* NR-98861 fix:use GH API to get the previous tag of given tag * fix aws cloudwatch bash command * add test
- Loading branch information
1 parent
63ae6ab
commit ea58c3e
Showing
5 changed files
with
105 additions
and
12 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
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,40 @@ | ||
/* | ||
* Copyright 2021 New Relic Corporation. All rights reserved. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package main | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func Test_previousCanaryVersion(t *testing.T) { | ||
testCases := []struct { | ||
name string | ||
referenceVersion string | ||
expectedVersion string | ||
}{ | ||
{ | ||
name: "patch version", | ||
referenceVersion: "1.33.2", | ||
expectedVersion: "1.33.1", | ||
}, | ||
{ | ||
name: "minor version", | ||
referenceVersion: "1.34.0", | ||
expectedVersion: "1.33.2", | ||
}, | ||
} | ||
|
||
for i := range testCases { | ||
testCase := testCases[i] | ||
t.Run(testCase.name, func(t *testing.T) { | ||
previousVersion, err := getPreviousVersion(testCase.referenceVersion) | ||
assert.NoError(t, err) | ||
assert.Equal(t, testCase.expectedVersion, previousVersion) | ||
}) | ||
} | ||
} |