duplicacy-util icon indicating copy to clipboard operation
duplicacy-util copied to clipboard

Parse operation configs only if they are specified

Open Algebro7 opened this issue 5 years ago • 3 comments

This fixes a bug where duplicacy-util tries to parse configurations for all operations, even when they aren't specified. Now each configuration is only parsed when the corresponding cmd* flag is passed. It does not change any behavior for the end user.

performBackup() in backup-ops.go correctly honors these flags already, so not parsing the configs should not break anything.

Algebro7 avatar Sep 15 '20 14:09 Algebro7

Looks like the config unit tests need some additional work since these flags aren't passed there

Algebro7 avatar Sep 15 '20 14:09 Algebro7

Updated the unit tests to set the required flags, but do they need to be outside the function so that they are guaranteed to be available everywhere? I'm not sure how golang's testing works as far as threading and such.

Algebro7 avatar Sep 15 '20 14:09 Algebro7

Codecov Report

Merging #52 into master will decrease coverage by 0.06%. The diff coverage is 51.11%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #52      +/-   ##
==========================================
- Coverage   40.36%   40.29%   -0.07%     
==========================================
  Files          12       12              
  Lines         934      938       +4     
==========================================
+ Hits          377      378       +1     
- Misses        515      517       +2     
- Partials       42       43       +1     
Impacted Files Coverage Δ
configBackup.go 51.79% <51.11%> (+1.42%) :arrow_up:
timeutils.go 79.03% <0.00%> (-4.84%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update ef85279...eb2f8b0. Read the comment docs.

codecov[bot] avatar Sep 15 '20 14:09 codecov[bot]