Skip to content

fix(tests): a commit in a test no longer needs a git identity from the machine - #1070

Merged
xaleryb merged 1 commit into
intel:mainfrom
xaleryb:fix/tests-own-git-identity
Nov 21, 2026
Merged

xaleryb merged 1 commit into
intel:mainfrom
xaleryb:fix/tests-own-git-identity

Conversation

@xaleryb

@xaleryb xaleryb commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Push runs of ci.yml on main have been red since #1043 moved them to GitHub-hosted ubuntu-latest: six tests fail with Author identity unknown (fatal: empty ident name ... not allowed), in tests/test_repo_guidance_history.py (4) and tests/test_repo_run_cache_paths_usable.py (2). The user of a hosted runner has no name, and those tests commit to scratch repositories using whatever git identity the machine happens to have. Pull requests stay green because their jobs run on dokimi-ec2, which has one.

The tests were not independent of the machine. 69 test files run git commit or git merge, and they give git an identity in four different ways (-c user.name= per call, GIT_AUTHOR_* variables, git config, GIT_CONFIG_GLOBAL); a test that does none of them passes only where the global config supplies one. ci/test.py already sets a config of its own for the Intel CI path, for this reason.

A session fixture in tests/conftest.py now points GIT_CONFIG_GLOBAL at a temporary config that holds an identity, so no test reads the global git config of the machine. A test that sets GIT_CONFIG_GLOBAL itself, a repository's own config and -c still win over it.

Rejected: a git config --global step in the workflow. It fixes one runner and leaves the tests depending on the machine, so a contributor with no identity, or a global config with commit.gpgsign=true, gets the same failures.

main also fails two help-text tests on Python 3.11 and 3.12 for an unrelated reason; that is #1069.

Changes

  • tests/conftest.py: the session fixture _git_config_of_the_session (autouse).
  • tests/test_git_identity.py: two tests. git config --global --list shows only the session's identity, which fails on any machine without the fixture; a commit succeeds with user.useConfigOnly=true and no identity variables, which is how a user the system has no name for behaves.

Testing

On Python 3.13, with a hosted-runner-like environment (empty HOME, no system config, user.useConfigOnly=true, no identity variables):

  • test_repo_guidance_history.py and test_repo_run_cache_paths_usable.py on main: 6 failed, the six above. With this change: 86 passed (84 plus the two new tests).
  • With a global config holding commit.gpgsign=true: the same files fail on main and pass with this change.
  • With the fixture made a no-op: the six tests and both new tests fail.
  • Whole suite in that environment: main 7 failed, this change 1 failed; no test fails only with this change. The remaining failure is the same on main and is specific to the machine the suite ran on.
  • ci.yml run by workflow_dispatch on this branch in a fork, where every job runs on ubuntu-latest (the tree is the same as this commit's; only its message was reworded since): Tests on Python 3.13, 3.14 and with the latest dependencies pass, which includes the six tests above, and so do mypy, Static checks, Windows smoke, Fidelity golden and both package smoke tests. Tests on 3.11 and 3.12 fail only test_help_shows_the_registry_metavar_not_the_old_name of test_cli_f1b_reps.py (repo run and eval check), which fails the same way on main and has its own fix in test(cli): the concurrency help check passes on Python before 3.13 #1069.

The checks of this pull request run on dokimi-ec2, which has an identity, so they cannot show the hosted-runner result; the first push run on main after the merge does.

Revert

Revert the commit. Nothing outside tests/ changes.

Checklist

  • Tests added/updated and pytest passes
  • ruff, mypy, and schema checks pass (CI)
  • Docs updated (or N/A): N/A, tests only
  • Self-reviewed per "Before opening a PR" in AGENTS.md
  • No ad-hoc run artifacts committed
  • New files carry the SPDX license header (or are exempt in .github/.licenserc.yaml)

…e machine

Push runs of ci.yml on main have been red since they moved to GitHub-hosted
runners: the user there has no name, so six tests that commit to scratch
repositories failed with "Author identity unknown". A session fixture now
points GIT_CONFIG_GLOBAL at a config of the tests' own, so no test reads the
global git config of the machine it runs on. A test that sets
GIT_CONFIG_GLOBAL itself still wins, and so do repository config and `-c`.

Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com>
@xaleryb
xaleryb requested a review from a team as a code owner November 21, 2026 03:20
@exai-bot

exai-bot commented Nov 21, 2026 •

Copy link
Copy Markdown

✅ OpenCodeReview: Review complete: 0 finding(s) across 2 selected item(s).

CI at ab3accf: 19 passing, 2 skipped.

Review details
  • Commit reviewed: ab3accf against merge base 763d7cd
  • Coverage: 2 files in 1 groups
  • Engine: OpenCodeReview v1.13.5-exai.4.8f73eada, us.openai.gpt-6.1-sol
  • Usage: 53k tokens (38k from cache), 11s
  • Tool calls: 7 (3 file_read, 2 code_search, 1 ci_status, 1 local_check_results)
  • small change set: 2 files

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.91%. Comparing base (763d7cd) to head (ab3accf).
⚠️ Report is 2 commits behind head on main.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1070      +/-   ##
==========================================
- Coverage   95.92%   95.91%   -0.01%     
==========================================
  Files         449      449              
  Lines       59468    59472       +4     
  Branches    10252    10253       +1     
==========================================
+ Hits        57042    57043       +1     
+ Misses       1508     1507       -1     
- Partials      918      922       +4     

see 10 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@xaleryb
xaleryb merged commit 599c5bb into intel:main Nov 21, 2026
21 checks passed
@xaleryb
xaleryb deleted the fix/tests-own-git-identity branch November 21, 2026 05:38
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.

4 participants