Skip to content

Dev - #631

Merged
phenobarbital merged 2 commits into
mainfrom
dev
Nov 6, 2026
Merged

Dev#631
phenobarbital merged 2 commits into
mainfrom
dev

Conversation

@phenobarbital

Copy link
Copy Markdown
Owner

No description provided.

phenobarbital and others added 2 commits November 6, 2026 01:27
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
@phenobarbital
phenobarbital merged commit 2e3ca1c into main Nov 6, 2026
43 checks 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.

1 participant