Skip to content

Add basic end-to-end and unit tests #6

Description

@ambergristle

Describe key service behavior, and flag breaking changes.

What

  • End-to-end tests verifying service responds appropriately to both valid and invalid requests:
    • Malformed or missing parameters
    • [Future] Unauthorized requests
  • Unit tests to verify key logic or behavior:
    • Signature formatting
    • Parameter validation?
    • Callback construction?

Considerations

  • How much can we lean on end-to-end tests?
    • Signature logic seems like the only piece that really benefits from unit testing.

Tests

End-to-end

  • happy path: server responds 202 with valid data + faithfully relays to callback
  • bad data: server responds 400 if request data is missing or malformed
    • for every parameter
  • query params: server ignores query params
  • routing: 404s on bad endpoints
  • server: timeouts
  • unauthorized: [future] server responds 403 if request cannot be verified

Unit

Retry

  • retry server errors: callback will retry on >=500 up to 3 times before dumping the last response
    • with expected backoff
    • including on timeout errors
  • fail unrecoverable: callback retry will exit immediately on <500 errors

HMAC

  • constructs valid signatures that can be parsed/verified as expected

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions