Skip to content

Isolate candidate attestation test setup from global Git settings #1266

Done

Description

@eowca

Candidate attestation tests can error during fixture setup on contributors’ machines with commit signing enabled. The fixture creates a temporary repository but its private Git wrapper inherits the caller’s Git configuration. Setting a local name and email does not override signing. tests/test_candidate.py:209 tests/test_candidate.py:214 tests/conftest.py:28.

On e90262769, I ran pytest tests/test_candidate.py::test_vanished_squash_parent_passes_real_tree_attestation with a temporary HOME whose .gitconfig set commit.gpgsign=true and gpg.program=/bin/false. Setup errored on git commit -m base with exit 128. Adding GIT_CONFIG_GLOBAL=/dev/null made the same test pass. All Git repositories and the signing configuration in this reproduction were local and disposable.

Acceptance

  • Use the shared isolated Git helper in tests/conftest.py for the candidate fixture in tests/test_candidate.py. Preserve the constructed history and the assertions on the production fetch environment.
  • The candidate test above passes with the synthetic signing configuration and with an empty Git config. The fixture Git commands ignore inherited system, global and inline Git configuration.

Activity

  1. eowca commented on Nov 26, 2026

    @eowca
    ContributorAuthor

    Fixed by #1533 (ff44b5c5). Both candidate seed construction and per-test commits route through the shared helper in tests/conftest.py. The production fetch assertions are still in place.

    Verified at 1ae8075e: the reported test passed with a temporary HOME containing commit.gpgsign=true and gpg.program=/bin/false, and passed again with a clean HOME. The full candidate module under the signing configuration had 80 passed and 9 skipped. A plain Git commit under the same signing settings failed with exit 128 as expected.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions