-
Notifications
You must be signed in to change notification settings - Fork 701
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
6610 Add pijul to known repository type #6665
Closed
v0d1ch
wants to merge
1
commit into
haskell:master
from
v0d1ch:6610-add-pijul-to-known-repository-type
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,18 +50,24 @@ tests mtimeChange = | |
[ testGroup "check VCS test framework" $ | ||
[ testProperty "git" prop_framework_git | ||
] ++ | ||
[ testProperty "pijul" prop_framework_pijul | ||
] ++ | ||
[ testProperty "darcs" (prop_framework_darcs mtimeChange) | ||
| enableDarcsTests | ||
] | ||
, testGroup "cloneSourceRepo" $ | ||
[ testProperty "git" prop_cloneRepo_git | ||
] ++ | ||
[ testProperty "pijul" prop_cloneRepo_pijul | ||
] ++ | ||
[ testProperty "darcs" (prop_cloneRepo_darcs mtimeChange) | ||
| enableDarcsTests | ||
] | ||
, testGroup "syncSourceRepos" $ | ||
[ testProperty "git" prop_syncRepos_git | ||
] ++ | ||
[ testProperty "pijul" prop_syncRepos_pijul | ||
] ++ | ||
[ testProperty "darcs" (prop_syncRepos_darcs mtimeChange) | ||
| enableDarcsTests | ||
] | ||
|
@@ -83,6 +89,12 @@ prop_framework_darcs mtimeChange = | |
. prop_framework vcsDarcs (vcsTestDriverDarcs mtimeChange) | ||
. WithoutBranchingSupport | ||
|
||
prop_framework_pijul :: BranchingRepoRecipe -> Property | ||
prop_framework_pijul = | ||
ioProperty | ||
. prop_framework vcsPijul vcsTestDriverPijul | ||
. WithBranchingSupport | ||
|
||
prop_cloneRepo_git :: BranchingRepoRecipe -> Property | ||
prop_cloneRepo_git = | ||
ioProperty | ||
|
@@ -96,6 +108,12 @@ prop_cloneRepo_darcs mtimeChange = | |
. prop_cloneRepo vcsDarcs (vcsTestDriverDarcs mtimeChange) | ||
. WithoutBranchingSupport | ||
|
||
prop_cloneRepo_pijul :: BranchingRepoRecipe -> Property | ||
prop_cloneRepo_pijul = | ||
ioProperty | ||
. prop_cloneRepo vcsPijul vcsTestDriverPijul | ||
. WithBranchingSupport | ||
|
||
prop_syncRepos_git :: RepoDirSet -> SyncTargetIterations -> PrngSeed | ||
-> BranchingRepoRecipe -> Property | ||
prop_syncRepos_git destRepoDirs syncTargetSetIterations seed = | ||
|
@@ -113,6 +131,13 @@ prop_syncRepos_darcs mtimeChange destRepoDirs syncTargetSetIterations seed = | |
destRepoDirs syncTargetSetIterations seed | ||
. WithoutBranchingSupport | ||
|
||
prop_syncRepos_pijul :: RepoDirSet -> SyncTargetIterations -> PrngSeed | ||
-> BranchingRepoRecipe -> Property | ||
prop_syncRepos_pijul destRepoDirs syncTargetSetIterations seed = | ||
ioProperty | ||
. prop_syncRepos vcsPijul vcsTestDriverPijul | ||
destRepoDirs syncTargetSetIterations seed | ||
. WithBranchingSupport | ||
|
||
-- ------------------------------------------------------------ | ||
-- * General test setup | ||
|
@@ -693,3 +718,45 @@ vcsTestDriverDarcs mtimeChange verbosity vcs repoRoot = | |
} | ||
darcs = runProgramInvocation verbosity . darcsInvocation | ||
|
||
|
||
vcsTestDriverPijul :: Verbosity -> VCS ConfiguredProgram | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice. Having test is great. I'll take a look at CI so it won't fail (Looks like there is no |
||
-> FilePath -> VCSTestDriver | ||
vcsTestDriverPijul verbosity vcs repoRoot = | ||
VCSTestDriver { | ||
vcsVCS = vcs | ||
|
||
, vcsRepoRoot = repoRoot | ||
|
||
, vcsIgnoreFiles = Set.empty | ||
|
||
, vcsInit = | ||
pijul $ ["init"] | ||
|
||
, vcsAddFile = \_ filename -> | ||
pijul ["add", filename] | ||
|
||
, vcsCommitChanges = \_state -> do | ||
pijul $ ["record", "-a", "-m 'a patch'" | ||
, "-A 'A <[email protected]>'" | ||
] | ||
commit <- pijul' ["log"] | ||
let commit' = takeWhile (not . isSpace) commit | ||
return (Just commit') | ||
|
||
, vcsTagState = \_ tagname -> | ||
pijul ["tag", tagname] | ||
|
||
, vcsSwitchBranch = \RepoState{allBranches} branchname -> do | ||
unless (branchname `Map.member` allBranches) $ | ||
pijul ["from-branch", branchname] | ||
pijul $ ["checkout", branchname] | ||
|
||
, vcsCheckoutTag = Left $ \tagname -> | ||
pijul $ ["checkout", tagname] | ||
} | ||
where | ||
gitInvocation args = (programInvocation (vcsProgram vcs) args) { | ||
progInvokeCwd = Just repoRoot | ||
} | ||
pijul = runProgramInvocation verbosity . gitInvocation | ||
pijul' = getProgramInvocationOutput verbosity . gitInvocation |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm quite sure it does, let us find out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... but indeed, it looks like there are no flags to affect output of
pijul
atm. Surprising :)