Skip to content

Conversation

@gdwoolbert3
Copy link
Owner

Purpose

This PR aims to fix two related bugs that crop up when using this application in an umbrella project.

Exposure evaluates test paths at compile time in order to ensure that Mix is available (since test paths are configured in the mix project config). The issue here is that, in umbrella projects, tests are run in the context of the child application BUT dependencies are compiled in the context of the mix project. So, during compilation, the umbrella project test paths would be baked into the library (usually just the default ["test"]) and the children would run their tests using those test paths. In many cases, this worked fine because, let's face it, most people aren't configuring custom test paths. However, if two children applications had different test paths, this would cause an issue.

Additionally, using :persistent_term to cache the test paths was also inherently flawed because it was explicitly making the assumption that test paths must be the same between children applications (by nature of the key it was using).

Approach

This PR resolves the issue by:

  1. Evaluating the test paths at runtime instead of compile time
  2. Adding the mix project to the :persistent_term key to ensure no conflict between children applications

These changes both leverage Mix at runtime, but that isn't an issue because Mix is guaranteed to be available by nature of the fact that this library is used exclusively through the context of a mix task.

Testing

This PR relies on the existing test suite to ensure no breaking changes. anecdotally, these changes were also tested on a personal umbrella project.

@gdwoolbert3 gdwoolbert3 merged commit cd06d9b into main May 23, 2025
1 check passed
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.

2 participants