Repository navigation
test(git): one git seam, one fake, one contract suite - #2799
Merged
Merged
Conversation
Plans #2146: the process runner is the one seam for git, a git fake answers from recorded transcripts, and a devops ci row records them again.
…2146) GitFake answers a git command from a transcript that the real git recorded. The contract suite replays each transcript over the process fake and over GitFake and starts no program. The worktree, source-state and revision tests use the fake.
The three GitPython users now run git commands through the runner, so the git fake sees every start. GitPython leaves the dependencies and the knowledge base. commit_snapshot gives the same commit id with plumbing. Callers may set GIT_AUTHOR_DATE and GIT_COMMITTER_DATE.
The git row of devops ci records every scenario with the real git outside pytest and fails when a committed transcript differs. It takes 3.5 s and runs in the static job.
…teral (#2146) GitFake finds a record by the arguments, the directory, the standard input and the environment, so a commit with another message, author or date has no record. The recorder keeps the environment and runs git with no user or system configuration file. The host name and the system directories count as host data. commit_snapshot takes each path as a file name and reads no attributes file of the user. pull_tracking raises the reason of git when git config --get fails with a status other than 1. The golden-set test and a new test file start the real git. The clone tests assert on known_hosts and patch no private name. The git fake refuses a shell string and bytes as the process guard does.
Owner
Author
|
Review findings for the ship stage, and what was done. Fixed (tests first, then the cause):
Not fixed: none. Checks:
Filed: a scope label for |
The tests read the real user name. A runner user named runner matched the text of two tests.
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.
Tests of
src/start git more than any other program. This change gives git one seam, the process runner, and one fake for it.git/operations.py,commands/repos.py,ai/research/edges.py) now run git through the process runner. No module ofsrc/imports GitPython, and it leaves the dependencies.GitFakeand thegit_fakefixture answer each git command from a transcript intests/fixtures/git/. A record is found by the arguments, the directory, the standard input and the environment. A command with no record fails the test and names the command. A test with the fixture cannot start a real git.tests/support/git_recording.py) with no user or system configuration file. Thegitrow ofdevops cifails when a transcript differs. A contract suite replays every transcript over the code withProcessFakeand withGitFake.commit_snapshotgives the same commit id as before. It takes each path as a file name and reads no attributes file of the user.pull_trackingraises the reason of git whengit config --getfails.docs/TESTING.mddescribes the seam, the fake and the row.Closes #2146