Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
ec2test: handle CreateTags action #50
Conversation
wallyworld
reviewed
May 22, 2015
| + "tag10": "", | ||
| + }) | ||
| + | ||
| + _, err = s.ec2.CreateTags([]string{id}, []ec2.Tag{{"tag11", ""}}) |
wallyworld
May 22, 2015
Member
tag limit exceeded should be a separate test, strictly speaking
similar to create tags invalid test below
wallyworld
reviewed
May 22, 2015
| + } | ||
| + i := atoi(fields[1]) | ||
| + for i > len(tags) { | ||
| + tags = append(tags, ec2.Tag{}) |
wallyworld
May 22, 2015
Member
is this right? it will append to tags slice but the slot it ends up in won't necessarily match i
what if we have:
Tag.1.Key
Tag.1.Value
Tag.3.Key
Tag.3.Value
then the tag 3 value will end up in the slot for tag 2.
Is the above possible? Or is it enforced that there must be a tag 1 and tag 2 and tag 3 etc, not missing values like tag 1 and tag 2 and tag4. Either way, I think another test is needed
axw
May 22, 2015
Member
Tag.1.Key
Tag.1.Value
At this point: tags is empty, i is 1. It'll add a single empty ec2.Tag to tags, and then below will set the i-1'th element (i.e. index 0 in this case) to the key/value.
tags == []ec2.Tag{{"Tag.1.Key", "Tag.1.Value"}}
Tag.3.Key
Tag.3.Value
Now tags has len==1, and i is 3. The code will add two empty ec2.Tags to tags, and below will set the element at index 2 to the key/value. So at this point we'd have:
tags == []ec2.Tag{{"Tag.1.Key", "Tag.1.Value"}, {}, {"Tag.2.Key", "Tag.2.Value"}}
Is the above possible? Or is it enforced that there must be a tag 1 and tag 2 and tag 3 etc, not missing values like tag 1 and tag 2 and tag4. Either way, I think another test is needed
The values are going in the right places. I'd say it's an error to have non-contiguous sequence numbers. We don't have to test every possible scenario in the test server, though; only the ones that we actually run. We will never generate such parameters, so it's not worth trying to bend the code to test it.
|
LGTM with question about tags either answered or fixed |
axw commentedMay 21, 2015
This commit adds support for the CreateTags
action to the test server, and an accompanying
test. Live tested.