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

Testing workflow and paginated test fixes #41

Merged
merged 15 commits into from
Aug 31, 2020
Merged

Testing workflow and paginated test fixes #41

merged 15 commits into from
Aug 31, 2020

Conversation

ncatelli
Copy link
Contributor

@ncatelli ncatelli commented Aug 31, 2020

General

This PR includes test fixes, additional developer tooling and a new workflow.

Test Fixes

This PR implements a new method on the ssm and ec2 mocks respectively to cover paginator calls. After the included changes tests are passing again.

These changes are:

  • Implementing DescribeInstanceInformationPages method in the ssm API mocks
  • Implementing DescribeInstancesPages method in the ec2 API mocks

New Workflow

This PR also introduces a new code_quality workflow that handles running make format and make test on PR creation.

Other Changes

In addition to the above fixes, this PR includes a few additional small changes

  • ran a make format to format branch
  • small cleanups to the pagination callbacks
  • addition of a devcontainer for VS Code users
    • please let me know if this is a problem and I will happily remove it or move to a new PR.

@ncatelli ncatelli marked this pull request as draft August 31, 2020 01:28
@jschell12
Copy link
Contributor

This looks great!

// instanceMatchesFilter converts the instance information to its string representation
// and then checks that that information containes atleast one value in the
// filter. This is a hack but should be sufficient for tests.
func instanceMatchesFilter(instance ssm.InstanceInformation, filter ssm.InstanceInformationStringFilter) bool {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a hack, but i figured it would be sufficient for the sake of the limited needs of the mock and would be better than working with reflection to pull out field names or hard coding them. Please let me know if you feel otherwise though.

.github/workflows/code_quality.yml Show resolved Hide resolved
testing/ec2_mocks.go Show resolved Hide resolved
testing/ssm_mocks.go Show resolved Hide resolved
@ncatelli
Copy link
Contributor Author

Manually tested everything after these changes and everything looked good as well.

@ncatelli ncatelli marked this pull request as ready for review August 31, 2020 17:11
@JordanFaust JordanFaust merged commit c852829 into disneystreaming:v1 Aug 31, 2020
@ncatelli ncatelli deleted the add-paginator-tests branch August 31, 2020 19:27
sendqueery pushed a commit that referenced this pull request Sep 3, 2020
* Add devcontainer

* Add Code Quality workflow

* Fix unformatted code.

* Remove the redundant G

* WIP: Stub DescribeInstanceInformationPages

* implement paginator mock

* Add pagination and filtering to mock

* Fix ec2 mocks traceback.

* Fix EC2 tags tests

* Remove extra newline

* Add missing newline to code_quality.yml

* format -> format.check

* else -> happy path on mock conditionals

* Add path to gofmt stage.

* ec2 mocks test to ElementsMatch to ignore ordering
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

3 participants