Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(agent/agentcontainers): support displayApps from devcontainer config#18342

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
DanielleMaywood merged 4 commits intomainfromdm-sub-agent-apps-configuration
Jun 12, 2025
Merged
Show file tree
Hide file tree
Changes from1 commit
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
PrevPrevious commit
NextNext commit
chore: appease linter and remove duplicated test
  • Loading branch information
@DanielleMaywood
DanielleMaywood committedJun 12, 2025
commite12ccc73478d4d2c0b8e5ed91beef8a260a9b777
33 changes: 0 additions & 33 deletionsagent/agentcontainers/devcontainercli_test.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -400,39 +400,6 @@ func TestDevcontainerCLI_WithOutput(t *testing.T) {
assert.NotEmpty(t, outBuf.String(), "stdout buffer should not be empty for exec with log file")
assert.Empty(t, errBuf.String(), "stderr buffer should be empty")
})

t.Run("ReadConfig", func(t *testing.T) {
t.Parallel()

// Buffers to capture stdout and stderr.
outBuf := &bytes.Buffer{}
errBuf := &bytes.Buffer{}

// Simulate CLI execution with a read-config-success.log file.
wantArgs := "read-configuration --workspace-folder /test/workspace --config /test/config.json"
testExecer := &testDevcontainerExecer{
testExePath: testExePath,
wantArgs: wantArgs,
wantError: false,
logFile: filepath.Join("testdata", "devcontainercli", "readconfig", "read-config-success.log"),
}
logger := slogtest.Make(t, &slogtest.Options{IgnoreErrors: true}).Leveled(slog.LevelDebug)
dccli := agentcontainers.NewDevcontainerCLI(logger, testExecer)

// Call ReadConfig with WithReadConfigOutput to capture CLI logs.
ctx := testutil.Context(t, testutil.WaitMedium)
config, err := dccli.ReadConfig(ctx, "/test/workspace", "/test/config.json", agentcontainers.WithReadConfigOutput(outBuf, errBuf))
require.NoError(t, err, "ReadConfig should succeed")
require.NotEmpty(t, config.Configuration.Customizations, "expected non-empty customizations")

// Read expected log content.
expLog, err := os.ReadFile(filepath.Join("testdata", "devcontainercli", "readconfig", "read-config-success.log"))
require.NoError(t, err, "reading expected log file")

// Verify stdout buffer contains the CLI logs and stderr is empty.
assert.Equal(t, string(expLog), outBuf.String(), "stdout buffer should match CLI logs")
assert.Empty(t, errBuf.String(), "stderr buffer should be empty on success")
})
}

// testDevcontainerExecer implements the agentexec.Execer interface for testing.
Expand Down
9 changes: 4 additions & 5 deletionsagent/agentcontainers/subagent_test.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,16 +3,16 @@ package agentcontainers_test
import (
"testing"

"github.com/google/uuid"
"github.com/stretchr/testify/require"

"github.com/coder/coder/v2/agent/agentcontainers"
"github.com/coder/coder/v2/agent/agenttest"
"github.com/coder/coder/v2/agent/proto"
agentproto "github.com/coder/coder/v2/agent/proto"
"github.com/coder/coder/v2/codersdk"
"github.com/coder/coder/v2/codersdk/agentsdk"
"github.com/coder/coder/v2/tailnet"
"github.com/coder/coder/v2/testutil"
"github.com/google/uuid"
"github.com/stretchr/testify/require"
)

func TestSubAgentClient_CreateWithDisplayApps(t *testing.T) {
Expand DownExpand Up@@ -75,7 +75,7 @@ func TestSubAgentClient_CreateWithDisplayApps(t *testing.T) {

ctx := testutil.Context(t, testutil.WaitShort)
logger := testutil.Logger(t)
statsCh := make(chan *proto.Stats)
statsCh := make(chan *agentproto.Stats)

agentAPI := agenttest.NewClient(t, logger, uuid.New(), agentsdk.Manifest{}, statsCh, tailnet.NewCoordinator(logger))

Expand All@@ -102,5 +102,4 @@ func TestSubAgentClient_CreateWithDisplayApps(t *testing.T) {
})
}
})

}
Loading

[8]ページ先頭

©2009-2025 Movatter.jp