Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Dont swallow errors from populateiamdata #58

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

WIP: Dont swallow errors from populateiamdata #58

wants to merge 2 commits into from

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
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.

None yet

1 participant