Skip to content

Edge to Edge Testing & Dependency Injection #100

@jonathanmeier5

Description

@jonathanmeier5

Great seeing how things have evolved.

Since re-reading the chapter on Abstractions, I've been interested in your thoughts on testing interfaces that allow for DI and fakes vs those that don't. For example, without patching I'm not sure how one would inject a fake into a test calling a REST API.

The list of 6 items at the end of this section in Chapter 12 is helpful in this respect.

I do have one question though. Working through an example using that list, imagine that the example directory sync code from Chapter 3 is called from a CLI.

Would you have a full blown integration test calling from the CLI that does real file IO and then use the fake in the file IO code system's unittests?

A slightly related question about your list of 6 items:

At my current work place we use docker-compose to test our code and run our local environments.

However, our dev/production deployments derive from different configuration files than our local/test environments. In this case dev/prod runs off Kubernetes manifests vs the local and test docker-compose files.

From what I've heard, the old advice is to try to keep your local and test environments as close as possible to production.
Do you have advice for maintaining parity between your test/local configurations and your deployments? This question might be fairly platform specific, so no worries if it's out of band.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions