Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ jobs:
run: dotnet build Conductor.AI.Examples/Conductor.AI.Examples.sln -c Release

integration_tests:
# Repository secrets are intentionally unavailable to pull requests from forks.
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
needs: lint
runs-on: ubuntu-latest
env:
Expand All @@ -107,6 +109,8 @@ jobs:
-l "console;verbosity=normal"

legacy_integration_tests:
# Repository secrets are intentionally unavailable to pull requests from forks.
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
needs: lint
runs-on: ubuntu-latest
env:
Expand All @@ -131,4 +135,3 @@ jobs:
-p:DefineConstants=EXCLUDE_EXAMPLE_WORKERS
--filter "Category=CloudIntegration"
-l "console;verbosity=normal"

54 changes: 54 additions & 0 deletions Tests/Client/TaskRuntimeMetadataTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* Copyright 2025 Conductor Authors.
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
using System.Collections.Generic;
using Newtonsoft.Json;
using Xunit;
using ModelTask = Conductor.Client.Models.Task;

namespace Tests.Client
{
/// <summary>
/// The server delivers host-resolved secret values on Task.runtimeMetadata (wire-only, never
/// persisted) when a worker's TaskDef.runtimeMetadata declares secret names (conductor-oss PR
/// #1255). Verify the client model round-trips the field and omits it when empty.
/// </summary>
public class TaskRuntimeMetadataTests
{
[Fact]
public void RuntimeMetadata_RoundTrips()
{
var task = new ModelTask(taskId: "t1")
{
RuntimeMetadata = new Dictionary<string, string>
{
{ "GITHUB_TOKEN", "ghp_secret" },
{ "GH_APP_ID", "42" }
}
};

var json = JsonConvert.SerializeObject(task);
Assert.Contains("\"runtimeMetadata\"", json);

var back = JsonConvert.DeserializeObject<ModelTask>(json);
Assert.Equal("ghp_secret", back.RuntimeMetadata["GITHUB_TOKEN"]);
Assert.Equal("42", back.RuntimeMetadata["GH_APP_ID"]);
}

[Fact]
public void RuntimeMetadata_OmittedWhenEmpty()
{
var json = JsonConvert.SerializeObject(new ModelTask(taskId: "t1"));
Assert.DoesNotContain("runtimeMetadata", json);
}
}
}
Loading