Giter VIP home page Giter VIP logo

Comments (6)

brikis98 avatar brikis98 commented on May 14, 2024 1

Methods to fetch the tags on a bucket and object makes sense. The Assert methods less so, as that should probably be done with a standard Golang assert library in your own test code.

from terratest.

floresj avatar floresj commented on May 14, 2024 1

Hey! @mauricioklein Go for it! I haven't gotten around to it so please feel free to knock that out.

from terratest.

mauricioklein avatar mauricioklein commented on May 14, 2024 1

PRs created ☝️

from terratest.

brikis98 avatar brikis98 commented on May 14, 2024

Seems like a reasonable addition to the s3 helpers. PR welcome!

from terratest.

floresj avatar floresj commented on May 14, 2024

I wouldn't mind taking a stab at this one. I'm thinking of adding the following functions to modules/aws/s3.go.

Functions for retrieving S3 Bucket tags

GetS3BucketTags(t *testing.T, awsRegion string, bucket string) []*s3.Tag
GetS3BucketTagsE(t *testing.T, awsRegion string, bucket string) ([]*s3.Tag, error)

Some assertions for checking the existence of keys tagKeys.

AssertS3BucketContainsTagKeys(*testing.T, awsRegion string, bucketName string, tagKeys []string)
AssertS3BucketContainsTagKeysE(*testing.T, awsRegion string, bucketName string, tagKeys []string) error

Some assertions for checking that key/values tagKeyValuePairs exist for a particular Bucket. For instance, does a tag existence where key = 'foo' and value = 'bar'

AssertS3BucketContainsTagKeyValuePairs(*testing.T, awsRegion string, bucketName string, tagKeyValuePairs map[string]string)
AssertS3BucketContainsTagKeyValuePairsE(*testing.T, awsRegion string, bucketName string, tagKeyValuePairs map[string]string) error

And this could apply at the object level as well.

GetS3BucketObjectTags(...)
GetS3BucketObjectTagsE(...)
AssertS3BucketObjectContainsTagKeys(...)
// etc...

Does this sound reasonable? Just making sure I was understanding the intent behind this issue.

from terratest.

mauricioklein avatar mauricioklein commented on May 14, 2024

@floresj
Are you working on that?
Please let me know, otherwise, I can support with a PR 👍

from terratest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.