mirror of
https://github.com/coder/coder.git
synced 2025-07-12 00:14:10 +00:00
feat(agent/agentcontainers): implement sub agent injection (#18245)
This change adds support for sub agent creation and injection into dev containers. Updates coder/internal#621
This commit is contained in:
committed by
GitHub
parent
44fff54897
commit
fca99174ad
@ -306,8 +306,8 @@ func TestOpenVSCodeDevContainer(t *testing.T) {
|
||||
containerFolder := "/workspace/coder"
|
||||
|
||||
ctrl := gomock.NewController(t)
|
||||
mcl := acmock.NewMockContainerCLI(ctrl)
|
||||
mcl.EXPECT().List(gomock.Any()).Return(
|
||||
mccli := acmock.NewMockContainerCLI(ctrl)
|
||||
mccli.EXPECT().List(gomock.Any()).Return(
|
||||
codersdk.WorkspaceAgentListContainersResponse{
|
||||
Containers: []codersdk.WorkspaceAgentContainer{
|
||||
{
|
||||
@ -337,7 +337,10 @@ func TestOpenVSCodeDevContainer(t *testing.T) {
|
||||
|
||||
_ = agenttest.New(t, client.URL, agentToken, func(o *agent.Options) {
|
||||
o.ExperimentalDevcontainersEnabled = true
|
||||
o.ContainerAPIOptions = append(o.ContainerAPIOptions, agentcontainers.WithContainerCLI(mcl))
|
||||
o.ContainerAPIOptions = append(o.ContainerAPIOptions,
|
||||
agentcontainers.WithContainerCLI(mccli),
|
||||
agentcontainers.WithContainerLabelIncludeFilter("this.label.does.not.exist.ignore.devcontainers", "true"),
|
||||
)
|
||||
})
|
||||
_ = coderdtest.NewWorkspaceAgentWaiter(t, client, workspace.ID).Wait()
|
||||
|
||||
@ -481,8 +484,8 @@ func TestOpenVSCodeDevContainer_NoAgentDirectory(t *testing.T) {
|
||||
containerFolder := "/workspace/coder"
|
||||
|
||||
ctrl := gomock.NewController(t)
|
||||
mcl := acmock.NewMockContainerCLI(ctrl)
|
||||
mcl.EXPECT().List(gomock.Any()).Return(
|
||||
mccli := acmock.NewMockContainerCLI(ctrl)
|
||||
mccli.EXPECT().List(gomock.Any()).Return(
|
||||
codersdk.WorkspaceAgentListContainersResponse{
|
||||
Containers: []codersdk.WorkspaceAgentContainer{
|
||||
{
|
||||
@ -511,7 +514,10 @@ func TestOpenVSCodeDevContainer_NoAgentDirectory(t *testing.T) {
|
||||
|
||||
_ = agenttest.New(t, client.URL, agentToken, func(o *agent.Options) {
|
||||
o.ExperimentalDevcontainersEnabled = true
|
||||
o.ContainerAPIOptions = append(o.ContainerAPIOptions, agentcontainers.WithContainerCLI(mcl))
|
||||
o.ContainerAPIOptions = append(o.ContainerAPIOptions,
|
||||
agentcontainers.WithContainerCLI(mccli),
|
||||
agentcontainers.WithContainerLabelIncludeFilter("this.label.does.not.exist.ignore.devcontainers", "true"),
|
||||
)
|
||||
})
|
||||
_ = coderdtest.NewWorkspaceAgentWaiter(t, client, workspace.ID).Wait()
|
||||
|
||||
|
Reference in New Issue
Block a user