Skip to content

Commit

Permalink
Merge pull request #20 from huhouhua/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
huhouhua authored Oct 17, 2023
2 parents a398a9a + bed59a7 commit c098c61
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 21 deletions.
6 changes: 6 additions & 0 deletions test/ArgoCD.Client.Test/ArgoCD.Client.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="KubernetesClient" Version="9.1.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
Expand All @@ -28,4 +29,9 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageReference Include="KubernetesClient">
<Version>12.1.1</Version>
</PackageReference>
</ItemGroup>
</Project>
20 changes: 0 additions & 20 deletions test/ArgoCD.Client.Test/Utilities/ArgoCDContainerFixture.cs

This file was deleted.

38 changes: 38 additions & 0 deletions test/ArgoCD.Client.Test/Utilities/ArgoCDKubernetesFixture.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Threading.Tasks;
using k8s;

namespace ArgoCD.Client.Test.Utilities
{
internal class ArgoCDKubernetesFixture : IAsyncLifetime
{
public static string Token { get; private set; }
public static string ArgoCDHost { get; private set; }
private Kubernetes kubernetes;


public async Task InitializeAsync()
{
await StartKubernetesAsync();

}

public Task DisposeAsync()
{

kubernetes?.Dispose();
return Task.CompletedTask;

}
private async Task StartKubernetesAsync()
{
var config = KubernetesClientConfiguration.BuildConfigFromConfigFile(Environment.GetEnvironmentVariable("KUBECONFIG"));
kubernetes = new Kubernetes(config);

await Task.CompletedTask;
}
}
}
2 changes: 1 addition & 1 deletion test/ArgoCD.Client.Test/VersionClientTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class VersionClientTest
//{
// var file = await _client.GetVersionAsync().
// ConfigureAwait(false);

//}

}
}

0 comments on commit c098c61

Please sign in to comment.