Repository navigation
Dev - #631
Merged
Merged
Dev#631
Conversation
Both modules import `navconfig.config` at module level, which loads `env/<ENV>/.env`. `env/`, `etc/` and `settings/` are gitignored and nothing equivalent is tracked, so anywhere but a maintainer's machine they failed during *collection* with "NavConfig initialization failed: environment assets are missing" -- and a collection error takes the whole run down. That is why build.yml had to `--ignore` both files. tests/conftest.py now scaffolds a disposable project (env/dev, env/staging, env/prod, etc/navigator.ini, a settings package) in a temporary directory and exports SITE_ROOT before the first test module imports navconfig; conftest is imported first, which is exactly the window needed, and project_root() honours SITE_ROOT ahead of every other detection strategy, so no production code changes. Side effects worth noting: * The suite stops asserting against the configuration of the checkout it runs in. test_config compared SITE_ROOT with the repository root and read the developer's own CONFIG_TEST and SEND_NOTIFICATIONS. * The fixture declares no Vault, so the Vault tests drive their fake hvac client instead of the maintainer's live server. All 128 tests now run in ~2s; the 26 excluded ones alone used to take ~300s of network I/O. * conftest drops the checkout from sys.path, but only when it really carries a competing `settings` package: ensure_settings_priority() would otherwise move the fixture's settings *directory* to sys.path[0], where `import settings` resolves to settings.py as a module and `from settings.settings import ...` breaks. * A session fixture restores the working directory, because conf.py chdirs into BASE_DIR and Windows cannot remove the current directory. Verified: 128 passed both in the developer checkout and in a simulated clean checkout with no env/, etc/ or settings/. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
test: run test_config and test_kardex_vault on a clean checkout
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.