Repository navigation
test: isolate every test from the real home and guard it - #667
Merged
Merged
Conversation
This was referenced Nov 4, 2026
karhu
force-pushed
the
tnet-157/14b-test-isolation
branch
2 times, most recently
from
November 5, 2026 08:16
621245c to
b6fbf50
Compare
karhu
force-pushed
the
tnet-157/14b-test-isolation
branch
from
November 5, 2026 10:57
b6fbf50 to
0007693
Compare
karhu
commented
Nov 5, 2026
karhu
force-pushed
the
tnet-157/14b-test-isolation
branch
from
November 5, 2026 14:05
0007693 to
927ceb1
Compare
karhu
force-pushed
the
tnet-157/14b-test-isolation
branch
from
November 7, 2026 15:20
9eac274 to
63ca45e
Compare
karhu
force-pushed
the
tnet-157/14b-test-isolation
branch
from
November 7, 2026 16:27
63ca45e to
77e446c
Compare
karhu
force-pushed
the
tnet-157/14b-test-isolation
branch
2 times, most recently
from
November 7, 2026 20:26
5bfac56 to
f011123
Compare
karhu
force-pushed
the
tnet-157/14b-test-isolation
branch
from
November 7, 2026 22:40
f011123 to
589e7aa
Compare
karhu
force-pushed
the
tnet-157/14b-test-isolation
branch
from
November 9, 2026 13:56
589e7aa to
f49df4a
Compare
karhu
force-pushed
the
tnet-157/14b-test-isolation
branch
2 times, most recently
from
November 10, 2026 14:39
e3d3e2f to
5dfc450
Compare
There was a problem hiding this comment.
LGTM. This is a test-only change that moves the per-test TimeNet isolation into autouse fixtures.
What was reviewed:
- The root
conftest.pyfixture is loaded for every package, because the only pytest config is the rootpyproject.toml. It patchesenv_filesafely:settings()builds a newTimeNetSettingson each call, so it reads the patchedmodel_configevery time. - Each removed
TIMENET_ISOLATIONdelenv/setenv call relied on the default "on", so removing them changes nothing. The "setting" branch intest_build_cli.pystill sets "off". - The
.envcase of the droppedtest_token_defaults_to_noneis now covered by the new.envguard test. The child-process guard runs withcwd=tmp_path, and the ruled-out.envconcern only affects child builds outside these tests.
Extended reasoning...
The change touches only test code: a new root conftest.py, a new autouse fixture in packages/timenet/tests/conftest.py, a new guard test file, and per-test isolation lines removed from about ten test files, roughly 90 lines in all. It touches no production code and no security-sensitive surface. The removed lines either duplicate what the new fixtures do or set the default value. No CODEOWNERS file covers these paths. The only review threads are the author's own comments on a file outside this diff, so no third-party objection is open.
karhu
force-pushed
the
tnet-157/14b-test-isolation
branch
from
November 10, 2026 15:50
5dfc450 to
8fefa07
Compare
karhu
force-pushed
the
tnet-157/14b-test-isolation
branch
from
November 10, 2026 16:24
8fefa07 to
ac56c07
Compare
Some tests wrote into the real home of the developer. One build test ran in-process without a cache folder, and the remote and S3 tests wrote control databases into ~/.cache/timenet. A TIMENET_* variable of the shell, or a .env file in the working directory, could also change the result of a test. A conftest.py at the root of the repository now gives each test its own empty TIMENET_HOME. It deletes every other TIMENET_* variable, and the settings do not read a .env file during the tests. The connector checks of scripts/check_connectors.py run pytest from the root of the repository, so this conftest.py isolates them too. The timenet tests run as if no connector package were installed. The conftest.py of packages/timenet/tests installs no builder backends for each test. A test that needs a connector installs a fake one with install_backends(monkeypatch, backend). So no test of the timenet package removes the installed connectors itself. The connector tests no longer delete TIMENET_ISOLATION themselves, because the conftest.py deletes it before each test. Part of TNET-157.
Shorter docstrings for the code that this change adds or changes. Part of TNET-157.
karhu
force-pushed
the
tnet-157/14b-test-isolation
branch
from
November 10, 2026 17:41
ac56c07 to
ed44f4f
Compare
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.
The Stack
This stack covers refactoring the internal logic of how releases are resolved during read, download & build, in particular also in the context of parent releases / parent datasets. On top of that it refactors the public TimeNet APIs and CLI interfaces around these actions, to streamline the behavior across them.
This PR
Every test runs with its own empty
TIMENET_HOME.Details
Some tests wrote into the real home folder of the developer. A build test in
test_build_plan.pyran in-process without a cache folder, and the remote and S3 tests wrote control databases into~/.cache/timenet. ATIMENET_*variable in the shell, or a.envfile in the working directory, also changed the result of a test.conftest.pyat the root of the repository gives each test its own emptyTIMENET_HOME. It deletes every otherTIMENET_*variable, and the settings do not read a.envfile during the tests.conftest.pyisolates each connector test too.TIMENET_ISOLATIONthemselves no longer do, because the fixture clears everyTIMENET_*variable.Design decisions
TIMENET_HOME, because at this point in the stack the store, the storage and the cache all derive from it.Breaking changes
Stack
Changes later in the stack:
TIMENET_HOME. The PR on defaults switches it to the new variables.Merge message