Skip to content

Commit

Permalink
Merge pull request #226 from dell/1422-unity-test-cleanup
Browse files Browse the repository at this point in the history
Enable unit test actions
  • Loading branch information
donatwork authored Aug 15, 2024
2 parents e1645ae + 37cc2da commit 756d20e
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 10 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/actions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ jobs:
uses: dell/common-github-actions/go-code-formatter-linter-vetter@main
with:
directories: ./...
test:
name: Run Go unit tests and check package coverage
runs-on: ubuntu-latest
steps:
- name: Checkout csi-unity
uses: actions/checkout@v4
- name: Run unit tests and check package coverage
uses: dell/common-github-actions/go-code-tester@main
with:
threshold: 20
test-folder: "./service/utils"
race-detector: "true"
go_security_scan:
name: Run gosec
runs-on: ubuntu-latest
Expand Down
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,17 @@ go-build: clean
cd core && go generate
go build .

# Only unit testing utils for now. More work to do but need to start somewhere.
unit-test:
( cd service/utils; go clean -cache; go test -v -coverprofile=c.out ./... )

# Integration tests using Godog. Populate env.sh with the hardware parameters
integration-test:
( cd test/integration-test; sh run.sh )

# Unit tests using Godog. Populate env.sh with the hardware parameters
unit-test:
( cd test/unit-test; sh run.sh )
# BDD tests using Godog. Populate env.sh with the hardware parameters
bdd-test:
( cd test/bdd-test; sh run.sh )

.PHONY: download-csm-common
download-csm-common:
Expand Down
7 changes: 3 additions & 4 deletions dell-csi-helm-installer/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
Copyright © 2020 Dell Inc. or its subsidiaries. All Rights Reserved.
Copyright © 2020-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down Expand Up @@ -45,7 +45,7 @@ This project provides the following capabilitites, each one is discussed in deta
* Install a driver. When installing a driver, options are provided to specify the target namespace as well as options to control the types of verifications to be performed on the target system.
* Upgrade a driver. Upgrading a driver is an effective way to either deploy a new version of the driver or to modify the parameters used in an initial deployment.
* Uninstall a driver. This removes the driver and any installed storage classes.
* Verify a Kubernetes system for suitability with a driver. These verification steps differ, slightly, from driver to driver but include verifiying version compatibility, namespace availability, existance of required secrets, and validating worker node compatibility with driver protocols such as iSCSI, Fibre Channel, NFS, etc
* Verify a Kubernetes system for suitability with a driver. These verification steps differ, slightly, from driver to driver but include verifiying version compatibility, namespace availability, existance of required secrets, and validating worker node compatibility with driver protocols such as iSCSI, Fibre Channel, NFS, etc


Most of these usages require the creation/specification of a values file. These files specify configuration settings that are passed into the driver and configure it for use. To create one of these files, the following steps should be followed:
Expand Down Expand Up @@ -166,4 +166,3 @@ Options:
--node-verify-user[=]<username> Username to SSH to worker nodes as, used to validate node requirements. Default is root
-h Help Help
```

Empty file modified hooks/pre-commit
100644 → 100755
Empty file.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright © 2019 Dell Inc. or its subsidiaries. All Rights Reserved.
Copyright (c) 2019-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -12,7 +12,7 @@
limitations under the License.
*/

package unit_test
package bdd_test

import (
"context"
Expand Down
2 changes: 1 addition & 1 deletion test/unit-test/unit_test.go → test/bdd-test/bdd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
limitations under the License.
*/

package unit_test
package bdd_test

import (
"context"
Expand Down
1 change: 1 addition & 0 deletions test/bdd-test/c.out
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mode: set
File renamed without changes.
File renamed without changes.

0 comments on commit 756d20e

Please sign in to comment.