Skip to content

test(install): cover skipping submodule init when none declared (#37702) - #37737

Closed
xxxigm wants to merge 1 commit into
NousResearch:mainfrom
xxxigm:test/install-ps1-skip-empty-submodules
Closed

xxxigm wants to merge 1 commit into
NousResearch:mainfrom
xxxigm:test/install-ps1-skip-empty-submodules

Conversation

@xxxigm

@xxxigm xxxigm commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds test-only coverage for the Windows-installer fix proposed in #37702, which makes scripts/install.ps1 skip git submodule update --init --recursive when the checkout declares no submodules.

This PR does not modify scripts/install.ps1 — it only adds tests. The suite skips itself until the #37702 guard is present, so it stays green on main today and activates automatically once #37702 lands (or is applied alongside).

Background

Hermes ships no .gitmodules, yet the installer always ran git submodule, which on some Windows hosts fails through Git-for-Windows' shell-helper path (git-sh-i18n: No such file or directory). #37702 wraps the step in if (Test-Path ".gitmodules") and prints a skip notice otherwise. That PR left the test checklist items unticked; this PR supplies them.

Type of Change

  • Tests (adding or improving test coverage)

Changes Made

  • tests/test_install_ps1_skip_empty_submodules.py (new):
    • Static guards (portable, run everywhere):
      • git submodule update --init --recursive lives inside the if (Test-Path ".gitmodules") branch.
      • the else branch prints No submodules declared; skipping submodule init.
      • exactly one (guarded) submodule-update call exists — no unconditional duplicate.
    • Behavioral tests (run under PowerShell, skipped when pwsh/powershell is absent, e.g. Linux/macOS CI): execute the extracted block with a stubbed git and assert git submodule runs only when .gitmodules is present.
    • The whole suite skips with a clear reason until install.ps1 contains the fix(install): skip submodule init when none declared #37702 guard, so it never fails on main before the fix merges.

How to Test

pytest tests/test_install_ps1_skip_empty_submodules.py -v

Documentation

Reviewed docs for submodule references. The installer change has no user-facing docs to update. The remaining git submodule mentions (website/docs/getting-started/termux.md, updating.md) describe manual git workflows and are harmless no-ops on a repo without .gitmodules — out of scope here.

Checklist

  • Conventional Commit messages
  • pytest tests/test_install_ps1_skip_empty_submodules.py -q passes (5 skipped on main; 3 passed / 2 skipped with the fix)
  • Tests added
  • Documentation reviewed — N/A for installer internals

Pins PR NousResearch#37702: scripts/install.ps1 should only run
`git submodule update --init --recursive` when the checkout declares a
.gitmodules, otherwise print a skip notice and continue.

Static guards inspect install.ps1 text; pwsh-backed behavioral tests run
the extracted block with a stubbed git (skipped without PowerShell). The
suite skips entirely until the NousResearch#37702 guard is present, so it stays green
on main and activates automatically once the fix lands.
@xxxigm
xxxigm force-pushed the test/install-ps1-skip-empty-submodules branch from 6b1b0b4 to a2ec313 Compare June 3, 2026 00:12
@alt-glitch alt-glitch added type/test Test coverage or test infrastructure P3 Low — cosmetic, nice to have labels Jun 3, 2026
@ethernet8023

Copy link
Copy Markdown
Collaborator

won't fix. see #37702

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low — cosmetic, nice to have type/test Test coverage or test infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants