Skip to content

Parse operation configs only if they are specified#52

Open
Algebro7 wants to merge 2 commits intojeffaco:masterfrom
Algebro7:fix-optional-config-parsing
Open

Parse operation configs only if they are specified#52
Algebro7 wants to merge 2 commits intojeffaco:masterfrom
Algebro7:fix-optional-config-parsing

Conversation

@Algebro7
Copy link
Copy Markdown

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
Copy link
Copy Markdown
Author

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

@Algebro7
Copy link
Copy Markdown
Author

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.

@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 15, 2020

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%) ⬆️
timeutils.go 79.03% <0.00%> (-4.84%) ⬇️

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant