Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This patch refactors the test framework for better e2e usage: - Introduces TestSupport type to manage all testing - TestSupport handles the creation of resources - TestSupport also manage the start/stop of SSH server and Kind instance - TestSupport ensures that those resources are removed clean and shutdown of services The test framework uses a static pre-generated SSH keypair which is copied to a known location ~/.crashd-testing/randomname for each package that uses the TestSupport framework to manage resources. Signed-off-by: Vladimir Vivien <vivienv@vmware.com>
- Loading branch information
1 parent
e8d19d5
commit da64801
Showing
27 changed files
with
759 additions
and
634 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 |
---|---|---|
|
@@ -4,3 +4,4 @@ | |
dist | ||
.idea | ||
.DS_Store | ||
.testing |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Copyright (c) 2019 VMware, Inc. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package k8s | ||
|
||
import ( | ||
"os" | ||
"testing" | ||
|
||
"github.com/sirupsen/logrus" | ||
|
||
testcrashd "github.com/vmware-tanzu/crash-diagnostics/testing" | ||
) | ||
|
||
var ( | ||
support *testcrashd.TestSupport | ||
) | ||
|
||
func TestMain(m *testing.M) { | ||
test, err := testcrashd.Init() | ||
if err != nil { | ||
logrus.Fatal("failed to initialize test support:", err) | ||
} | ||
|
||
support = test | ||
|
||
if err := support.SetupKindCluster(); err != nil { | ||
logrus.Fatal(err) | ||
} | ||
_, err = support.SetupKindKubeConfig() | ||
if err != nil { | ||
logrus.Fatal(err) | ||
} | ||
|
||
result := m.Run() | ||
|
||
if err := support.TearDown(); err != nil { | ||
logrus.Fatal(err) | ||
} | ||
|
||
os.Exit(result) | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.