This repository has been archived by the owner on Jan 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 326
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
force_architecture
; config validation + tests
- Loading branch information
1 parent
6adb4fd
commit 20bdea4
Showing
2 changed files
with
118 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package ecrpull | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestBuilderConfig(t *testing.T) { | ||
t.Run("requires repository and tag", func(t *testing.T) { | ||
var b Builder | ||
cfg := &Config{} | ||
require.EqualError(t, b.ConfigSet(cfg), "rpc error: code = InvalidArgument desc = Repository: cannot be blank; Tag: cannot be blank.") | ||
}) | ||
|
||
t.Run("disallows unsupported architecture", func(t *testing.T) { | ||
var b Builder | ||
cfg := &Config{ | ||
Repository: "foo", | ||
Tag: "latest", | ||
ForceArchitecture: "foobar", | ||
} | ||
|
||
require.EqualError(t, b.ConfigSet(cfg), "rpc error: code = InvalidArgument desc = ForceArchitecture: Unsupported force_architecture \"foobar\". Must be one of [\"x86_64\", \"arm64\"], or left blank.") | ||
}) | ||
} |