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

Updated unit test coverage #96

Merged
merged 3 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Release CSI-VolumegroupSnapshotter
# Invocable as a reusable workflow
# Can be manually triggered
on: # yamllint disable-line rule:truthy

Check warning on line 4 in .github/workflows/release.yaml

View workflow job for this annotation

GitHub Actions / Golang Validation / Yaml Lint

4:5 [comments] too few spaces before comment
workflow_call:
workflow_dispatch:
inputs:
version:
description: 'Version to release (major, minor, patch), Example: 1.x.x'
required: true
image:
description: 'Image name. Example: csi-volumegroup-snapshotter'
default: 'csi-volumegroup-snapshotter'
required: true
jobs:
csm-release:
uses: dell/common-github-actions/.github/workflows/csm-release-driver-module.yaml@main
name: Release CSM Drivers and Modules
with:
version: ${{ github.event.inputs.version }}
image: ${{ github.event.inputs.image }}
secrets: inherit
17 changes: 3 additions & 14 deletions controllers/dellcsivolumegroupsnapshot_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,17 +309,6 @@ func (suite *VGSControllerTestSuite) TestHandleSnapContentDelete() {
assert.Equal(suite.T(), "DellCsiVolumeGroupSnapshot.volumegroup.storage.dell.com \"vg-snap\" not found", err.Error())
}

// test a successful reconcile with setup
func (suite *VGSControllerTestSuite) TestSetupManager() {
ns := suite.mockUtils.Specs.Namespace

suite.makeFakeVG(ctx, label, vgName, ns, "Retain", nil)
suite.makeFakeVSC(ctx)
suite.makeFakePV(ctx, fakePvName1, srcVolID)
suite.makeFakePVC(ctx, label, fakePvcName1, ns, fakePvName1)
suite.runFakeVGManagerSetup(vgName, "")
}

// test reconcile without a VG and error should be volumegroup not found
func (suite *VGSControllerTestSuite) TestVgNotFound() {
suite.runFakeVGManager(vgName, suite.mockUtils.Specs.Namespace, "DellCsiVolumeGroupSnapshot.volumegroup.storage.dell.com \"vg-snap\" not found")
Expand All @@ -331,7 +320,7 @@ func (suite *VGSControllerTestSuite) TestVscNotFound() {
suite.runFakeVGManager(vgName, suite.mockUtils.Specs.Namespace, "VolumeSnapshotClass.snapshot.storage.k8s.io \"vsc\" not found")
}

// test getSourceVolIDs with with non-empty pvcLabel but no matching pvc. pvcList should be empty and return error
// test getSourceVolIDs with non-empty pvcLabel but no matching pvc. pvcList should be empty and return error
func (suite *VGSControllerTestSuite) TestNoMatchingPVC() {
harishp8889 marked this conversation as resolved.
Show resolved Hide resolved
noMatchingLbl := "noMatchingLbl"
suite.makeFakeVG(ctx, noMatchingLbl, vgName, suite.mockUtils.Specs.Namespace, "Retain", nil)
Expand Down Expand Up @@ -369,9 +358,9 @@ func (suite *VGSControllerTestSuite) TestPVCNotBound() {

// test grpc call error to driver
func (suite *VGSControllerTestSuite) TestCsiDriverCreateFail() {
suite.makeFakeVG(ctx, label, vgNameTestErr, suite.mockUtils.Specs.Namespace, "Retain", nil)
suite.makeFakeVG(ctx, label+"99", vgNameTestErr+"99", suite.mockUtils.Specs.Namespace, "Retain", nil)
suite.makeFakeVSC(ctx)
suite.makeFakePV(ctx, fakePvName1, srcVolID)
suite.makeFakePV(ctx, fakePvName1+"99", srcVolID+"99")
suite.makeFakePVC(ctx, label, fakePvcName1, suite.mockUtils.Specs.Namespace, fakePvName1)
suite.runFakeVGManager(vgNameTestErr, suite.mockUtils.Specs.Namespace, "deliberately return error to test csi driver extension grpc error")
}
Expand Down
6 changes: 2 additions & 4 deletions test/integration-test/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,11 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dell/csi-vxflexos/v2 v2.4.0 h1:yvdwuWWrDoydra0LzQG3hvHK0IS9oY0alcDdex/VB1s=
github.com/dell/csi-vxflexos/v2 v2.4.0/go.mod h1:YSJTpeScgtC8CU71LrcRE+A10THFaKJy9cKPxaTAclA=
github.com/dell/dell-csi-extensions/common v1.5.0 h1:YOziVlY4gMYP8c6mlMrEmJRciHXEuKApNMSbNEREfe4=
github.com/dell/dell-csi-extensions/common v1.5.0/go.mod h1:i399nWUo/jpNtBFDgEuPN0jPxckEda0hB+P+z4A/R+g=
github.com/dell/dell-csi-extensions/common v1.6.0 h1:TX8BAsreg9zb8T5jXd3DV+SH6Rn5NgBEbnYcMJS3Ccc=
github.com/dell/dell-csi-extensions/common v1.6.0/go.mod h1:1F9D9nja/HNFj9Fy2gu5NbP4l9J2FJgynmz22bYGdzI=
github.com/dell/dell-csi-extensions/podmon v1.0.0 h1:QoxioaFfjIP6cJ4s166A1JhgxIXWe/H0A60edO6nf4E=
github.com/dell/dell-csi-extensions/podmon v1.0.0/go.mod h1:Jjt+zHbLIZ3qJMug17WBYdz7wu90+hd65kgJwv8ZOec=
github.com/dell/dell-csi-extensions/volumeGroupSnapshot v1.6.0 h1:QDSkjBwoRsENWz0cvnEzOSYzwgsibvqXRv+OFUtHsxM=
github.com/dell/dell-csi-extensions/volumeGroupSnapshot v1.6.0/go.mod h1:MSItyMKIc5oCbqc28v73AbpbmP+rJID+KQgjv0ZpRrY=
github.com/dell/dell-csi-extensions/volumeGroupSnapshot v1.7.0 h1:FRzxfjWO8oWnSKmK9KHXmIl4zBRM/IfSPt8qbax4K1k=
github.com/dell/dell-csi-extensions/volumeGroupSnapshot v1.7.0/go.mod h1:v5P0GOpKzWAtukQt8F8dG4yRLelVE2+7bqnbK5iQlAM=
github.com/dell/gocsi v1.6.0 h1:ZmoMi17v1jK0RE0OGEivu52/RqHbOhP5cqs9SHExqa0=
github.com/dell/gocsi v1.6.0/go.mod h1:+ihwgNYeFTv69Ym2X2Ij1idK72JYoNR8CeiWYJrrbho=
Expand Down
Loading