Skip to content

The agent that grows with you

test: copy the whole scripts/releases package into source-tree fixtures

ethernetf0ae9e05687e
diff --git a/apps/desktop/electron/channel-build-version.test.ts b/apps/desktop/electron/channel-build-version.test.ts
index a73787104bc..01e17eee381 100644
--- a/apps/desktop/electron/channel-build-version.test.ts
+++ b/apps/desktop/electron/channel-build-version.test.ts
@@ -336,8 +336,6 @@ test('actual MSIX manifest writer consumes the channel quad across rollover inst
'scripts/release-content-types.json',
'scripts/build/python.mjs',
'scripts/bundles/desktop_prepare.py',
- 'scripts/releases/bundle_env.py',
- 'scripts/releases/versioning.py',
'hermes_cli/update_channel.py',
'hermes_cli/release_channels.py',
'hermes_cli/__init__.py',
@@ -348,8 +346,12 @@ test('actual MSIX manifest writer consumes the channel quad across rollover inst
fs.copyFileSync(path.join(repo, file), destination)
}
- // The version parser imports the PM package; copy its complete sibling tree.
- fs.cpSync(path.join(repo, 'pm'), path.join(root, 'pm'), { recursive: true })
+ // The version parser imports the PM package, and desktop_prepare imports
+ // release helpers that import each other (versioning -> semver). Copy both
+ // complete trees so a new intra-package import cannot break the fixture.
+ for (const tree of ['pm', 'scripts/releases']) {
+ fs.cpSync(path.join(repo, tree), path.join(root, tree), { recursive: true })
+ }
fs.symlinkSync(path.join(repo, 'node_modules'), path.join(root, 'node_modules'), 'junction')
const assets: string = path.join(app, 'assets/appx')
fs.mkdirSync(assets)
diff --git a/tests/scripts/test_commit_stamp_identity.py b/tests/scripts/test_commit_stamp_identity.py
index dee2d790aaf..45396118783 100644
--- a/tests/scripts/test_commit_stamp_identity.py
+++ b/tests/scripts/test_commit_stamp_identity.py
@@ -13,13 +13,16 @@ ROOT = Path(__file__).resolve().parents[2]
def test_stamp_uses_built_commit_even_with_dispatch_sha_and_refuses_mismatch(tmp_path):
repo = tmp_path / 'repo'
repo.mkdir()
- for relative in ('scripts/write_install_stamp.py', 'scripts/releases/commit_build.py',
- 'scripts/releases/distance.py', 'scripts/releases/versioning.py',
+ for relative in ('scripts/write_install_stamp.py',
'hermes_cli/__init__.py', 'hermes_cli/update_channel.py', 'hermes_cli/release_channels.py',
'pm/paths.py', 'pm/environments.py', 'hermes_cli/steward.py', 'hermes_constants.py'):
dest = repo / relative
dest.parent.mkdir(parents=True, exist_ok=True)
shutil.copy2(ROOT / relative, dest)
+ # commit_build/distance -> versioning -> semver import each other; copy the
+ # whole package so a new sibling import cannot break the fixture.
+ shutil.copytree(ROOT / 'scripts/releases', repo / 'scripts/releases',
+ ignore=shutil.ignore_patterns('__pycache__'))
def git(*args):
return subprocess.run(['git', *args], cwd=repo, check=True, capture_output=True,
diff --git a/tests/scripts/test_source_build_env.py b/tests/scripts/test_source_build_env.py
index 259d9e26c0a..0b8a1bb8482 100644
--- a/tests/scripts/test_source_build_env.py
+++ b/tests/scripts/test_source_build_env.py
@@ -17,7 +17,6 @@ def _stamp_probe(tmp_path, shell):
repo = tmp_path / "installed source"
for relative in (
"scripts/write_install_stamp.py", "hermes_cli/__init__.py",
- "scripts/releases/distance.py", "scripts/releases/versioning.py",
"hermes_cli/update_channel.py", "hermes_cli/release_channels.py",
"pm/paths.py", "pm/environments.py",
"hermes_cli/steward.py", "hermes_constants.py",
@@ -25,6 +24,10 @@ def _stamp_probe(tmp_path, shell):
dest = repo / relative
dest.parent.mkdir(parents=True, exist_ok=True)
shutil.copy2(ROOT / relative, dest)
+ # distance -> versioning -> semver import each other; copy the whole
+ # package so a new sibling import cannot break the fixture.
+ shutil.copytree(ROOT / "scripts/releases", repo / "scripts/releases",
+ ignore=shutil.ignore_patterns("__pycache__"))
env = dict(os.environ, HOME=str(tmp_path), HERMES_HOME=str(tmp_path / "home"),
GIT_CONFIG_GLOBAL=str(tmp_path / "gitconfig"), GIT_CONFIG_NOSYSTEM="1")
(tmp_path / "gitconfig").write_text('[url "file:///staged/serve.git"]\n'