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

Add Unit Tests for Kopia #1723

Merged
merged 33 commits into from
Nov 21, 2022
Merged

Add Unit Tests for Kopia #1723

merged 33 commits into from
Nov 21, 2022

Conversation

r4rajat
Copy link
Contributor

@r4rajat r4rajat commented Nov 8, 2022

Change Overview

Add Unit Tests for Kopia

Pull request type

Please check the type of change your PR introduces:

  • 🚧 Work in Progress
  • 🌈 Refactoring (no functional changes, no api changes)
  • 🐹 Trivial/Minor
  • 🐛 Bugfix
  • 🌻 Feature
  • 🗺️ Documentation
  • 🤖 Test

Issues

  • fixes #issue-number

Test Plan

  • 💪 Manual
  • ⚡ Unit test
  • 💚 E2E

Signed-off-by: Rajat Gupta <rajat.gupta@veeam.com>
Signed-off-by: Rajat Gupta <rajat.gupta@veeam.com>
…opia-Unit-Tests

# Conflicts:
#	pkg/kopia/command/blob_test.go
@github-actions
Copy link
Contributor

github-actions bot commented Nov 8, 2022

Thanks for submitting this pull request 🎉. The team will review it soon and get back to you.

If you haven't already, please take a moment to review our project contributing guideline and Code of Conduct document.

@infraq infraq added this to In Progress in Kanister Nov 8, 2022
@r4rajat r4rajat changed the title Add Unit Tests for Kopia Wrappers Add Unit Tests for kopia/command Package Nov 9, 2022
Signed-off-by: Rajat Gupta <rajat.gupta@veeam.com>
Signed-off-by: Rajat Gupta <rajat.gupta@veeam.com>
Signed-off-by: Rajat Gupta <rajat.gupta@veeam.com>
@r4rajat r4rajat changed the title Add Unit Tests for kopia/command Package Add Unit Tests for Kopia Nov 10, 2022
@ankitjain235
Copy link
Contributor

@r4rajat The ci seems to be failing here.
Also, do these cover tests for all the wrappers?

r4rajat and others added 4 commits November 14, 2022 15:06
# Conflicts:
#	pkg/kopia/command/const.go
Signed-off-by: Rajat Gupta <rajat.gupta@veeam.com>
Signed-off-by: Rajat Gupta <rajat.gupta@veeam.com>
r4rajat and others added 3 commits November 15, 2022 00:16
Signed-off-by: Rajat Gupta <rajat.gupta@veeam.com>
Signed-off-by: Rajat Gupta <rajat.gupta@veeam.com>
@@ -44,7 +40,6 @@ func SnapshotCreate(cmdArgs SnapshotCreateCommandArgs) []string {
args := commonArgs(cmdArgs.CommandArgs, requireLogLevelInfo)
args = args.AppendLoggable(snapshotSubCommand, createSubCommand, cmdArgs.PathToBackup, jsonFlag)
args = args.AppendLoggableKV(parallelFlag, parallelismStr)
args = args.AppendLoggableKV(progressUpdateIntervalFlag, longUpdateInterval)
args = addTags(cmdArgs.Tags, args)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed this because it was already happening below in the function thus the --progress-update-interval flag was getting set twice

DefaultConfigDirectory = "/tmp/kopia-repository"

// DefaultLogDirectory is the directory where kopia log file is created
DefaultLogDirectory = "/tmp/kopia-log"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add these constants as these are being heavily used like kopia.DefaultConfigFilePath in implementation of wrappers

Copy link
Contributor

@ankitjain235 ankitjain235 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comment, LGTM.

go.mod Outdated Show resolved Hide resolved
Signed-off-by: Rajat Gupta <rajat.gupta@veeam.com>
Copy link
Contributor

@ankitjain235 ankitjain235 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Will let someone else also take a look before approving.

Signed-off-by: Rajat Gupta <rajat.gupta@veeam.com>
go.sum Outdated Show resolved Hide resolved
Signed-off-by: Rajat Gupta <rajat.gupta@veeam.com>
Kanister automation moved this from In Progress to Reviewer approved Nov 21, 2022
@r4rajat r4rajat added the kueue label Nov 21, 2022
@r4rajat r4rajat self-assigned this Nov 21, 2022
@r4rajat r4rajat added kueue and removed kueue labels Nov 21, 2022
@mergify mergify bot merged commit c31f4be into master Nov 21, 2022
Kanister automation moved this from Reviewer approved to Done Nov 21, 2022
@mergify mergify bot deleted the Add-Kopia-Unit-Tests branch November 21, 2022 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants