Skip to content
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

Parse operation configs only if they are specified #52

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Algebro7
Copy link

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
Author

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

@Algebro7
Copy link
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

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