-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sanity: clean up configuration handling
NewTestConfig now must be used to initialize the struct with defaults. This makes it easier to introduce new fields where the empty value isn't a suitable default. To ensure that callers adapt to the new semantic, the struct gets renamed. This also allows removing replicated default values all over the source code. SanityContext gets renamed to TestContext for consistency. Its new Finalize method should be used to clean up. To allow that, GinkgoTest returns the context pointer.
- Loading branch information
Showing
10 changed files
with
193 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,15 @@ | ||
package apitest | ||
|
||
import ( | ||
"os" | ||
"testing" | ||
|
||
"github.com/kubernetes-csi/csi-test/pkg/sanity" | ||
) | ||
|
||
func TestMyDriver(t *testing.T) { | ||
config := &sanity.Config{ | ||
TargetPath: os.TempDir() + "/csi-target", | ||
StagingPath: os.TempDir() + "/csi-staging", | ||
Address: "/tmp/e2e-csi-sanity.sock", | ||
TestNodeVolumeAttachLimit: true, | ||
} | ||
config := sanity.NewTestConfig() | ||
config.Address = "/tmp/e2e-csi-sanity.sock" | ||
config.TestNodeVolumeAttachLimit = true | ||
|
||
sanity.Test(t, config) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.