-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try running K8S tests using local kind
- Loading branch information
Showing
13 changed files
with
1,026 additions
and
113 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
39 changes: 39 additions & 0 deletions
39
source/Calamari.Tests/KubernetesFixtures/KubernetesClusterOneTimeSetUp.cs
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,39 @@ | ||
#if NETCORE | ||
using System; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Calamari.Tests.KubernetesFixtures.Tools; | ||
using NUnit.Framework; | ||
|
||
namespace Calamari.Tests.KubernetesFixtures | ||
{ | ||
[SetUpFixture] | ||
public class KubernetesClusterOneTimeSetUp | ||
{ | ||
KubernetesClusterInstaller installer; | ||
[OneTimeSetUp] | ||
public async Task OneTimeSetUp() | ||
{ | ||
var toolDownloader = new RequiredToolDownloader(KubernetesTestsGlobalContext.Instance.TemporaryDirectory, KubernetesTestsGlobalContext.Instance.Logger); | ||
var (kindExePath, helmExePath, kubeCtlPath) = await toolDownloader.DownloadRequiredTools(CancellationToken.None); | ||
|
||
installer = new KubernetesClusterInstaller(KubernetesTestsGlobalContext.Instance.TemporaryDirectory, kindExePath, helmExePath, kubeCtlPath, KubernetesTestsGlobalContext.Instance.Logger); | ||
await installer.Install(); | ||
|
||
KubernetesTestsGlobalContext.Instance.SetToolExePaths(helmExePath, kubeCtlPath); | ||
KubernetesTestsGlobalContext.Instance.KubeConfigPath = installer.KubeConfigPath; | ||
|
||
var details = installer.ExtractLoginDetails(); | ||
KubernetesTestsGlobalContext.Instance.ClusterUser = details.ClusterUser; | ||
KubernetesTestsGlobalContext.Instance.ClusterEndpoint = details.ClusterEndpoint; | ||
} | ||
|
||
[OneTimeTearDown] | ||
public void OneTimeTearDown() | ||
{ | ||
installer.Dispose(); | ||
KubernetesTestsGlobalContext.Instance.Dispose(); | ||
} | ||
} | ||
} | ||
#endif |
Oops, something went wrong.