test(aws): move part of unit tests to integration (#4884)

* test(aws): move part of unit tests to integration

* fix typo

* fix test

---------

Co-authored-by: knqyf263 <knqyf263@gmail.com>
This commit is contained in:
Nikita Pivkin
2023-08-02 18:48:52 +03:00
committed by GitHub
parent 6d3ae3bcf2
commit 39ccbf7b58
4 changed files with 126 additions and 55 deletions

View File

@@ -982,41 +982,6 @@ func Test_Run(t *testing.T) {
allServices []string
inputData string
}{
{
name: "fail without region",
options: flag.Options{
RegoOptions: flag.RegoOptions{SkipPolicyUpdate: true},
},
want: "",
expectErr: true,
},
{
name: "fail without creds",
options: flag.Options{
RegoOptions: flag.RegoOptions{SkipPolicyUpdate: true},
AWSOptions: flag.AWSOptions{
Region: "us-east-1",
},
},
want: "",
expectErr: true,
},
{
name: "try to call aws if cache is expired",
options: flag.Options{
RegoOptions: flag.RegoOptions{SkipPolicyUpdate: true},
AWSOptions: flag.AWSOptions{
Region: "us-east-1",
Services: []string{"s3"},
Account: "12345678",
},
CloudOptions: flag.CloudOptions{
MaxCacheAge: time.Minute,
},
},
cacheContent: "testdata/s3onlycache.json",
expectErr: true,
},
{
name: "succeed with cached infra",
options: flag.Options{