chore: add test

This commit is contained in:
Adrian Z 2024-04-25 22:49:01 +08:00
parent 3c96313f84
commit 2155169d55
5 changed files with 86 additions and 4 deletions

View file

@ -322,9 +322,11 @@ ${availableProfiles.join(',')}
});
}
await this._gitSparseCheckoutService.checkoutAsync({
selections: projectsSelections,
checkoutAction: 'add'
});
if (projectsSelections.length > 0) {
await this._gitSparseCheckoutService.checkoutAsync({
selections: projectsSelections,
checkoutAction: 'add'
});
}
}
}

View file

@ -21,3 +21,5 @@ Options:
already exists, reset it to <start-point> [boolean]
--profile [array] [default: []]
--add-profile [array] [default: []]
--to [array] [default: []]
--from [array] [default: []]

View file

@ -0,0 +1,29 @@
Running "sparo checkout --from build-test-utilities":
[bold]Sparo accelerator for Git __VERSION__ -[normal][cyan] https://tiktok.github.io/sparo/[default]
Node.js version is __VERSION__ (LTS)
Git version is __VERSION__
[gray]--[[default] [bold]git checkout[normal] [gray]]-------------------------------------------------------------[default]
Your branch is up to date with 'origin/test-artifacts/sparo-real-repo-test'.
[gray]-------------------------------------------------------------------------------[default]
Syncing checkout with the Sparo profile: my-build-test
Checking out and updating core files...
[gray]--[[default] [bold]git sparse-checkout[normal] [gray]]------------------------------------------------------[default]
[gray]-------------------------------------------------------------------------------[default]
Checking out skeleton...
[gray]--[[default] [bold]git sparse-checkout[normal] [gray]]------------------------------------------------------[default]
[gray]-------------------------------------------------------------------------------[default]
Checking out __FOLDER_COUNT__ folders...
[gray]--[[default] [bold]git sparse-checkout[normal] [gray]]------------------------------------------------------[default]
[gray]-------------------------------------------------------------------------------[default]
Sparse checkout completed in __DURATION__

View file

@ -0,0 +1,35 @@
Running "sparo checkout --to sparo-output-test":
[bold]Sparo accelerator for Git __VERSION__ -[normal][cyan] https://tiktok.github.io/sparo/[default]
Node.js version is __VERSION__ (LTS)
Git version is __VERSION__
[gray]--[[default] [bold]git checkout[normal] [gray]]-------------------------------------------------------------[default]
Your branch is up to date with 'origin/test-artifacts/sparo-real-repo-test'.
[gray]-------------------------------------------------------------------------------[default]
Syncing checkout with the Sparo profile: my-build-test
Checking out and updating core files...
[gray]--[[default] [bold]git sparse-checkout[normal] [gray]]------------------------------------------------------[default]
[gray]-------------------------------------------------------------------------------[default]
Checking out skeleton...
[gray]--[[default] [bold]git sparse-checkout[normal] [gray]]------------------------------------------------------[default]
[gray]-------------------------------------------------------------------------------[default]
Checking out __FOLDER_COUNT__ folders...
[gray]--[[default] [bold]git sparse-checkout[normal] [gray]]------------------------------------------------------[default]
[gray]-------------------------------------------------------------------------------[default]
Sparse checkout completed in __DURATION__
Checking out __FOLDER_COUNT__ folders...
[gray]--[[default] [bold]git sparse-checkout[normal] [gray]]------------------------------------------------------[default]
[gray]-------------------------------------------------------------------------------[default]
Sparse checkout completed in __DURATION__

View file

@ -80,6 +80,20 @@ export async function runAsync(runScriptOptions: IRunScriptOptions): Promise<voi
args: ['checkout', '--profile', 'my-build-test'],
currentWorkingDirectory: repoFolder
},
// sparo checkout --to sparo-output-test
{
kind: 'sparo-command',
name: 'checkout-to',
args: ['checkout', '--to', 'sparo-output-test'],
currentWorkingDirectory: repoFolder
},
// sparo checkout --from build-test-utilities
{
kind: 'sparo-command',
name: 'checkout-from',
args: ['checkout', '--from', 'build-test-utilities'],
currentWorkingDirectory: repoFolder
},
// sparo list-profiles
{
kind: 'sparo-command',