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

Find and consolidate hardcoded paths in DE code, and mock for unit tests #699

Open
3 tasks
shreyb opened this issue Feb 1, 2024 · 1 comment
Open
3 tasks
Assignees

Comments

@shreyb
Copy link
Contributor

shreyb commented Feb 1, 2024

This issue consists of three parts:

  • Find hardcoded paths in DE code (e.g. configuration file directories)
  • Consolidate all of those into a single file, which then gets imported as necessary
  • Mock the file in (2) for unit tests so that they don't fail if we don't, for example, have /etc/decisionengine on a dev machine or test container

This needs to be done for both the decisionengine code and decisionengine_modules code.

@shreyb shreyb self-assigned this Feb 1, 2024
@shreyb
Copy link
Contributor Author

shreyb commented Feb 21, 2024

I actually think the first two parts were done in #168. The current design, implemented by that PR, is that various modules import thedecisionengine.framework.config if they need access to the configuration. The submodules within that module contain functions to dynamically find the configuration files, validate them, and load their values into memory. This is the way it should be, IMO, so I see no need to change that.

That means that the bulk of the work here is actually on the testing side, and mocking where that config module looks for configuration files.

What do you think, @mambelli?

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

No branches or pull requests

1 participant