Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix pipeline dotnet version, fix performance test project
Browse files Browse the repository at this point in the history
gamingrobot committed Jan 9, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 57b458a commit fabe191
Showing 5 changed files with 12 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
@@ -223,7 +223,7 @@ jobs:
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
dotnet-version: 8.0.x
- name: Execute Functional Tests
run: |
set -xe
Original file line number Diff line number Diff line change
@@ -2,18 +2,15 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.9.1" />
<PackageReference Include="AutoFixture" Version="4.17.0" />
<PackageReference Include="Punchclock" Version="3.4.3" />
<PackageReference Include="AutoFixture" Version="4.18.1" />
<PackageReference Include="Punchclock" Version="3.4.143" />
<PackageReference Include="KubeOps.KubernetesClient" Version="9.1.5" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\vendor\dotnet-kubernetes-client\src\DotnetKubernetesClient\DotnetKubernetesClient.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -5,8 +5,6 @@ VisualStudioVersion = 17.4.33027.239
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Contrast.K8s.AgentOperator.Performance.ClusterFaker", "Contrast.K8s.AgentOperator.Performance.ClusterFaker.csproj", "{AB0E3E65-4A51-4E07-BA8E-8A7B29587DD5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotnetKubernetesClient", "..\..\..\vendor\dotnet-kubernetes-client\src\DotnetKubernetesClient\DotnetKubernetesClient.csproj", "{0EA3C6CF-36A4-4CB9-8483-CDA6465234E8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Original file line number Diff line number Diff line change
@@ -6,8 +6,8 @@
using System.Linq;
using System.Threading.Tasks;
using AutoFixture;
using DotnetKubernetesClient;
using k8s.Models;
using KubeOps.KubernetesClient;
using Punchclock;

namespace Contrast.K8s.AgentOperator.Performance.ClusterFaker
@@ -49,7 +49,7 @@ public async Task<int> Up(Options.UpOptions options)
private async Task UpNamespace(Options.UpOptions options, int namespaceIndex)
{
var namespaceName = $"{NamespacePrefix}-{namespaceIndex:D3}";
await _client.Save(new V1Namespace
await _client.SaveAsync(new V1Namespace
{
Metadata = new V1ObjectMeta(name: namespaceName)
});
@@ -62,7 +62,7 @@ await _client.Save(new V1Namespace
+ $"deployment {deploymentIndex}/{options.DeploymentsPerNamespaceCount})"
+ "...");

await _client.Save(new V1Deployment
await _client.SaveAsync(new V1Deployment
{
Metadata = new V1ObjectMeta(name: deploymentName, namespaceProperty: namespaceName)
{
@@ -111,7 +111,7 @@ await _client.Save(new V1Deployment
+ $"secret {secretIndex}/{options.SecretsPerNamespaceCount})"
+ "...");

await _client.Save(new V1Secret
await _client.SaveAsync(new V1Secret
{
Metadata = new V1ObjectMeta(name: secretName, namespaceProperty: namespaceName)
{
@@ -126,15 +126,15 @@ public async Task<int> Down(Options.DownOptions options)
{
Console.WriteLine($"Executing 'Down' with options '{options}'.");

var namespaces = await _client.List<V1Namespace>();
var namespaces = await _client.ListAsync<V1Namespace>();
IReadOnlyList<V1Namespace> namespacesToDelete = namespaces.Where(x => x.Name().StartsWith($"{NamespacePrefix}-"))
.ToList();

for (var i = 0; i < namespacesToDelete.Count; i++)
{
var ns = namespacesToDelete[i];
Console.WriteLine($"Deleting '{ns.Name()}' ({i + 1}/{namespacesToDelete.Count})...");
await _client.Delete(ns);
await _client.DeleteAsync(ns);
}

return 0;
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@

using System.Threading.Tasks;
using CommandLine;
using DotnetKubernetesClient;
using KubeOps.KubernetesClient;
using static Contrast.K8s.AgentOperator.Performance.ClusterFaker.Options;

namespace Contrast.K8s.AgentOperator.Performance.ClusterFaker

0 comments on commit fabe191

Please sign in to comment.