Skip to content

[Feature Request] Separate run-time and test-time dependencies #354

@percysnoodle

Description

@percysnoodle

We have a monolithic codebase which we're trying to modularise into engines, using Packwerk to define and enforce the dependencies between them.

Moving our app code into the engines is usually pretty straightforward, but the tests are a problem. In a lot of places, the model code works generically without reference to the types of input it gets, but the tests define the behaviour using concrete examples of inputs using classes from outside the engine. We work with non-technical domain experts to write these tests, and they work almost exclusively with concrete examples, so rewriting them with dummy classes isn't a long-term solution.

What I'd really like is to be able to define one set of dependencies for the app code in each engine, and have Packwerk enforce those for the code under engines/whatever/app; and another looser set of dependencies for the spec code, and have Packwerk enforce those for the code under engines/whatever/spec. That way, we could move our test files across unaltered. Ideally, I'd do this in a single package.yml file:

enforce-dependencies: true

dependencies:
  - app
    - engines/base
    - engines/engine1
  - spec
    - engines/base
    - engines/engine1
    - engines/engine2

This could then be simplified using YAML anchors etc...

Hope that makes sense! Apologies if this is already possible and I've missed how to do it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions