Skip to content

Conversation

patrobinson
Copy link
Contributor

@patrobinson patrobinson commented Mar 5, 2019

This PR creates a failing test to exhibit behaviour found in #57.
When an invalid policy document is returned (either because its' incorrect from AWS or we've not decoded it correctly) that error is swallowed and not shown to the user. Instead the policy and any other policies are not synced from AWS and we get a diff that tries to push them all back up.

Test output:

Running tool: /usr/local/bin/go test -timeout 30s -run ^(TestFetchIamData)$

2019/03/05 11:58:39 Error Fetching IAM Data invalid URL escape "%zz"
--- FAIL: TestFetchIamData (0.00s)
    /Users/patrickrobinson/src/iamy/iamy/aws_test.go:102: We expected fetch IAM to fail because the policy document was invalid. But it didn't
FAIL
exit status 1
FAIL	_/Users/patrickrobinson/src/iamy/iamy	0.014s
Error: Tests failed.

Patrick Robinson added 2 commits March 5, 2019 11:59
So we can mock it out in tests
Return an invalid policy, which should result in fetchIamData() returning an error
@patrobinson patrobinson requested a review from mtibben March 5, 2019 01:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant