mirror of
https://github.com/kopia/kopia.git
synced 2026-10-24 07:08:41 -04:00
Refactored most of the CLI tests to run in-process as opposed to using sub-processes (#1059)
* cli: fixed remaining testability indirections for output and logging * cli: added cli.RunSubcommand() which is used in testing to execute a subcommand in the same process * tests: refactored most e2e tests to invoke kopia subcommands in-process * Makefile: enable code coverage for cli/ and internal/ * testing: pass 'testing' tag to unit tests which uses much faster (insecure) password hashing scheme * Makefile: push coverage from PRs again * tests: disable buffer management to reduce memory usage on ARM * cli: fixed misaligned atomic field on ARMHF also temporarily fixed statup-time benign race condition when setting default on the timeZone variable, which is the last global variable.
This commit is contained in:
1 parent
41931f21ce
commit
fcd507a56d
54 files changed
+565
-235
No files matched your search
@@ -13,6 +13,8 @@ type commandIndexOptimize struct {
|
||||
optimizeDropDeletedOlderThan time.Duration
|
||||
optimizeDropContents []string
|
||||
optimizeAllIndexes bool
|
||||
|
||||
svc appServices
|
||||
}
|
||||
|
||||
func (c *commandIndexOptimize) setup(svc appServices, parent commandParent) {
|
||||
@@ -22,10 +24,12 @@ func (c *commandIndexOptimize) setup(svc appServices, parent commandParent) {
|
||||
cmd.Flag("drop-contents", "Drop contents with given IDs").StringsVar(&c.optimizeDropContents)
|
||||
cmd.Flag("all", "Optimize all indexes, even those above maximum size.").BoolVar(&c.optimizeAllIndexes)
|
||||
cmd.Action(svc.directRepositoryWriteAction(c.runOptimizeCommand))
|
||||
|
||||
c.svc = svc
|
||||
}
|
||||
|
||||
func (c *commandIndexOptimize) runOptimizeCommand(ctx context.Context, rep repo.DirectRepositoryWriter) error {
|
||||
advancedCommand(ctx)
|
||||
c.svc.advancedCommand(ctx)
|
||||
|
||||
opt := content.CompactOptions{
|
||||
MaxSmallBlobs: c.optimizeMaxSmallBlobs,
|
||||
|
||||
Reference in new issue
Block a user